build: add the pre-push review's configuration
.review-gates/config.json configures Crafter.Review's pre-push review for this repository. Its commits mode lists four lenses: repo-better-solution, repo-bug-prover, repo-security and repo-facts. For each it names a section of this repository's own, under .review-gates/lenses/. It sets requireSigned, forbids AI attribution trailers, and lists fourteen gate0 commands: the version check, the tests, a build of each product and five lint runs. It names no authors: a patch that came by mail, as the README asks for one, keeps its author. One of the five lint runs is new to the guide: the daemon's, whose sources list implementations/nostrod.cpp, which the other four's do not. "Code style" and the command list name it. .gitignore gains the review's two generated directories. AGENTS.template.md gains the directory in its table and two commit guidelines about the review, puts the review into the release recipe before the tag, names the two generated directories among what is never committed, and loses the sentence that asked for a Co-Authored-By trailer on a commit an agent wrote.
This commit is contained in:
parent
d35c486424
commit
564fcdfe0e
7 changed files with 372 additions and 4 deletions
48
.review-gates/config.json
Normal file
48
.review-gates/config.json
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"base": "origin/master",
|
||||
"rangeFrom": "upstream",
|
||||
"aiTrailers": "forbid",
|
||||
"requireSigned": true,
|
||||
"lenses": {
|
||||
"repo-better-solution": {
|
||||
"section": ".review-gates/lenses/repo-better-solution.md"
|
||||
},
|
||||
"repo-bug-prover": {
|
||||
"section": ".review-gates/lenses/repo-bug-prover.md"
|
||||
},
|
||||
"repo-security": {
|
||||
"section": ".review-gates/lenses/repo-security.md"
|
||||
},
|
||||
"repo-facts": {
|
||||
"section": ".review-gates/lenses/repo-facts.md"
|
||||
}
|
||||
},
|
||||
"modes": {
|
||||
"commits": {
|
||||
"kind": "commits",
|
||||
"lenses": [
|
||||
"repo-better-solution",
|
||||
"repo-bug-prover",
|
||||
"repo-security",
|
||||
"repo-facts"
|
||||
],
|
||||
"effort": "xhigh"
|
||||
}
|
||||
},
|
||||
"gate0": [
|
||||
"packaging/flatpak/release-version.sh",
|
||||
"crafter-build test --banks=bunq",
|
||||
"CPLUS_INCLUDE_PATH=/app/include/c++/v1 crafter-build lint --banks=bunq",
|
||||
"crafter-build --banks=bunq",
|
||||
"crafter-build --banks=bunq --lib",
|
||||
"crafter-build --banks=bunq --product=daemon",
|
||||
"CPLUS_INCLUDE_PATH=/app/include/c++/v1 crafter-build lint --banks=bunq --product=daemon",
|
||||
"crafter-build --product=checkout",
|
||||
"crafter-build --banks=bunq --product=fake-system",
|
||||
"CPLUS_INCLUDE_PATH=/app/include/c++/v1 crafter-build lint --banks=bunq --product=fake-system",
|
||||
"crafter-build --banks=bunq --product=app",
|
||||
"CPLUS_INCLUDE_PATH=/app/include/c++/v1 crafter-build lint --banks=bunq --product=app",
|
||||
"crafter-build --banks=bunq --product=app --debug-api",
|
||||
"CPLUS_INCLUDE_PATH=/app/include/c++/v1 crafter-build lint --banks=bunq --product=app --debug-api"
|
||||
]
|
||||
}
|
||||
58
.review-gates/lenses/repo-better-solution.md
Normal file
58
.review-gates/lenses/repo-better-solution.md
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
## This repository: Nostro
|
||||
|
||||
A banking client for Linux that holds people's bank keys and moves
|
||||
their money. The stated design is `README.md` (the manual),
|
||||
`AGENTS.template.md` (the contributor guide; `AGENTS.md` is written
|
||||
from it and the dependencies' notes by every crafter-build run, and is
|
||||
not in the tree), `AGENTS.consumer.md` (the notes agents in a consumer
|
||||
of the library get) and the contracts the guide names: the interfaces
|
||||
under `interfaces/`, `Transaction` for the bytes on disk,
|
||||
`packaging/dbus/*.xml` and
|
||||
`packaging/system/net.catcrafts.Nostro1.policy` for the system bus. The
|
||||
guide's "Design rules" and "Security considerations" are the owner's
|
||||
decisions: a range that departs from one without saying so is a
|
||||
finding; whether one should change is the owner's call, not a defect of
|
||||
the range.
|
||||
|
||||
The layers are the guide's "Project overview": the library and its
|
||||
connectors, nostrod's front and its workers, the CLI,
|
||||
`Nostro.Checkout`, the toolkit, the app, the window, `project.cpp`, the
|
||||
packaging and the one workflow. Read there, and in design rules 1, 8,
|
||||
11, 12 and 13, what belongs in which before judging where a change
|
||||
sits. The questions this repository adds to the charter's:
|
||||
- Does a client decide what nostrod should (design rule 8)? The guide
|
||||
has the app's own checks only spare the user a round trip.
|
||||
- Does logic sit in a `main`, or twice, in the CLI and in the app,
|
||||
where design rule 8 wants it in a partition of the library?
|
||||
- Does the window (`Nostro.Ui.Shell`, `implementations/nostro-app.cpp`,
|
||||
`Nostro.DebugCommands`) decide something that design rule 11 wants in
|
||||
the toolkit or the app, as a function a test can call?
|
||||
- Does anything of the library, nostrod, the CLI or `Nostro.Checkout`
|
||||
import or include anything of the app (design rule 13)?
|
||||
- Does a bank's own code sit where the guide's "Adding a bank" puts it?
|
||||
|
||||
Search first:
|
||||
- The partitions' own helpers, which the guide's "Project overview"
|
||||
lists partition by partition, before a new one beside them.
|
||||
- What the tree already depends on, before a hand-rolled copy:
|
||||
Crafter.Network, Crafter.DB, Crafter.Graphics, libsystemd's sd-bus
|
||||
and sd-event, OpenSSL and the vendored `lib/json.hpp`.
|
||||
- The system's own mechanisms, before one of nostro's: polkit's policy
|
||||
and an administrator's rules, D-Bus activation and systemd, Flatpak's
|
||||
permissions. The guide's "The app end to end" says which
|
||||
confirmations of the app's own were taken out and which are the
|
||||
design: a range that puts one of the former back is a finding.
|
||||
|
||||
Commit shape here: the guide's "Commit and PR guidelines", its "Testing
|
||||
instructions" and design rule 5 say what a change brings with it. A
|
||||
range that leaves one of those things behind is a finding.
|
||||
|
||||
Compatibility: the guide's "Dev environment" says what an install keeps
|
||||
on disk and where, design rule 5 what may change in the transaction
|
||||
tables, and design rule 10 what may change on the bus. Judge a range
|
||||
against an install that is not fresh: files an earlier release wrote
|
||||
under nostrod's state directory, a client and a nostrod a release
|
||||
apart, system files (`packaging/system/`) older than the Flatpaks, a
|
||||
consumer built against `AGENTS.consumer.md` as it was. A range that
|
||||
works only on a fresh install, or breaks one of these without
|
||||
documenting it where its users read, is a finding.
|
||||
90
.review-gates/lenses/repo-bug-prover.md
Normal file
90
.review-gates/lenses/repo-bug-prover.md
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
## This repository: Nostro
|
||||
|
||||
The execution contexts to enumerate, beside the charter's. Each names
|
||||
where to read how it behaves. The guide (`AGENTS.template.md`)
|
||||
describes most of them under "Project overview"; where the guide and
|
||||
the code disagree, the code wins.
|
||||
- The processes: nostrod's front (`RunDaemon`,
|
||||
`implementations/Nostro-Daemon.cpp`), a worker per user (`RunWorker`,
|
||||
`implementations/Nostro-Daemon-Worker.cpp`), the CLI
|
||||
(`implementations/main.cpp`), the app, and a consumer that runs the
|
||||
library in a process of its own. Ask of each what happens when
|
||||
another ends under a call, is absent, is late or comes back, and when
|
||||
a caller leaves while its dialog is open.
|
||||
- Callbacks from C: what sd-bus, sd-event and libwayland call back
|
||||
returns into C. Read in the caller what a return value means there,
|
||||
and ask what an exception that leaves the callback would do.
|
||||
- Waits in the middle of a call: the worker's `Gate` and `HandleLookup`
|
||||
ask polkit and go on when it answers, which a person may do minutes
|
||||
later or never. Ask what else arrives meanwhile, and what the call
|
||||
was checked against that has moved by then.
|
||||
- The bank's protocol: `BunqConnector::Call` in
|
||||
`implementations/Nostro-Bunq.cpp`. Read there what is sent again and
|
||||
when, what is verified and what is not, and what a failure says about
|
||||
whether a write went through. Then ask, for the path the range
|
||||
touches, what a second sending pays twice. The checkout's record
|
||||
(`PayOrder`) is the same question on disk.
|
||||
- Money, text and time from outside: amounts (`ParseAmount`,
|
||||
`FormatAmount`; design rule 3), text from the bank or a caller on its
|
||||
way to a dialog, a terminal or a screen (`Shown()`, the toolkit's
|
||||
`:Text` and `:Edit`), JSON from the bank, and days a person typed
|
||||
(`ParseLocalDate`, `ParseLocalDateEnd`). Attack the edges: overflow,
|
||||
a sign, zero, bytes that are not UTF-8, a DST change, a time zone
|
||||
that is not the test's.
|
||||
- Files: `connectors.json` and its lock
|
||||
(`implementations/Nostro-Connector.cpp`), the Crafter.DB tables
|
||||
(`implementations/Nostro-Account.cpp`, and the checkout's in the
|
||||
worker), a state directory an earlier release wrote. What Crafter.DB
|
||||
does about a second writer, an order, a flush and a migration is its
|
||||
own: read it, do not recall it.
|
||||
- The app (`Nostro.App` on `Nostro.Ui`): state changed by nostrod's
|
||||
answers and by input, and frames built from it. How a press, the
|
||||
focus and a frame built in between relate is in
|
||||
`implementations/Nostro.Ui-Context.cpp` (`Invalidate`, `Stale`). The
|
||||
cases to attack: a list that changed under the finger, an answer
|
||||
between press and release, a sheet that takes the focus, a second
|
||||
press while a change is under way, an answer for a screen the user
|
||||
has left, a `Pending` dropped or moved, the same state at each of the
|
||||
three window sizes.
|
||||
- The window (`Nostro.Ui.Shell`, `implementations/nostro-app.cpp`):
|
||||
listeners that run inside a dispatch (`Loop::Guard`, `Defer`). Ask
|
||||
what a listener that resizes or closes the window it was called for
|
||||
leaves behind. The guide says no test opens a window.
|
||||
- One source, several builds: `project.cpp` returns one product per
|
||||
run and sets the defines that gate code. Code behind a define, or in
|
||||
a product the tests do not build, is still the range's code. aarch64
|
||||
is a cross build by the scripts in `packaging/flatpak/`.
|
||||
- Packaging and the workflow, as scripts:
|
||||
`packaging/system/install.sh` and `uninstall.sh`, the Arch package's
|
||||
install script, the two aarch64 scripts, `release-version.sh` and the
|
||||
workflow's jobs. Ask what each sees on a system that holds an earlier
|
||||
install, and after a step that failed half way.
|
||||
- Tests: `tests/Support/FakeBunq.inc` and `FakeBus.inc` are nostro's
|
||||
reading of bunq, the bus, logind and polkit, not those systems. A
|
||||
test that passes because the fake is more lenient than what it stands
|
||||
for proves nothing about the code.
|
||||
|
||||
Semantics to read on disk rather than recall: libsystemd's headers
|
||||
(`/run/host/usr/include/systemd/sd-bus.h`, `sd-bus-vtable.h`,
|
||||
`sd-event.h`); OpenSSL's (`/run/host/usr/include/openssl/`); the format
|
||||
of a polkit policy (`/run/host/usr/share/polkit-1/policyconfig-1.dtd`);
|
||||
libc++ and clang as the host installs them
|
||||
(`/run/host/usr/include/c++/v1`,
|
||||
`/run/host/usr/lib/clang/<major>/include`); the vendored `lib/json.hpp`;
|
||||
and the Crafter libraries as crafter-build cloned them
|
||||
(`~/.cache/crafter.build/external/<Name>-<hash>/`). Several clones may
|
||||
sit side by side. For the ones `project.cpp` names at a commit
|
||||
(Crafter.Network outside the `--debug-api` build, Crafter.DB,
|
||||
Crafter.Graphics, Crafter.LintRules and Crafter.Debug's build helper),
|
||||
a clone's `.git/HEAD`, or the ref it names, says whether that clone is
|
||||
at the commit. The others follow a branch (the guide's "Dev
|
||||
environment" says which): a semantic of one of those is unverified. A
|
||||
crafter-build that runs as a Flatpak keeps its clones in that app's own
|
||||
directory, which is not readable from here, and compiles with an LLVM
|
||||
of its own: a semantic of a dependency that has no readable clone at
|
||||
the pinned commit is unverified, and where one may differ between LLVM
|
||||
releases the host's headers settle it for the host's build only. Not on
|
||||
disk: bunq's API (the guide's "Gotchas" record what was seen in its
|
||||
sandbox, and the fake is no evidence of the bank), and how polkit and
|
||||
its agents, systemd, bubblewrap and Flatpak behave beyond their
|
||||
headers. A semantic only they settle is unverified.
|
||||
61
.review-gates/lenses/repo-facts.md
Normal file
61
.review-gates/lenses/repo-facts.md
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
## This repository: Nostro
|
||||
|
||||
- A claim that a tree passes the version check, the tests or lint, or
|
||||
builds a product, traces to the Gate 0 log among the evidence paths
|
||||
INPUTS names: each command with its exit code and the sha it ran at.
|
||||
A claim of a run anywhere else traces to a capture of that run that
|
||||
names the commit, or is unverifiable: bunq's sandbox or production, a
|
||||
phone, a compositor or a look at the window (which screens, at which
|
||||
sizes, on what), a polkit agent's dialog, the installed Flatpaks and
|
||||
system files, the aarch64 cross build, CI, the coverage figures
|
||||
(`tests/coverage.sh`), a session of the `--debug-api` build.
|
||||
- The guide asks a commit to say how a bug was reproduced, how a
|
||||
connector was tried against the bank and how a change to a screen was
|
||||
looked at. Each such sentence is a tested claim by the rule above,
|
||||
not a formality.
|
||||
- A test a message names is a name in `project.cpp`'s lists and a
|
||||
`tests/<Name>/main.cpp` whose checks pin what the message says. The
|
||||
tests talk to a fake bunq and a fake system bus of their own
|
||||
(`tests/Support/`): a passing test shows what nostro does with what
|
||||
the fake answers, never what bunq, polkit, logind or a compositor
|
||||
does.
|
||||
- `AGENTS.md` is generated from `AGENTS.template.md` and the
|
||||
dependencies' `AGENTS.consumer.md` and is not in the tree: a claim
|
||||
about it is checked against those sources. `AGENTS.consumer.md`
|
||||
reaches the agents of the library's consumers on their next build:
|
||||
every sentence in it is a claim about the code at the commit that
|
||||
writes it.
|
||||
- The guide dates what it records ("on 2026-11-19 ..."). A dated
|
||||
sentence the range adds claims that the thing was done, seen or
|
||||
decided that day, which is no later than its commit's date, and what
|
||||
it says was run or seen traces like any tested claim.
|
||||
- A claim about a contract is checked against the contract:
|
||||
- the wire against `packaging/dbus/*.xml` and the method tables in
|
||||
`interfaces/Nostro-Bus.cppm`;
|
||||
- a polkit default against
|
||||
`packaging/system/net.catcrafts.Nostro1.policy`;
|
||||
- the size or fingerprint of `Transaction` against the
|
||||
`static_assert`s in `implementations/Nostro-Account.cpp`;
|
||||
- a Flatpak's permissions against
|
||||
`packaging/flatpak/net.catcrafts.Nostrod.yaml`, `project.cpp` and
|
||||
`packaging/flatpak/build-aarch64.sh`;
|
||||
- a dependency's commit against `project.cpp`;
|
||||
- the vendored `lib/json.hpp` against the upstream commit the guide
|
||||
and `packaging/licenses/NOTICE` name and the blob id the guide
|
||||
gives (`git hash-object`);
|
||||
- the version against `NOSTRO_VERSION` in `project.cpp` and the
|
||||
newest `<release>` of
|
||||
`packaging/flatpak/net.catcrafts.Nostro.metainfo.xml`.
|
||||
- A `<release>` entry in that metainfo is the release notes users read:
|
||||
every sentence in it is a claim about the code since the previous
|
||||
tag.
|
||||
- The README is the manual. Its CLI section is a claim about
|
||||
`implementations/main.cpp`, "The app" about the screens, and "How
|
||||
Nostro runs" and "Security" about nostrod and the shipped policy.
|
||||
"Installing" speaks of a published channel that is not on disk: what
|
||||
it says of the remote, and of what a release carries, is unverifiable
|
||||
from here, a note naming what would settle it.
|
||||
- A statement of how bunq behaves (the guide's "Gotchas", a comment, a
|
||||
message) says where it was seen, the sandbox or production, and
|
||||
traces to a capture, or is unverifiable. bunq's specification is not
|
||||
on disk.
|
||||
105
.review-gates/lenses/repo-security.md
Normal file
105
.review-gates/lenses/repo-security.md
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
## This repository: Nostro
|
||||
|
||||
Nostro holds people's bank keys and moves their money. Its stated
|
||||
security model is `README.md` ("How Nostro runs", "Checkout for apps",
|
||||
"Security"), the contributor guide `AGENTS.template.md` ("nostrod end
|
||||
to end", design rules 4, 9, 10 and 12, "Security considerations";
|
||||
`AGENTS.md` is generated from it and is not in the tree) and the files
|
||||
that are the model as shipped:
|
||||
`packaging/system/net.catcrafts.Nostro1.policy` (each polkit action and
|
||||
its defaults), `packaging/system/net.catcrafts.Nostro1.conf` (who may
|
||||
own and call the two bus names), `packaging/system/nostrod.service`
|
||||
(the user nostrod runs as and its hardening), the two Flatpaks'
|
||||
permissions (nostrod's in `packaging/flatpak/net.catcrafts.Nostrod.yaml`,
|
||||
the app's in `project.cpp`, and both again in
|
||||
`packaging/flatpak/build-aarch64.sh`), `packaging/dbus/*.xml` (the
|
||||
wire) and `.forgejo/workflows/flatpak.yaml`. These are the owner's
|
||||
decisions: a range that weakens one without saying so is a finding;
|
||||
whether one should change is the owner's call. Write the standard of
|
||||
Method 1 from them as they are at HEAD, not from this section.
|
||||
|
||||
The charter's web classes (CORS, cookies, CSRF, headers, uploads) have
|
||||
no counterpart here: "not here", with that reason. Their counterparts
|
||||
are the bus policy, the polkit action, a Flatpak's permissions, the
|
||||
unit's hardening and a file's mode.
|
||||
|
||||
The actors to write down, each with what the model above lets it do: a
|
||||
local user, whom nostrod knows by the uid the bus gives for the caller;
|
||||
any program that user runs, the CLI and the app among them, which
|
||||
neither polkit nor nostrod can tell apart; an app at checkout; the
|
||||
bank; polkit and its agent; an administrator, and root; a build, which
|
||||
runs each dependency's `project.cpp`; the workflow's two jobs.
|
||||
|
||||
The decision points, each with where to read it:
|
||||
- Who the caller is, and whose data a call reaches: the front
|
||||
(`implementations/Nostro-Daemon.cpp`) and a worker's start
|
||||
(`RunWorker`).
|
||||
- What needs polkit's yes, and what is read or asked of the bank
|
||||
before it: the worker's `Handle`, `Gate`, `HandleLookup` and `Prompt`
|
||||
(`implementations/Nostro-Daemon-Worker.cpp`), design rule 9 and the
|
||||
policy file. For a hunk there: what does a caller that polkit refuses
|
||||
learn from the answer or the error, and what did the bank see?
|
||||
- What the dialog says against what is then done: the summary, and the
|
||||
details a polkit rule reads, are built in the worker (`Prompt`,
|
||||
`Shown()`, `Counterparty`). A new field, or a new way for text from a
|
||||
caller or the bank to reach a summary, is an input to attack: markup,
|
||||
a control or bidirectional character, a line break, a second amount
|
||||
or payee. A detail that can differ from what the call then does is a
|
||||
way past an administrator's rule.
|
||||
- The checkout (`Order::Read`, `ChooseAccount`, `PayOrder`,
|
||||
`ErrorFor`), which the guide states as the exception to design
|
||||
rule 9: what does an app learn that the README's "Checkout for apps"
|
||||
does not already give it?
|
||||
- Secrets (design rule 4): where a key, a token or the private key is
|
||||
read, kept and passed (`CreatePrivateFile`, `ReadSecret`, a `Secret`
|
||||
field, the sensitive mark on a message), and where one could surface:
|
||||
a `Note`, an exception's message, a D-Bus error, a formatter, a log,
|
||||
a core dump, a command line.
|
||||
- The bank's side (`BunqConnector::Call`, `EnsureServerPublicKey`,
|
||||
`OnAddBunq`): what is verified before it is used, what decides
|
||||
between production and the sandbox, and what is sent again. A path
|
||||
that can pay twice, or pay what was not shown, is a finding here as
|
||||
well as the bug-prover's.
|
||||
- The app and its debug build (design rule 12, and what the guide's
|
||||
"Security considerations" say of `--debug-api`): debug code reachable
|
||||
in another build, a Flatpak made of the debug build, or a loosening
|
||||
of what `Ui_Type` refuses, is a finding.
|
||||
- What is built and shipped: a dependency the range has `project.cpp`
|
||||
name without a commit (the guide's "Dev environment" says which still
|
||||
follow a branch, and why), a pin moved without the range saying to
|
||||
what and why, a `lib/json.hpp` that is not upstream's file (the guide
|
||||
names the commit and the blob id, and `git hash-object` settles it),
|
||||
a Flatpak permission added, a hardening option dropped from the unit,
|
||||
a secret or an echo of the environment added to the workflow, a step
|
||||
of `check` that reaches what `publish` mounts.
|
||||
|
||||
Stated limits are not findings. The README's "Security" and the guide's
|
||||
"Security considerations" say what nostro does not protect against. A
|
||||
range that leaves one as it is inherits it (`pre-existing`). One that
|
||||
widens it, or builds on it, owns it. And one that changes what a user
|
||||
is protected from changes the README's "Security" in the same range.
|
||||
|
||||
What the tests pin is evidence to read. `ShouldServeEveryUser` is where
|
||||
the policy file, the published XML and what a refused caller is told
|
||||
are held; the guide's table of tests says what else it covers. A
|
||||
protection the range adds, without a check there that fails without
|
||||
it, is the `pK:absent` slot's. The fake bus answers as polkit whatever
|
||||
the test told it to: it shows what nostrod does with an answer, not
|
||||
what polkit answers.
|
||||
|
||||
Semantics to read on disk rather than recall: libsystemd's headers
|
||||
(`/run/host/usr/include/systemd/sd-bus.h`, `sd-bus-vtable.h`); the
|
||||
format of a polkit policy
|
||||
(`/run/host/usr/share/polkit-1/policyconfig-1.dtd`); OpenSSL's headers
|
||||
(`/run/host/usr/include/openssl/`); Crafter.Network and Crafter.DB as
|
||||
crafter-build cloned them
|
||||
(`~/.cache/crafter.build/external/<Name>-<hash>/`, at the commit
|
||||
`project.cpp` names for each outside the `--debug-api` build; a clone's
|
||||
`.git/HEAD`, or the ref it names, says which commit it is at). A
|
||||
crafter-build that runs as a Flatpak keeps its clones in that app's own
|
||||
directory, which is not readable from here: a control that rests on a
|
||||
dependency without a readable clone at the pinned commit is
|
||||
`unverified`. Not on disk: what polkit answers and how each agent shows
|
||||
a message (the guide's "Gotchas" record what was read and seen), what
|
||||
systemd's options and Flatpak's permissions enforce, and bunq's API. A
|
||||
control only they settle is `unverified`, with what would settle it.
|
||||
Loading…
Reference in a new issue