approval-md 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +584 -553
- package/SPEC.md +42 -13
- package/dist/src/adapters/agentmail.d.ts +426 -0
- package/dist/src/adapters/agentmail.js +2 -2
- package/dist/src/adapters/conformance.d.ts +149 -0
- package/dist/src/adapters/contract.d.ts +628 -0
- package/dist/src/adapters/contract.js +110 -16
- package/dist/src/adapters/contract.js.map +1 -1
- package/dist/src/adapters/email.d.ts +324 -0
- package/dist/src/adapters/env-passphrase.d.ts +93 -0
- package/dist/src/adapters/public.d.ts +11 -0
- package/dist/src/adapters/public.js +11 -0
- package/dist/src/adapters/public.js.map +1 -0
- package/dist/src/adapters/registry.d.ts +59 -0
- package/dist/src/adapters/registry.js +2 -1
- package/dist/src/adapters/registry.js.map +1 -1
- package/dist/src/adapters/smtp.d.ts +213 -0
- package/dist/src/adapters/vault-provider.d.ts +114 -0
- package/dist/src/adapters/vault-provider.js +3 -3
- package/dist/src/adapters/zzz.d.ts +66 -0
- package/dist/src/adapters/zzz.js +299 -0
- package/dist/src/adapters/zzz.js.map +1 -0
- package/dist/src/channels/batch.d.ts +109 -0
- package/dist/src/channels/cli.d.ts +193 -0
- package/dist/src/channels/conformance.d.ts +92 -0
- package/dist/src/channels/contract.d.ts +623 -0
- package/dist/src/channels/payload-view.d.ts +35 -0
- package/dist/src/channels/render-queue.d.ts +149 -0
- package/dist/src/channels/tagging.d.ts +196 -0
- package/dist/src/channels/telegram.d.ts +1832 -0
- package/dist/src/channels/web.d.ts +341 -0
- package/dist/src/cli/adapter.d.ts +90 -0
- package/dist/src/cli/adapter.js +25 -15
- package/dist/src/cli/adapter.js.map +1 -1
- package/dist/src/cli/amend.d.ts +59 -0
- package/dist/src/cli/args.d.ts +43 -0
- package/dist/src/cli/attest.d.ts +41 -0
- package/dist/src/cli/audit-card.d.ts +62 -0
- package/dist/src/cli/audit.d.ts +59 -0
- package/dist/src/cli/channel-telegram.d.ts +806 -0
- package/dist/src/cli/channel-web.d.ts +131 -0
- package/dist/src/cli/channel.d.ts +71 -0
- package/dist/src/cli/checkpoint-tap.d.ts +169 -0
- package/dist/src/cli/codex.d.ts +2 -0
- package/dist/src/cli/codex.js +172 -0
- package/dist/src/cli/codex.js.map +1 -0
- package/dist/src/cli/coverage.d.ts +61 -0
- package/dist/src/cli/daemon.d.ts +120 -0
- package/dist/src/cli/doctor.d.ts +129 -0
- package/dist/src/cli/doctor.js +119 -5
- package/dist/src/cli/doctor.js.map +1 -1
- package/dist/src/cli/env.d.ts +65 -0
- package/dist/src/cli/execute.d.ts +202 -0
- package/dist/src/cli/exit-codes.d.ts +73 -0
- package/dist/src/cli/feedback.d.ts +60 -0
- package/dist/src/cli/gate-window.d.ts +40 -0
- package/dist/src/cli/gate.d.ts +68 -0
- package/dist/src/cli/git-scope.d.ts +190 -0
- package/dist/src/cli/gloss-attach.d.ts +85 -0
- package/dist/src/cli/gloss-codex-child.d.ts +9 -0
- package/dist/src/cli/gloss-codex.d.ts +24 -0
- package/dist/src/cli/gloss-options.d.ts +42 -0
- package/dist/src/cli/gloss.d.ts +265 -0
- package/dist/src/cli/help.d.ts +103 -0
- package/dist/src/cli/help.js +173 -51
- package/dist/src/cli/help.js.map +1 -1
- package/dist/src/cli/hook-codex.d.ts +78 -0
- package/dist/src/cli/hook-codex.js +167 -0
- package/dist/src/cli/hook-codex.js.map +1 -0
- package/dist/src/cli/hook.d.ts +331 -0
- package/dist/src/cli/hook.js +186 -80
- package/dist/src/cli/hook.js.map +1 -1
- package/dist/src/cli/import.d.ts +35 -0
- package/dist/src/cli/init.d.ts +84 -0
- package/dist/src/cli/init.js +2 -2
- package/dist/src/cli/init.js.map +1 -1
- package/dist/src/cli/instructions.d.ts +23 -0
- package/dist/src/cli/journal.d.ts +41 -0
- package/dist/src/cli/log-advance.d.ts +287 -0
- package/dist/src/cli/log-advance.js +102 -11
- package/dist/src/cli/log-advance.js.map +1 -1
- package/dist/src/cli/log-anchor.d.ts +176 -0
- package/dist/src/cli/log-checkpoint.d.ts +22 -0
- package/dist/src/cli/log-sync.d.ts +243 -0
- package/dist/src/cli/log-verbs.d.ts +16 -0
- package/dist/src/cli/log-verbs.js +7 -1
- package/dist/src/cli/log-verbs.js.map +1 -1
- package/dist/src/cli/long-help.d.ts +70 -0
- package/dist/src/cli/main.d.ts +77 -0
- package/dist/src/cli/main.js +155 -5
- package/dist/src/cli/main.js.map +1 -1
- package/dist/src/cli/mcp.d.ts +52 -0
- package/dist/src/cli/paths.d.ts +56 -0
- package/dist/src/cli/payload.d.ts +58 -0
- package/dist/src/cli/policy.d.ts +43 -0
- package/dist/src/cli/preflight.d.ts +363 -0
- package/dist/src/cli/preflight.js +294 -7
- package/dist/src/cli/preflight.js.map +1 -1
- package/dist/src/cli/progress.d.ts +78 -0
- package/dist/src/cli/prompt.d.ts +209 -0
- package/dist/src/cli/quickstart.d.ts +46 -0
- package/dist/src/cli/quickstart.js +297 -0
- package/dist/src/cli/quickstart.js.map +1 -0
- package/dist/src/cli/records.d.ts +34 -0
- package/dist/src/cli/render.d.ts +22 -0
- package/dist/src/cli/sandbox.d.ts +51 -0
- package/dist/src/cli/scaffold.d.ts +79 -0
- package/dist/src/cli/setup-adapter.d.ts +137 -0
- package/dist/src/cli/setup-adapter.js +38 -4
- package/dist/src/cli/setup-adapter.js.map +1 -1
- package/dist/src/cli/setup-channel.d.ts +117 -0
- package/dist/src/cli/setup-checkpoint.d.ts +57 -0
- package/dist/src/cli/setup-common.d.ts +275 -0
- package/dist/src/cli/setup-flow.d.ts +287 -0
- package/dist/src/cli/setup-service.d.ts +96 -0
- package/dist/src/cli/setup.d.ts +202 -0
- package/dist/src/cli/style.d.ts +320 -0
- package/dist/src/cli/token.d.ts +39 -0
- package/dist/src/cli/up.d.ts +155 -0
- package/dist/src/cli/up.js +4 -2
- package/dist/src/cli/up.js.map +1 -1
- package/dist/src/cli/usage.d.ts +37 -0
- package/dist/src/cli/values.d.ts +40 -0
- package/dist/src/cli/vault.d.ts +59 -0
- package/dist/src/cli/vault.js +2 -2
- package/dist/src/cli/vault.js.map +1 -1
- package/dist/src/cli/verb-registry.d.ts +76 -0
- package/dist/src/cli/verb-registry.js +176 -8
- package/dist/src/cli/verb-registry.js.map +1 -1
- package/dist/src/cli/wordmark.d.ts +31 -0
- package/dist/src/cli/wordmark.js +2 -2
- package/dist/src/codex/doctor.d.ts +13 -0
- package/dist/src/codex/doctor.js +41 -0
- package/dist/src/codex/doctor.js.map +1 -0
- package/dist/src/codex/manifest.d.ts +49 -0
- package/dist/src/codex/manifest.js +103 -0
- package/dist/src/codex/manifest.js.map +1 -0
- package/dist/src/codex/templates.d.ts +41 -0
- package/dist/src/codex/templates.js +319 -0
- package/dist/src/codex/templates.js.map +1 -0
- package/dist/src/codex/trust.d.ts +19 -0
- package/dist/src/codex/trust.js +183 -0
- package/dist/src/codex/trust.js.map +1 -0
- package/dist/src/codex/workspace-plan.d.ts +131 -0
- package/dist/src/codex/workspace-plan.js +561 -0
- package/dist/src/codex/workspace-plan.js.map +1 -0
- package/dist/src/core/actor.d.ts +2 -0
- package/dist/src/core/actor.js +5 -0
- package/dist/src/core/actor.js.map +1 -0
- package/dist/src/core/advance-cycle.d.ts +170 -0
- package/dist/src/core/agents-md.d.ts +276 -0
- package/dist/src/core/apply-patch.d.ts +49 -0
- package/dist/src/core/apply-patch.js +266 -0
- package/dist/src/core/apply-patch.js.map +1 -0
- package/dist/src/core/attest.d.ts +420 -0
- package/dist/src/core/attest.js +13 -1
- package/dist/src/core/attest.js.map +1 -1
- package/dist/src/core/audit.d.ts +492 -0
- package/dist/src/core/budgets.d.ts +238 -0
- package/dist/src/core/checkpoint.d.ts +500 -0
- package/dist/src/core/child-env.d.ts +88 -0
- package/dist/src/core/clock.d.ts +52 -0
- package/dist/src/core/command-class.d.ts +543 -0
- package/dist/src/core/command-class.js +43 -8
- package/dist/src/core/command-class.js.map +1 -1
- package/dist/src/core/coverage-sources/adapter.d.ts +40 -0
- package/dist/src/core/coverage-sources/gh.d.ts +48 -0
- package/dist/src/core/coverage-sources/git.d.ts +101 -0
- package/dist/src/core/coverage.d.ts +217 -0
- package/dist/src/core/credential-spec.d.ts +72 -0
- package/dist/src/core/dark-session.d.ts +331 -0
- package/dist/src/core/decision-refusal.d.ts +185 -0
- package/dist/src/core/env-file.d.ts +450 -0
- package/dist/src/core/execute.d.ts +858 -0
- package/dist/src/core/execute.js +44 -6
- package/dist/src/core/execute.js.map +1 -1
- package/dist/src/core/frontmatter.d.ts +78 -0
- package/dist/src/core/gate-window.d.ts +312 -0
- package/dist/src/core/gate.d.ts +1364 -0
- package/dist/src/core/gate.js +68 -13
- package/dist/src/core/gate.js.map +1 -1
- package/dist/src/core/git-run.d.ts +73 -0
- package/dist/src/core/harness-version.d.ts +157 -0
- package/dist/src/core/harness-version.js +2 -1
- package/dist/src/core/harness-version.js.map +1 -1
- package/dist/src/core/harness-wait.d.ts +55 -0
- package/dist/src/core/head-retry.d.ts +107 -0
- package/dist/src/core/instance.d.ts +253 -0
- package/dist/src/core/intake-limits.d.ts +247 -0
- package/dist/src/core/jcs.d.ts +52 -0
- package/dist/src/core/journal.d.ts +144 -0
- package/dist/src/core/live-draw.d.ts +436 -0
- package/dist/src/core/log-reconcile.d.ts +89 -0
- package/dist/src/core/log-subscribe.d.ts +36 -0
- package/dist/src/core/log-subscribe.js +162 -0
- package/dist/src/core/log-subscribe.js.map +1 -0
- package/dist/src/core/log.d.ts +278 -0
- package/dist/src/core/loop.d.ts +274 -0
- package/dist/src/core/loop.js +11 -0
- package/dist/src/core/loop.js.map +1 -1
- package/dist/src/core/md-fence.d.ts +41 -0
- package/dist/src/core/money.d.ts +147 -0
- package/dist/src/core/payload-census.d.ts +74 -0
- package/dist/src/core/payload-store.d.ts +175 -0
- package/dist/src/core/payload.d.ts +71 -0
- package/dist/src/core/policy-diff.d.ts +292 -0
- package/dist/src/core/policy-diff.js +27 -4
- package/dist/src/core/policy-diff.js.map +1 -1
- package/dist/src/core/policy-expectations.d.ts +199 -0
- package/dist/src/core/policy-explain.d.ts +150 -0
- package/dist/src/core/policy-explain.js +31 -3
- package/dist/src/core/policy-explain.js.map +1 -1
- package/dist/src/core/policy-load.d.ts +527 -0
- package/dist/src/core/policy-load.js +15 -3
- package/dist/src/core/policy-load.js.map +1 -1
- package/dist/src/core/policy-match.d.ts +281 -0
- package/dist/src/core/policy-match.js +20 -9
- package/dist/src/core/policy-match.js.map +1 -1
- package/dist/src/core/policy-proposal.d.ts +265 -0
- package/dist/src/core/prompt-layout.d.ts +221 -0
- package/dist/src/core/protected-path-guard.d.ts +453 -0
- package/dist/src/core/protected-path-guard.js +514 -35
- package/dist/src/core/protected-path-guard.js.map +1 -1
- package/dist/src/core/registration.d.ts +25 -0
- package/dist/src/core/reindex.d.ts +99 -0
- package/dist/src/core/sampler.d.ts +313 -0
- package/dist/src/core/sandbox.d.ts +290 -0
- package/dist/src/core/seal.d.ts +165 -0
- package/dist/src/core/state.d.ts +505 -0
- package/dist/src/core/task-file.d.ts +185 -0
- package/dist/src/core/telegram-config.d.ts +93 -0
- package/dist/src/core/token.d.ts +409 -0
- package/dist/src/core/token.js +21 -38
- package/dist/src/core/token.js.map +1 -1
- package/dist/src/core/validate.d.ts +138 -0
- package/dist/src/core/values.d.ts +137 -0
- package/dist/src/core/vault.d.ts +291 -0
- package/dist/src/core/verified-snapshot.d.ts +204 -0
- package/dist/src/core/verify.d.ts +336 -0
- package/dist/src/core/version.d.ts +8 -0
- package/dist/src/core/wysiwys.d.ts +370 -0
- package/dist/src/daemon/advance-child.d.ts +39 -0
- package/dist/src/daemon/advance.d.ts +466 -0
- package/dist/src/daemon/audit.d.ts +87 -0
- package/dist/src/daemon/daemon.d.ts +1180 -0
- package/dist/src/daemon/dark-session.d.ts +64 -0
- package/dist/src/daemon/draw-child.d.ts +36 -0
- package/dist/src/daemon/draw.d.ts +154 -0
- package/dist/src/daemon/git-evidence.d.ts +173 -0
- package/dist/src/daemon/git-evidence.js +1 -1
- package/dist/src/daemon/projection.d.ts +180 -0
- package/dist/src/daemon/prune.d.ts +207 -0
- package/dist/src/mcp/http.d.ts +113 -0
- package/dist/src/mcp/server.d.ts +265 -0
- package/dist/src/mcp/server.js +9 -1
- package/dist/src/mcp/server.js.map +1 -1
- package/docs/adapter-api.md +106 -0
- package/docs/cli-reference.md +389 -36
- package/docs/codex-enforced-session.md +30 -0
- package/package.json +12 -2
- package/schema/codex-instance.schema.json +82 -0
- package/schema/event.schema.json +2 -1
- package/schema/fixtures/codex-instance/invalid/unpinned-codex-version.json +40 -0
- package/schema/fixtures/codex-instance/valid/canonical.json +40 -0
- package/schema/policy.schema.json +21 -1
- package/templates/codex/README.md +9 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hand-rolled argv parsing. Zero dependencies, by policy: an argument parser is
|
|
3
|
+
* a hundred lines of well-understood string handling, and a CLI that gates
|
|
4
|
+
* side effects should not widen its supply chain to save them.
|
|
5
|
+
*
|
|
6
|
+
* Accepted forms: `--flag value`, `--flag=value`, `-n value`, `-n=value`, and
|
|
7
|
+
* bare boolean flags. Anything else — an unknown flag, a flag missing its
|
|
8
|
+
* value, a non-integer count — is a usage error, never a guess. Fail closed
|
|
9
|
+
* applies to argument handling too: a CLI that quietly reinterprets a typo is a
|
|
10
|
+
* CLI that eventually reindexes the wrong file.
|
|
11
|
+
*/
|
|
12
|
+
/** A flag's expected shape. */
|
|
13
|
+
export type FlagKind = "string" | "boolean";
|
|
14
|
+
export type ParsedFlags = Record<string, string | boolean>;
|
|
15
|
+
export type ParseResult = {
|
|
16
|
+
ok: true;
|
|
17
|
+
flags: ParsedFlags;
|
|
18
|
+
positionals: string[];
|
|
19
|
+
} | {
|
|
20
|
+
ok: false;
|
|
21
|
+
message: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Parse `argv` against a closed spec of flags. Unknown flags fail rather than
|
|
25
|
+
* landing in `positionals`, so a mistyped `--jsno` can never be silently
|
|
26
|
+
* swallowed as a path.
|
|
27
|
+
*/
|
|
28
|
+
export declare function parseFlags(argv: string[], spec: Record<string, FlagKind>): ParseResult;
|
|
29
|
+
/** Read a string flag, or `null` when absent. */
|
|
30
|
+
export declare function stringFlag(flags: ParsedFlags, name: string): string | null;
|
|
31
|
+
/** Read a boolean flag. */
|
|
32
|
+
export declare function boolFlag(flags: ParsedFlags, name: string): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* A non-negative integer flag value. `0` is legal and means "no records" —
|
|
35
|
+
* an explicit request for nothing is not an error.
|
|
36
|
+
*/
|
|
37
|
+
export declare function countFlag(flags: ParsedFlags, name: string): {
|
|
38
|
+
ok: true;
|
|
39
|
+
value: number | null;
|
|
40
|
+
} | {
|
|
41
|
+
ok: false;
|
|
42
|
+
message: string;
|
|
43
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `approval policy attest` (SPEC.md §5.2) — the human-only verb that makes the
|
|
3
|
+
* live policy file operative.
|
|
4
|
+
*
|
|
5
|
+
* As everywhere else in this CLI, the logic is not here: hashing, the actor
|
|
6
|
+
* rule, and the append live in `core/attest.ts`, and the append itself goes
|
|
7
|
+
* through `core/log.ts`. This file resolves paths and identity, decides an exit
|
|
8
|
+
* code, and formats output.
|
|
9
|
+
*
|
|
10
|
+
* Three choices are load-bearing enough to state plainly.
|
|
11
|
+
*
|
|
12
|
+
* **Bytes, not parse.** Attestation hashes the file and does not require the
|
|
13
|
+
* policy to load. A human may deliberately attest a file the engine rejects —
|
|
14
|
+
* and should be able to, because the alternative is a runtime that refuses to
|
|
15
|
+
* record what is actually on disk. A schema-invalid policy still fails closed
|
|
16
|
+
* everywhere it matters (`loadPolicy` answers manual-everything); attesting it
|
|
17
|
+
* changes nothing about that. What attestation records is "a human saw these
|
|
18
|
+
* bytes", not "these bytes are good".
|
|
19
|
+
*
|
|
20
|
+
* **Identity is declared, not proved.** `--as human:<id>`, else
|
|
21
|
+
* `APPROVAL_HUMAN`. The trust boundary is the local machine. This is stated in
|
|
22
|
+
* the help text rather than hidden, because a reader who believes attestation
|
|
23
|
+
* authenticates anyone would be wrong in a way that matters.
|
|
24
|
+
*
|
|
25
|
+
* **An agent actor is a usage error, not an I/O one.** `--as agent:x` is
|
|
26
|
+
* refused at exit 2 with the rule quoted. `core/attest.ts` refuses it again
|
|
27
|
+
* independently; the duplication is deliberate, since the core rule must hold
|
|
28
|
+
* for every caller and not only for this one.
|
|
29
|
+
*
|
|
30
|
+
* **`--organ <path>` attests a gate ORGAN instead (APRV-272)**, and appends a
|
|
31
|
+
* different event (`gate.organ.attested`, never `policy.updated`) for a
|
|
32
|
+
* different reason: the organs are `policy.core`, the gate mints nothing for a
|
|
33
|
+
* human-only class, so a hand edit to one can have no grant and the
|
|
34
|
+
* protected-path guard has no other evidence to accept. The three properties
|
|
35
|
+
* above hold there too — bytes not parse, declared identity, an agent actor
|
|
36
|
+
* refused at exit 2 — and two refusals are added, both usage errors, for a path
|
|
37
|
+
* that is the policy file and for a path that is not an organ at all.
|
|
38
|
+
*/
|
|
39
|
+
import type { Streams } from "./main.js";
|
|
40
|
+
/** `approval policy attest …` — hash the live policy file and log the human's sign-off. */
|
|
41
|
+
export declare function commandPolicyAttest(argv: string[], streams: Streams, cwd: string): number;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The retrospective review card, built from the log (SPEC.md §5.2, §9.1, §10.3;
|
|
3
|
+
* APRV-299).
|
|
4
|
+
*
|
|
5
|
+
* The daemon draws `audit.sampled` records and, until this task, the only place
|
|
6
|
+
* to answer one was `approval audit list` / `approval audit review` in a
|
|
7
|
+
* terminal. The supervised bargain is "execute now, a fraction is reviewed
|
|
8
|
+
* after", and a review nobody is shown is a review that does not happen: on
|
|
9
|
+
* 2026-09-07 sixty of them were sitting in `QUEUE.md` while the approver's
|
|
10
|
+
* phone showed nothing.
|
|
11
|
+
*
|
|
12
|
+
* This module turns each open sample into a {@link ReviewCard} the Telegram
|
|
13
|
+
* channel renders. Three properties are the whole of its contract:
|
|
14
|
+
*
|
|
15
|
+
* - **Everything is derived, nothing is self-reported.** The class comes from
|
|
16
|
+
* the `task.registered` declaration the log already holds, the command
|
|
17
|
+
* breakdown is recomputed by the classifier's own tokenizer over the bytes
|
|
18
|
+
* the payload store holds under the hash the `execution.started` recorded,
|
|
19
|
+
* the rate is the one the `audit.sampled` record states, and the claimed
|
|
20
|
+
* summary carries the actor that registered the action. No payload key an
|
|
21
|
+
* authoring party wrote chooses a row (SPEC.md §11.1 invariant 4).
|
|
22
|
+
* - **It reads only verified records** (invariant 1). A log that does not
|
|
23
|
+
* verify produces a refusal and no cards: a card is a statement to a human
|
|
24
|
+
* about what the log says, and one derived from a log the runtime disowns
|
|
25
|
+
* would be worse than no card at all.
|
|
26
|
+
* - **It decides nothing and appends nothing.** No policy is resolved, no
|
|
27
|
+
* reaction is read, and no enforcement path consults anything here
|
|
28
|
+
* (invariant 10). The card is a rendering; the human's answer goes back
|
|
29
|
+
* through the human-only `reviewSample`.
|
|
30
|
+
*/
|
|
31
|
+
import type { ReviewCard } from "../channels/telegram.js";
|
|
32
|
+
/** Why a build of the review backlog produced nothing. */
|
|
33
|
+
export type ReviewCardRefusalCode = "log-unreadable" | "log-torn-tail" | "log-corrupt";
|
|
34
|
+
export type ReviewCardsResult = {
|
|
35
|
+
ok: true;
|
|
36
|
+
cards: ReviewCard[];
|
|
37
|
+
} | {
|
|
38
|
+
ok: false;
|
|
39
|
+
code: ReviewCardRefusalCode;
|
|
40
|
+
message: string;
|
|
41
|
+
};
|
|
42
|
+
/** Where the payload bytes may be found, for the command breakdown. */
|
|
43
|
+
export interface ReviewCardOptions {
|
|
44
|
+
/**
|
|
45
|
+
* A caller's override for the payload store, with `TagOptions.payload`'s
|
|
46
|
+
* semantics: action key and bound hash in, the value or `undefined` out.
|
|
47
|
+
* Consulted before the store, exactly as the pending queue consults it, so a
|
|
48
|
+
* test and an operator holding bytes elsewhere reach the same rendering.
|
|
49
|
+
*/
|
|
50
|
+
payload?: (actionKey: string, payloadHash: string) => unknown;
|
|
51
|
+
/** The payload store, or `null` for none. Defaults to the one beside the log. */
|
|
52
|
+
payloadStoreDir?: string | null;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Every `audit.sampled` with no later `audit.reviewed`, as review cards, oldest
|
|
56
|
+
* first.
|
|
57
|
+
*
|
|
58
|
+
* The same projection `approval audit list` and `.approval/QUEUE.md` read
|
|
59
|
+
* (`openSamples`), so the phone, the file and the terminal cannot disagree
|
|
60
|
+
* about what is outstanding. Reads a verified log and writes nothing anywhere.
|
|
61
|
+
*/
|
|
62
|
+
export declare function openReviewCards(logPath: string, options?: ReviewCardOptions): ReviewCardsResult;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `approval audit` — the retrospective-review verbs (SPEC.md §5.2, §9.1).
|
|
3
|
+
*
|
|
4
|
+
* Two subcommands, and neither of them samples:
|
|
5
|
+
*
|
|
6
|
+
* - `audit list` reads the open sampled-audit backlog and writes nothing;
|
|
7
|
+
* - `audit review <seq|action-key>` appends `audit.reviewed` and is HUMAN-ONLY.
|
|
8
|
+
*
|
|
9
|
+
* There is deliberately no `approval audit sample`. Sampling is the runtime's
|
|
10
|
+
* decision, made by the daemon from an operator-held secret, and a verb that let
|
|
11
|
+
* a caller sample (or decline to sample) an action of its choosing would hand
|
|
12
|
+
* the party under oversight the control that exists to oversee it. The daemon
|
|
13
|
+
* samples on its tick; that is the only path.
|
|
14
|
+
*
|
|
15
|
+
* The CLI holds no logic, as everywhere else here: eligibility, matching, and
|
|
16
|
+
* the human-only rule live in `core/audit.ts`, and this file is argument
|
|
17
|
+
* parsing, output formatting, and the mapping from a core result to an exit code.
|
|
18
|
+
*/
|
|
19
|
+
import type { Streams } from "./main.js";
|
|
20
|
+
/**
|
|
21
|
+
* The open sampled-audit backlog: `audit.sampled` events with no later
|
|
22
|
+
* `audit.reviewed`, oldest first.
|
|
23
|
+
*
|
|
24
|
+
* The same set `.approval/QUEUE.md` renders and the same set the daemon counts,
|
|
25
|
+
* from the same projection, so the file, the daemon's `audit_backlog`, and this
|
|
26
|
+
* verb cannot disagree. Reads a verified log and writes nothing anywhere.
|
|
27
|
+
*/
|
|
28
|
+
export declare function commandAuditList(argv: string[], streams: Streams, cwd: string): number;
|
|
29
|
+
/**
|
|
30
|
+
* `approval audit review <seq|action-key> [--note "<text>"]`
|
|
31
|
+
*
|
|
32
|
+
* HUMAN-ONLY, enforced in `core/audit.ts` and checked here first so a malformed
|
|
33
|
+
* invocation never reaches the log. `--note` is optional: the event's content is
|
|
34
|
+
* that a person looked, and a note is the reviewer's own record of what they
|
|
35
|
+
* concluded.
|
|
36
|
+
*
|
|
37
|
+
* No attestation is required, for the reason `execution resolve` states: review
|
|
38
|
+
* records an observation, exercises no policy authority, authorizes nothing, and
|
|
39
|
+
* spends no budget. A review blocked because a policy file was edited afterwards
|
|
40
|
+
* would be a supervision backlog held open by an unrelated fact.
|
|
41
|
+
*/
|
|
42
|
+
export declare function commandAuditReview(argv: string[], streams: Streams, cwd: string): number;
|
|
43
|
+
/**
|
|
44
|
+
* The open reconciliation backlog: `reconciliation.required` records with no
|
|
45
|
+
* later `reconciliation.satisfied`.
|
|
46
|
+
*
|
|
47
|
+
* Reads a verified log and writes nothing. The same projection `status` and
|
|
48
|
+
* `doctor` read, so the three can never disagree about what is outstanding.
|
|
49
|
+
*/
|
|
50
|
+
export declare function commandAuditObligations(argv: string[], streams: Streams, cwd: string): number;
|
|
51
|
+
/**
|
|
52
|
+
* `approval audit reconcile <obligation-seq> --note "<text>" [--revert <key>]`
|
|
53
|
+
*
|
|
54
|
+
* HUMAN-ONLY, enforced in `core/audit.ts` and again by the event schema, and
|
|
55
|
+
* checked here first so a malformed invocation never reaches the log.
|
|
56
|
+
*/
|
|
57
|
+
export declare function commandAuditReconcile(argv: string[], streams: Streams, cwd: string): number;
|
|
58
|
+
/** `approval audit <subcommand>` — `list`, `review`, `obligations`, `reconcile`. */
|
|
59
|
+
export declare function commandAudit(argv: string[], streams: Streams, cwd: string): number;
|