approval-md 0.2.0 → 0.3.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 +63 -24
- package/SPEC.md +57 -11
- package/dist/src/channels/contract.d.ts +34 -1
- package/dist/src/channels/contract.js +200 -7
- package/dist/src/channels/contract.js.map +1 -1
- package/dist/src/channels/telegram.d.ts +123 -11
- package/dist/src/channels/telegram.js +218 -23
- package/dist/src/channels/telegram.js.map +1 -1
- package/dist/src/channels/web.d.ts +9 -0
- package/dist/src/channels/web.js +17 -0
- package/dist/src/channels/web.js.map +1 -1
- package/dist/src/cli/amend.js +214 -30
- package/dist/src/cli/amend.js.map +1 -1
- package/dist/src/cli/attest.d.ts +9 -0
- package/dist/src/cli/attest.js +134 -7
- package/dist/src/cli/attest.js.map +1 -1
- package/dist/src/cli/channel-telegram.d.ts +99 -26
- package/dist/src/cli/channel-telegram.js +311 -13
- package/dist/src/cli/channel-telegram.js.map +1 -1
- package/dist/src/cli/channel.d.ts +9 -0
- package/dist/src/cli/channel.js +9 -0
- package/dist/src/cli/channel.js.map +1 -1
- package/dist/src/cli/codex-bridge.d.ts +819 -0
- package/dist/src/cli/codex-bridge.js +1607 -0
- package/dist/src/cli/codex-bridge.js.map +1 -0
- package/dist/src/cli/codex.d.ts +1 -1
- package/dist/src/cli/codex.js +304 -7
- package/dist/src/cli/codex.js.map +1 -1
- package/dist/src/cli/daemon.js +4 -1
- package/dist/src/cli/daemon.js.map +1 -1
- package/dist/src/cli/doctor.js +467 -12
- package/dist/src/cli/doctor.js.map +1 -1
- package/dist/src/cli/execute.js +25 -2
- package/dist/src/cli/execute.js.map +1 -1
- package/dist/src/cli/help.d.ts +6 -2
- package/dist/src/cli/help.js +165 -60
- package/dist/src/cli/help.js.map +1 -1
- package/dist/src/cli/hook-codex.d.ts +49 -1
- package/dist/src/cli/hook-codex.js +60 -1
- package/dist/src/cli/hook-codex.js.map +1 -1
- package/dist/src/cli/hook.d.ts +459 -3
- package/dist/src/cli/hook.js +1062 -114
- package/dist/src/cli/hook.js.map +1 -1
- package/dist/src/cli/import.js +1 -1
- package/dist/src/cli/import.js.map +1 -1
- package/dist/src/cli/main.js +5 -3
- package/dist/src/cli/main.js.map +1 -1
- package/dist/src/cli/policy-apply.d.ts +195 -0
- package/dist/src/cli/policy-apply.js +573 -0
- package/dist/src/cli/policy-apply.js.map +1 -0
- package/dist/src/cli/policy.js +14 -1
- package/dist/src/cli/policy.js.map +1 -1
- package/dist/src/cli/preflight.d.ts +151 -13
- package/dist/src/cli/preflight.js +398 -41
- package/dist/src/cli/preflight.js.map +1 -1
- package/dist/src/cli/sandbox.js +17 -1
- package/dist/src/cli/sandbox.js.map +1 -1
- package/dist/src/cli/scaffold.d.ts +1 -1
- package/dist/src/cli/scaffold.js +1 -1
- package/dist/src/cli/setup-channel.d.ts +9 -0
- package/dist/src/cli/setup-channel.js +28 -1
- package/dist/src/cli/setup-channel.js.map +1 -1
- package/dist/src/cli/setup-common.d.ts +3 -1
- package/dist/src/cli/setup-common.js +3 -2
- package/dist/src/cli/setup-common.js.map +1 -1
- package/dist/src/cli/setup.d.ts +2 -0
- package/dist/src/cli/setup.js +94 -2
- package/dist/src/cli/setup.js.map +1 -1
- package/dist/src/cli/up.js +115 -51
- package/dist/src/cli/up.js.map +1 -1
- package/dist/src/cli/values.js +3 -4
- package/dist/src/cli/values.js.map +1 -1
- package/dist/src/cli/verb-registry.js +174 -9
- package/dist/src/cli/verb-registry.js.map +1 -1
- package/dist/src/cli/wordmark.d.ts +2 -2
- package/dist/src/cli/wordmark.js +2 -2
- package/dist/src/codex/broker.d.ts +229 -0
- package/dist/src/codex/broker.js +548 -0
- package/dist/src/codex/broker.js.map +1 -0
- package/dist/src/codex/runner.d.ts +178 -0
- package/dist/src/codex/runner.js +231 -0
- package/dist/src/codex/runner.js.map +1 -0
- package/dist/src/codex/serve.d.ts +56 -0
- package/dist/src/codex/serve.js +98 -0
- package/dist/src/codex/serve.js.map +1 -0
- package/dist/src/codex/workspace-commit.d.ts +219 -0
- package/dist/src/codex/workspace-commit.js +549 -0
- package/dist/src/codex/workspace-commit.js.map +1 -0
- package/dist/src/core/advance-cycle.d.ts +51 -0
- package/dist/src/core/advance-cycle.js +66 -2
- package/dist/src/core/advance-cycle.js.map +1 -1
- package/dist/src/core/agents-md.d.ts +20 -18
- package/dist/src/core/agents-md.js +33 -31
- package/dist/src/core/agents-md.js.map +1 -1
- package/dist/src/core/attest.d.ts +215 -0
- package/dist/src/core/attest.js +317 -7
- package/dist/src/core/attest.js.map +1 -1
- package/dist/src/core/audit.d.ts +18 -0
- package/dist/src/core/audit.js +13 -0
- package/dist/src/core/audit.js.map +1 -1
- package/dist/src/core/channel-owner.d.ts +213 -0
- package/dist/src/core/channel-owner.js +358 -0
- package/dist/src/core/channel-owner.js.map +1 -0
- package/dist/src/core/command-class.d.ts +154 -0
- package/dist/src/core/command-class.js +673 -20
- package/dist/src/core/command-class.js.map +1 -1
- package/dist/src/core/commit-guard.d.ts +272 -0
- package/dist/src/core/commit-guard.js +424 -0
- package/dist/src/core/commit-guard.js.map +1 -0
- package/dist/src/core/daemon-actor.d.ts +45 -0
- package/dist/src/core/daemon-actor.js +54 -0
- package/dist/src/core/daemon-actor.js.map +1 -0
- package/dist/src/core/dark-session.d.ts +109 -8
- package/dist/src/core/dark-session.js +266 -82
- package/dist/src/core/dark-session.js.map +1 -1
- package/dist/src/core/decision-refusal.d.ts +23 -2
- package/dist/src/core/decision-refusal.js +24 -2
- package/dist/src/core/decision-refusal.js.map +1 -1
- package/dist/src/core/env-file.d.ts +5 -0
- package/dist/src/core/env-file.js +60 -1
- package/dist/src/core/env-file.js.map +1 -1
- package/dist/src/core/execute.d.ts +15 -2
- package/dist/src/core/execute.js +15 -2
- package/dist/src/core/execute.js.map +1 -1
- package/dist/src/core/gate.d.ts +86 -1
- package/dist/src/core/gate.js +81 -1
- package/dist/src/core/gate.js.map +1 -1
- package/dist/src/core/gesture-refusal.d.ts +166 -0
- package/dist/src/core/gesture-refusal.js +188 -0
- package/dist/src/core/gesture-refusal.js.map +1 -0
- package/dist/src/core/harness-version.d.ts +1 -1
- package/dist/src/core/harness-version.js +3 -1
- package/dist/src/core/harness-version.js.map +1 -1
- package/dist/src/core/instance.d.ts +59 -2
- package/dist/src/core/instance.js +113 -0
- package/dist/src/core/instance.js.map +1 -1
- package/dist/src/core/log.d.ts +39 -1
- package/dist/src/core/log.js.map +1 -1
- package/dist/src/core/policy-explain.d.ts +10 -0
- package/dist/src/core/policy-explain.js +32 -0
- package/dist/src/core/policy-explain.js.map +1 -1
- package/dist/src/core/policy-load.d.ts +41 -1
- package/dist/src/core/policy-load.js +21 -3
- package/dist/src/core/policy-load.js.map +1 -1
- package/dist/src/core/policy-match.d.ts +43 -0
- package/dist/src/core/policy-match.js +52 -0
- package/dist/src/core/policy-match.js.map +1 -1
- package/dist/src/core/policy-proposal.d.ts +52 -0
- package/dist/src/core/policy-proposal.js +102 -2
- package/dist/src/core/policy-proposal.js.map +1 -1
- package/dist/src/core/protected-path-guard.d.ts +117 -4
- package/dist/src/core/protected-path-guard.js +362 -48
- package/dist/src/core/protected-path-guard.js.map +1 -1
- package/dist/src/core/question-preempted.d.ts +141 -0
- package/dist/src/core/question-preempted.js +152 -0
- package/dist/src/core/question-preempted.js.map +1 -0
- package/dist/src/core/read-scope.d.ts +172 -0
- package/dist/src/core/read-scope.js +252 -0
- package/dist/src/core/read-scope.js.map +1 -0
- package/dist/src/core/sandbox.d.ts +81 -0
- package/dist/src/core/sandbox.js +190 -1
- package/dist/src/core/sandbox.js.map +1 -1
- package/dist/src/core/sender-identity.d.ts +476 -0
- package/dist/src/core/sender-identity.js +572 -0
- package/dist/src/core/sender-identity.js.map +1 -0
- package/dist/src/core/shlex.d.ts +102 -0
- package/dist/src/core/shlex.js +159 -0
- package/dist/src/core/shlex.js.map +1 -0
- package/dist/src/core/values.d.ts +18 -8
- package/dist/src/core/values.js +36 -1
- package/dist/src/core/values.js.map +1 -1
- package/dist/src/daemon/advance.d.ts +10 -0
- package/dist/src/daemon/advance.js +25 -4
- package/dist/src/daemon/advance.js.map +1 -1
- package/dist/src/daemon/daemon.js +9 -0
- package/dist/src/daemon/daemon.js.map +1 -1
- package/dist/src/daemon/git-evidence.d.ts +2 -2
- package/dist/src/daemon/git-evidence.js +1 -1
- package/dist/src/mcp/server.js +8 -0
- package/dist/src/mcp/server.js.map +1 -1
- package/docs/cli-reference.md +932 -32
- package/docs/codex-enforced-session.md +75 -2
- package/docs/codex-workspace-broker.md +118 -0
- package/package.json +3 -1
- package/schema/event.schema.json +538 -9
- package/schema/fixtures/event/invalid/approval-granted-sender-hashed-false.json +20 -0
- package/schema/fixtures/event/invalid/approval-granted-sender-hashed-raw-id.json +20 -0
- package/schema/fixtures/event/invalid/audit-gesture-refused-human-actor.json +16 -0
- package/schema/fixtures/event/invalid/audit-gesture-refused-no-actor-no-sender.json +15 -0
- package/schema/fixtures/event/invalid/audit-gesture-refused-unknown-gesture.json +16 -0
- package/schema/fixtures/event/invalid/audit-question-preempted-agent-actor.json +16 -0
- package/schema/fixtures/event/invalid/audit-question-preempted-no-question-id.json +16 -0
- package/schema/fixtures/event/invalid/audit-question-preempted-unknown-source.json +15 -0
- package/schema/fixtures/event/invalid/gate-path-signed-off-absolute-path.json +14 -0
- package/schema/fixtures/event/invalid/gate-path-signed-off-agent-actor.json +14 -0
- package/schema/fixtures/event/invalid/gate-path-signed-off-missing-path.json +13 -0
- package/schema/fixtures/event/valid/approval-granted-sender-hashed.json +20 -0
- package/schema/fixtures/event/valid/audit-gesture-refused-review-note.json +21 -0
- package/schema/fixtures/event/valid/audit-gesture-refused-sender-key-unavailable.json +19 -0
- package/schema/fixtures/event/valid/audit-gesture-refused.json +19 -0
- package/schema/fixtures/event/valid/audit-question-preempted-no-verdict.json +16 -0
- package/schema/fixtures/event/valid/audit-question-preempted.json +20 -0
- package/schema/fixtures/event/valid/gate-path-signed-off.json +14 -0
- package/schema/fixtures/event/valid/harness-kind-claude-code.json +23 -0
- package/schema/fixtures/event/valid/harness-kind-codex.json +23 -0
- package/schema/fixtures/event/valid/harness-kind-cursor.json +23 -0
- package/schema/fixtures/event/valid/harness-kind-grok.json +23 -0
- package/schema/fixtures/event/valid/harness-kind-muse.json +23 -0
- package/schema/fixtures/policy/invalid/senders-half-keyed.json +20 -0
- package/schema/fixtures/policy/valid/canonical.json +1 -1
- package/schema/fixtures/policy/valid/senders-keyed.json +24 -0
- package/schema/fixtures/policy-md/valid/canonical.md +1 -1
- package/schema/fixtures/policy-md/valid/with-values.md +5 -7
- package/schema/fixtures/values/invalid/class-shaped.json +1 -1
- package/schema/fixtures/values/invalid/duplicate-entry.json +1 -1
- package/schema/fixtures/values/invalid/non-string-item.json +1 -1
- package/schema/fixtures/values/invalid/over-cap.json +1 -1
- package/schema/fixtures/values/invalid/unknown-key.json +1 -1
- package/schema/fixtures/values/invalid/version-float.json +1 -0
- package/schema/fixtures/values/invalid/version-integer.json +1 -0
- package/schema/fixtures/values/invalid/version-wrong-string.json +1 -0
- package/schema/fixtures/values/valid/empty-lists.json +2 -3
- package/schema/fixtures/values/valid/full.json +5 -7
- package/schema/fixtures/values/valid/minimal.json +1 -1
- package/schema/fixtures/values-md/invalid/schema-invalid.md +5 -3
- package/schema/fixtures/values-md/invalid/two-blocks.md +3 -3
- package/schema/fixtures/values-md/invalid/unterminated.md +2 -2
- package/schema/fixtures/values-md/invalid/version-1.md +69 -0
- package/schema/fixtures/values-md/invalid/version-unquoted.md +64 -0
- package/schema/fixtures/values-md/invalid/yaml-error.md +2 -2
- package/schema/fixtures/values-md/valid/absent.md +1 -1
- package/schema/fixtures/values-md/valid/with-values.md +5 -7
- package/schema/policy.schema.json +54 -2
- package/schema/values.schema.json +7 -11
- package/schema/fixtures/values/invalid/version-string.json +0 -1
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the log says when a decision surface refused a gesture that is not a
|
|
3
|
+
* decision (APRV-355, amended SPEC.md §8).
|
|
4
|
+
*
|
|
5
|
+
* ## The fact this module is about
|
|
6
|
+
*
|
|
7
|
+
* Found while landing APRV-324 (PR #427, 2026-09-17). Once the policy maps
|
|
8
|
+
* Telegram senders, a tap on a CHECKPOINT signature or on a REVIEW from an
|
|
9
|
+
* account the attested policy names nobody for is refused before any verb runs
|
|
10
|
+
* — and records nothing. The only refusal record in the system is
|
|
11
|
+
* `audit.decision_refused`, and it requires a record-level `action_key` and a
|
|
12
|
+
* `payload.decision` of grant, reject or revoke. A signature answers for a
|
|
13
|
+
* chain head and a review answers for a sampled record; neither has either
|
|
14
|
+
* field, so writing one of these there would mean manufacturing both. The lane
|
|
15
|
+
* that found it declined to, correctly.
|
|
16
|
+
*
|
|
17
|
+
* The cost of recording nothing is the same cost `core/decision-refusal.ts`
|
|
18
|
+
* exists to end. Somebody's attention was spent — SPEC.md §11 calls human
|
|
19
|
+
* attention the audit budget — and an attempt was made from an account the
|
|
20
|
+
* operator did not map, and the only trace is a line on a terminal and an
|
|
21
|
+
* answer in a chat. An operator deciding whether to map that account has
|
|
22
|
+
* nothing in the log to read.
|
|
23
|
+
*
|
|
24
|
+
* ## What this record is, and what it is not
|
|
25
|
+
*
|
|
26
|
+
* `audit.gesture_refused` is an AUDIT-TIER record on the strict terms
|
|
27
|
+
* `audit.decision_refused` set, and the terms are the whole of its safety:
|
|
28
|
+
*
|
|
29
|
+
* - it grants nothing and mints no token;
|
|
30
|
+
* - `core/state.ts` settles nothing on it, so no verdict moves;
|
|
31
|
+
* - `core/budgets.ts` charges nothing for it, so no budget moves;
|
|
32
|
+
* - `core/audit.ts` does not sample it and no streak counts it;
|
|
33
|
+
* - NO ENFORCEMENT PATH READS IT. `tests/gesture-refusal.test.ts` pins that by
|
|
34
|
+
* reading the module graph rather than by asserting an intention.
|
|
35
|
+
*
|
|
36
|
+
* The record's own actor is `system:`, for the reason `audit.dark_session`'s
|
|
37
|
+
* and `audit.decision_refused`'s are: this is the runtime's statement about a
|
|
38
|
+
* refusal the runtime made, and a record of a refusal authored by either party
|
|
39
|
+
* to it is a record neither party can be held to. The person, when the runtime
|
|
40
|
+
* can name one, is the SUBJECT and sits in the payload.
|
|
41
|
+
*
|
|
42
|
+
* ## The asymmetry it inherits
|
|
43
|
+
*
|
|
44
|
+
* Refusals handed to AGENTS stay unlogged here too. An agent that is refused
|
|
45
|
+
* reads the code, stops or asks again, and nothing was spent that a record
|
|
46
|
+
* could account for. And a gesture is human by construction: an agent has no
|
|
47
|
+
* checkpoint to sign and no review to give.
|
|
48
|
+
*
|
|
49
|
+
* ## No attestation check, deliberately
|
|
50
|
+
*
|
|
51
|
+
* Nothing here asks whether the policy is attested, for the reason
|
|
52
|
+
* `core/decision-refusal.ts` does not: this write confers no authority.
|
|
53
|
+
* Refusing to record a refusal because a file changed would be the strict
|
|
54
|
+
* direction pointing the wrong way, and the case where it would bite hardest is
|
|
55
|
+
* `policy-not-attested` itself — exactly the refusal an operator most needs the
|
|
56
|
+
* log to remember. The write boundary still validates every record.
|
|
57
|
+
*
|
|
58
|
+
* ## Invariants
|
|
59
|
+
*
|
|
60
|
+
* - **Gate-typed events never accept caller timestamps** (§11.1). `ts` comes
|
|
61
|
+
* from the injected clock at the write boundary; there is no parameter.
|
|
62
|
+
* - **Every check-then-append passes through compare-and-append** (§11.1(5)).
|
|
63
|
+
* The write states the head it was derived against and the whole cycle
|
|
64
|
+
* re-enters from a fresh read on `head-moved` through {@link withHeadRetry}.
|
|
65
|
+
* - **Self-reported fields never reduce scrutiny** (§11.1). Everything here
|
|
66
|
+
* only ADDS to what a reviewer sees. The sender is the transport's own
|
|
67
|
+
* attribution, never anything the message claimed about itself.
|
|
68
|
+
* - **Refusals stay machine-readable and distinct** (§11.1). The surface's code
|
|
69
|
+
* is copied verbatim; nothing here invents, merges or softens one.
|
|
70
|
+
*/
|
|
71
|
+
import { tick } from "./clock.js";
|
|
72
|
+
import { attemptsOf, withHeadRetry } from "./head-retry.js";
|
|
73
|
+
import { appendEvent } from "./log.js";
|
|
74
|
+
import { readVerifiedRecords } from "./state.js";
|
|
75
|
+
/** The actor every record here carries: the gate stating what the gate did. */
|
|
76
|
+
export const GESTURE_REFUSAL_ACTOR = "system:gate";
|
|
77
|
+
/**
|
|
78
|
+
* The gestures this record can be about. **Closed and additive-only** (§11.1
|
|
79
|
+
* invariant 6), and pinned against the event schema's own enum by
|
|
80
|
+
* `tests/gesture-refusal.test.ts`: a kind the sweep can produce and the write
|
|
81
|
+
* boundary refuses is an observation that never reaches a human, which is the
|
|
82
|
+
* failure APRV-358 named a few hours before this task.
|
|
83
|
+
*
|
|
84
|
+
* `review` and `review-note` are two members rather than one because a note is
|
|
85
|
+
* attention spent WRITING rather than attention spent tapping, and an operator
|
|
86
|
+
* reading this record to decide whether to map an account wants to know which
|
|
87
|
+
* they lost.
|
|
88
|
+
*/
|
|
89
|
+
export const REFUSED_GESTURES = ["checkpoint-signature", "review", "review-note"];
|
|
90
|
+
/**
|
|
91
|
+
* The refusals a gesture can meet before any verb runs. **Closed**, and exactly
|
|
92
|
+
* what sender resolution can answer: `sender-unmapped`, `sender-ambiguous` and
|
|
93
|
+
* `sender-key-unavailable` from `core/sender-identity.ts`'s own union, and
|
|
94
|
+
* `policy-not-attested` from `core/attest.ts`, which fires when the policy
|
|
95
|
+
* declaring the mapping is not the attested one and is therefore not in force.
|
|
96
|
+
*
|
|
97
|
+
* `attest-requires-terminal` is deliberately absent: it belongs to an
|
|
98
|
+
* attestation tap, which is a decision and is recorded as one.
|
|
99
|
+
*/
|
|
100
|
+
export const REFUSED_GESTURE_CODES = [
|
|
101
|
+
"sender-unmapped",
|
|
102
|
+
"sender-ambiguous",
|
|
103
|
+
// APRV-370. A keyed mapping this process holds no key for: the runtime could
|
|
104
|
+
// resolve no account at all, which is a different fact from "this account is
|
|
105
|
+
// not mapped" and wants a different repair.
|
|
106
|
+
"sender-key-unavailable",
|
|
107
|
+
"policy-not-attested",
|
|
108
|
+
];
|
|
109
|
+
/** Is `code` one this record can carry? Used where a code arrives as a string. */
|
|
110
|
+
export function isRefusedGestureCode(code) {
|
|
111
|
+
return REFUSED_GESTURE_CODES.includes(code);
|
|
112
|
+
}
|
|
113
|
+
/** The gestures this module records: a person's, and nobody else's. */
|
|
114
|
+
const HUMAN_ACTOR = /^human:.+/u;
|
|
115
|
+
/**
|
|
116
|
+
* Record that a human's gesture was refused.
|
|
117
|
+
*
|
|
118
|
+
* Called by the surface that collected the gesture, on the branch where it
|
|
119
|
+
* refused — never from inside the verb the gesture would have reached, which is
|
|
120
|
+
* never called at all on this path.
|
|
121
|
+
*
|
|
122
|
+
* Best-effort by design: a failure here is returned, never thrown, and the
|
|
123
|
+
* caller shows the refusal either way. The gesture was already refused before
|
|
124
|
+
* this ran, and nothing about that outcome depends on this write landing.
|
|
125
|
+
*
|
|
126
|
+
* Two cases append nothing, and both are the honest answer rather than a
|
|
127
|
+
* silence:
|
|
128
|
+
*
|
|
129
|
+
* - a non-human actor, which is the misconfigured-surface case: nobody's
|
|
130
|
+
* attention was spent, so there is no spend for a record to account for;
|
|
131
|
+
* - a code this record cannot carry, which means a surface refused for a reason
|
|
132
|
+
* this vocabulary does not name. Minting a member here to fit it would widen
|
|
133
|
+
* a closed union at the write boundary from inside a best-effort path.
|
|
134
|
+
*/
|
|
135
|
+
export function recordRefusedGesture(logPath, gesture, refusal, options = {}) {
|
|
136
|
+
if (gesture.actor !== null && !HUMAN_ACTOR.test(gesture.actor)) {
|
|
137
|
+
return { ok: true, audit: null };
|
|
138
|
+
}
|
|
139
|
+
// No person and no account is nothing to say: the record would name neither
|
|
140
|
+
// the subject nor the reason it could not, and the schema refuses it.
|
|
141
|
+
if (gesture.actor === null && gesture.sender === undefined) {
|
|
142
|
+
return { ok: true, audit: null };
|
|
143
|
+
}
|
|
144
|
+
if (!isRefusedGestureCode(refusal.code))
|
|
145
|
+
return { ok: true, audit: null };
|
|
146
|
+
const appended = withHeadRetry(attemptsOf(options.retryOnHeadMoved), () => appendAudit(logPath, gesture, refusal, options));
|
|
147
|
+
return appended.ok ? { ok: true, audit: appended.record } : appended;
|
|
148
|
+
}
|
|
149
|
+
/** The whole cycle: a fresh read for the head, then one append against it. */
|
|
150
|
+
function appendAudit(logPath, gesture, refusal, options) {
|
|
151
|
+
const ts = tick(options);
|
|
152
|
+
const read = readVerifiedRecords(logPath, options.schemaDir === undefined ? {} : { schemaDir: options.schemaDir });
|
|
153
|
+
if (!read.ok) {
|
|
154
|
+
return { ok: false, code: "log-unreadable", message: read.message };
|
|
155
|
+
}
|
|
156
|
+
const payload = {
|
|
157
|
+
...(gesture.actor === null ? {} : { actor: gesture.actor }),
|
|
158
|
+
gesture: gesture.gesture,
|
|
159
|
+
code: refusal.code,
|
|
160
|
+
message: refusal.message,
|
|
161
|
+
};
|
|
162
|
+
if (gesture.sender !== undefined) {
|
|
163
|
+
payload["sender"] = {
|
|
164
|
+
channel: gesture.sender.channel,
|
|
165
|
+
id: gesture.sender.id,
|
|
166
|
+
// APRV-370: only when true, so a raw record does not change shape.
|
|
167
|
+
...(gesture.sender.hashed === true ? { hashed: true } : {}),
|
|
168
|
+
};
|
|
169
|
+
if (gesture.senderSource !== undefined)
|
|
170
|
+
payload["sender_source"] = gesture.senderSource;
|
|
171
|
+
}
|
|
172
|
+
return appendOne(logPath, { ts, actor: GESTURE_REFUSAL_ACTOR, channel: gesture.channel, payload }, options, read.head);
|
|
173
|
+
}
|
|
174
|
+
function appendOne(logPath, input, options, expectedHead) {
|
|
175
|
+
const append = { ...options.append };
|
|
176
|
+
if (options.schemaDir !== undefined)
|
|
177
|
+
append.schemaDir = options.schemaDir;
|
|
178
|
+
const result = appendEvent(logPath, { ...input, event: "audit.gesture_refused" }, { ...append, expectedHead });
|
|
179
|
+
if (result.ok)
|
|
180
|
+
return { ok: true, record: result.record };
|
|
181
|
+
return {
|
|
182
|
+
ok: false,
|
|
183
|
+
code: "append-failed",
|
|
184
|
+
message: `audit.gesture_refused could not be appended: ${result.error.message}`,
|
|
185
|
+
append: result.error,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=gesture-refusal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gesture-refusal.js","sourceRoot":"","sources":["../../../src/core/gesture-refusal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAoD,MAAM,UAAU,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAIjD,+EAA+E;AAC/E,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAC;AAEnD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,sBAAsB,EAAE,QAAQ,EAAE,aAAa,CAAU,CAAC;AAI3F;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,iBAAiB;IACjB,kBAAkB;IAClB,6EAA6E;IAC7E,6EAA6E;IAC7E,4CAA4C;IAC5C,wBAAwB;IACxB,qBAAqB;CACb,CAAC;AAIX,kFAAkF;AAClF,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,OAAQ,qBAA2C,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACrE,CAAC;AAkDD,uEAAuE;AACvE,MAAM,WAAW,GAAG,YAAY,CAAC;AAEjC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAAe,EACf,OAAuB,EACvB,OAA4B,EAC5B,OAAO,GAAgB,EAAE;IAEzB,IAAI,OAAO,CAAC,KAAK,KAAK,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO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ACxB,OAAO,EACP,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,uBAAuB,EAAE,EAC5C,EAAE,GAAG,MAAM,EAAE,YAAY,EAAE,CAC5B,CAAC;IACF,IAAI,MAAM,CAAC,EAAE;QAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;IAC1D,OAAO;QACL,EAAE,EAAE,KAAK;QACT,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,gDAAgD,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE;QAC/E,MAAM,EAAE,MAAM,CAAC,KAAK;KACrB,CAAC;AACJ,CAAC"}
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
* only seam, and a test puts a stub binary in front of it.
|
|
53
53
|
*/
|
|
54
54
|
/** The harnesses this runtime speaks a hook protocol for. */
|
|
55
|
-
export declare const HARNESS_KINDS: readonly ["claude-code", "cursor", "codex"];
|
|
55
|
+
export declare const HARNESS_KINDS: readonly ["claude-code", "cursor", "codex", "grok", "muse"];
|
|
56
56
|
export type HarnessKind = (typeof HARNESS_KINDS)[number];
|
|
57
57
|
/** Is `value` one of the harnesses this runtime knows? */
|
|
58
58
|
export declare function isHarnessKind(value: unknown): value is HarnessKind;
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
import { spawnSync } from "node:child_process";
|
|
55
55
|
import { childEnvironment } from "./child-env.js";
|
|
56
56
|
/** The harnesses this runtime speaks a hook protocol for. */
|
|
57
|
-
export const HARNESS_KINDS = ["claude-code", "cursor", "codex"];
|
|
57
|
+
export const HARNESS_KINDS = ["claude-code", "cursor", "codex", "grok", "muse"];
|
|
58
58
|
/** Is `value` one of the harnesses this runtime knows? */
|
|
59
59
|
export function isHarnessKind(value) {
|
|
60
60
|
return typeof value === "string" && HARNESS_KINDS.includes(value);
|
|
@@ -69,6 +69,8 @@ export const HARNESS_BINARY = {
|
|
|
69
69
|
"claude-code": "claude",
|
|
70
70
|
cursor: "cursor-agent",
|
|
71
71
|
codex: "codex",
|
|
72
|
+
grok: "grok",
|
|
73
|
+
muse: "muse",
|
|
72
74
|
};
|
|
73
75
|
/**
|
|
74
76
|
* How long a version string may be, and the reason there is a cap at all.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harness-version.js","sourceRoot":"","sources":["../../../src/core/harness-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,6DAA6D;AAC7D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,aAAa,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"harness-version.js","sourceRoot":"","sources":["../../../src/core/harness-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,6DAA6D;AAC7D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAIzF,0DAA0D;AAC1D,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,aAAmC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC3F,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAA0C;IACnE,aAAa,EAAE,QAAQ;IACvB,MAAM,EAAE,cAAc;IACtB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,IAAI,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CAAC;IAC/B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,MAAM,OAAO,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAC1C,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,uBAAuB,CAAC,OAAO,CAAC,KAAK,OAAO;QAAE,OAAO,IAAI,CAAC;IAC7F,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,CAAC;AACrD,CAAC"}
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
* secret and is not derived from one — it is a hash of a directory path, which
|
|
48
48
|
* `.approval/env` already carries in the open.
|
|
49
49
|
*/
|
|
50
|
-
import { type ResolvedVariable } from "./env-file.js";
|
|
50
|
+
import { type ResolvedVariable, type SourceRunner } from "./env-file.js";
|
|
51
51
|
import type { PolicyLoadResult } from "./policy-load.js";
|
|
52
52
|
/**
|
|
53
53
|
* The unscoped item names this project used before APRV-178.
|
|
@@ -59,6 +59,12 @@ import type { PolicyLoadResult } from "./policy-load.js";
|
|
|
59
59
|
export declare const LEGACY_SERVICE_TELEGRAM_TOKEN = "approval-tg-token";
|
|
60
60
|
export declare const LEGACY_SERVICE_VAULT_PASSPHRASE = "approval-vault-passphrase";
|
|
61
61
|
export declare const LEGACY_SERVICE_SAMPLING_SECRET = "approval-sampling-secret";
|
|
62
|
+
/**
|
|
63
|
+
* The sender key (APRV-370). Born scoped, so it has no legacy instance to be a
|
|
64
|
+
* fallback for; it sits in this list because the naming rule is the list's, and
|
|
65
|
+
* a name minted outside it is a name `approval env --check` reports as unknown.
|
|
66
|
+
*/
|
|
67
|
+
export declare const SERVICE_SENDER_KEY = "approval-sender-key";
|
|
62
68
|
/** Every unscoped name, for the "is this the legacy one?" test. */
|
|
63
69
|
export declare const LEGACY_SERVICES: readonly string[];
|
|
64
70
|
/** How many hex digits of the digest a scoped name carries. */
|
|
@@ -196,8 +202,16 @@ export declare function parseEnvProvenance(raw: string | undefined): EnvProvenan
|
|
|
196
202
|
* half of the incident that survived fixing the file: the operator's rc
|
|
197
203
|
* exported the production token, so every fresh terminal kept using the
|
|
198
204
|
* production bot.
|
|
205
|
+
* - `stale-export` — the value in this shell is NOT what this instance's file
|
|
206
|
+
* resolves to today (APRV-390). The name-only rules above cannot see this at
|
|
207
|
+
* all, and it is the case that actually cost an evening: a token re-stored in
|
|
208
|
+
* the keychain does not reach a shell that exported the old one, because
|
|
209
|
+
* `approval env` never overrides a variable that is already set. The daemon
|
|
210
|
+
* then answered 401 while the keychain item behind the same line passed
|
|
211
|
+
* `getMe` by hand. Only {@link valueFindings} produces it, because only that
|
|
212
|
+
* function is allowed to read a value.
|
|
199
213
|
*/
|
|
200
|
-
export type InstanceFindingKind = "foreign-instance" | "legacy-shared" | "ambient-bleed";
|
|
214
|
+
export type InstanceFindingKind = "foreign-instance" | "legacy-shared" | "ambient-bleed" | "stale-export";
|
|
201
215
|
export interface InstanceFinding {
|
|
202
216
|
kind: InstanceFindingKind;
|
|
203
217
|
/** The environment variable the finding is about. */
|
|
@@ -249,5 +263,48 @@ export interface FindingsContext {
|
|
|
249
263
|
* env --check` and `approval up` to say different things about one shell.
|
|
250
264
|
*/
|
|
251
265
|
export declare function ownEnvExports(logPath: string, context?: FindingsContext): ReadonlySet<string>;
|
|
266
|
+
/**
|
|
267
|
+
* The same question, answered by COMPARING VALUES (APRV-390).
|
|
268
|
+
*
|
|
269
|
+
* ## Why a second function, and why only start-up may call it
|
|
270
|
+
*
|
|
271
|
+
* Everything above answers from names, so that a diagnostic never blocks on a
|
|
272
|
+
* keystore-unlock dialog ({@link NON_RESOLVING_RUNNER}). That constraint is
|
|
273
|
+
* right for `approval doctor` and wrong for the thing `approval up` is about to
|
|
274
|
+
* do, which is USE the value. Two cases observed on 2026-09-19 are invisible to
|
|
275
|
+
* every name-only rule:
|
|
276
|
+
*
|
|
277
|
+
* 1. **A stale export.** `approval env` never overrides a variable already set
|
|
278
|
+
* in the shell — that is invariant 7 working as designed — so a token
|
|
279
|
+
* re-stored in the keychain never reaches a terminal that exported the old
|
|
280
|
+
* one. The names agree, the file is this instance's, the provenance claim is
|
|
281
|
+
* this instance's own, and the value is wrong. The daemon got 401 from a
|
|
282
|
+
* token that passed `getMe` when read from the keychain by hand.
|
|
283
|
+
* 2. **A false positive on the correct ritual.** `APPROVAL_HUMAN` was reported
|
|
284
|
+
* cross-instance when the export came from this instance's own `eval
|
|
285
|
+
* "$(approval env)"` seconds earlier, because the provenance claim did not
|
|
286
|
+
* match. A finding about a value that IS the file's value is noise, and
|
|
287
|
+
* noise in a refusal is how a refusal gets overridden by habit.
|
|
288
|
+
*
|
|
289
|
+
* Comparing answers both: a value equal to what the file resolves to is
|
|
290
|
+
* correct however it got there, and a value that differs is wrong however
|
|
291
|
+
* honest its provenance looks.
|
|
292
|
+
*
|
|
293
|
+
* ## What it does with the values
|
|
294
|
+
*
|
|
295
|
+
* It compares them and drops them. Nothing is printed, returned, logged or put
|
|
296
|
+
* in a message on any path — every finding this produces carries a variable
|
|
297
|
+
* name, a file path and a line number, exactly like the name-only ones. The
|
|
298
|
+
* only new capability is answering "same or different".
|
|
299
|
+
*
|
|
300
|
+
* ## Where it fails soft, and in which direction
|
|
301
|
+
*
|
|
302
|
+
* A file entry that cannot be resolved (a locked keychain, a helper that is not
|
|
303
|
+
* installed, a `secret-tool` with no D-Bus) yields no comparison, and the
|
|
304
|
+
* name-only finding for that variable stands unchanged. That is the safe
|
|
305
|
+
* direction: an unverifiable value keeps whatever scrutiny it already had, and
|
|
306
|
+
* a caller that cannot resolve anything gets exactly the pre-APRV-390 report.
|
|
307
|
+
*/
|
|
308
|
+
export declare function valueFindings(logPath: string, load: PolicyLoadResult, runner: SourceRunner, ambientEnv?: NodeJS.ProcessEnv): InstanceFinding[];
|
|
252
309
|
/** The name-only rules, over an already-resolved variable set. */
|
|
253
310
|
export declare function findingsFor(logPath: string, variables: readonly ResolvedVariable[], context?: FindingsContext): InstanceFinding[];
|
|
@@ -60,11 +60,18 @@ import { NON_RESOLVING_RUNNER, envFilePathFor, resolveEnvironment, } from "./env
|
|
|
60
60
|
export const LEGACY_SERVICE_TELEGRAM_TOKEN = "approval-tg-token";
|
|
61
61
|
export const LEGACY_SERVICE_VAULT_PASSPHRASE = "approval-vault-passphrase";
|
|
62
62
|
export const LEGACY_SERVICE_SAMPLING_SECRET = "approval-sampling-secret";
|
|
63
|
+
/**
|
|
64
|
+
* The sender key (APRV-370). Born scoped, so it has no legacy instance to be a
|
|
65
|
+
* fallback for; it sits in this list because the naming rule is the list's, and
|
|
66
|
+
* a name minted outside it is a name `approval env --check` reports as unknown.
|
|
67
|
+
*/
|
|
68
|
+
export const SERVICE_SENDER_KEY = "approval-sender-key";
|
|
63
69
|
/** Every unscoped name, for the "is this the legacy one?" test. */
|
|
64
70
|
export const LEGACY_SERVICES = [
|
|
65
71
|
LEGACY_SERVICE_TELEGRAM_TOKEN,
|
|
66
72
|
LEGACY_SERVICE_VAULT_PASSPHRASE,
|
|
67
73
|
LEGACY_SERVICE_SAMPLING_SECRET,
|
|
74
|
+
SERVICE_SENDER_KEY,
|
|
68
75
|
];
|
|
69
76
|
/** How many hex digits of the digest a scoped name carries. */
|
|
70
77
|
export const INSTANCE_ID_LENGTH = 8;
|
|
@@ -265,6 +272,112 @@ export function ownEnvExports(logPath, context = {}) {
|
|
|
265
272
|
const view = provenanceView(logPath, context);
|
|
266
273
|
return view.claimsThisFile ? view.names : new Set();
|
|
267
274
|
}
|
|
275
|
+
/**
|
|
276
|
+
* The same question, answered by COMPARING VALUES (APRV-390).
|
|
277
|
+
*
|
|
278
|
+
* ## Why a second function, and why only start-up may call it
|
|
279
|
+
*
|
|
280
|
+
* Everything above answers from names, so that a diagnostic never blocks on a
|
|
281
|
+
* keystore-unlock dialog ({@link NON_RESOLVING_RUNNER}). That constraint is
|
|
282
|
+
* right for `approval doctor` and wrong for the thing `approval up` is about to
|
|
283
|
+
* do, which is USE the value. Two cases observed on 2026-09-19 are invisible to
|
|
284
|
+
* every name-only rule:
|
|
285
|
+
*
|
|
286
|
+
* 1. **A stale export.** `approval env` never overrides a variable already set
|
|
287
|
+
* in the shell — that is invariant 7 working as designed — so a token
|
|
288
|
+
* re-stored in the keychain never reaches a terminal that exported the old
|
|
289
|
+
* one. The names agree, the file is this instance's, the provenance claim is
|
|
290
|
+
* this instance's own, and the value is wrong. The daemon got 401 from a
|
|
291
|
+
* token that passed `getMe` when read from the keychain by hand.
|
|
292
|
+
* 2. **A false positive on the correct ritual.** `APPROVAL_HUMAN` was reported
|
|
293
|
+
* cross-instance when the export came from this instance's own `eval
|
|
294
|
+
* "$(approval env)"` seconds earlier, because the provenance claim did not
|
|
295
|
+
* match. A finding about a value that IS the file's value is noise, and
|
|
296
|
+
* noise in a refusal is how a refusal gets overridden by habit.
|
|
297
|
+
*
|
|
298
|
+
* Comparing answers both: a value equal to what the file resolves to is
|
|
299
|
+
* correct however it got there, and a value that differs is wrong however
|
|
300
|
+
* honest its provenance looks.
|
|
301
|
+
*
|
|
302
|
+
* ## What it does with the values
|
|
303
|
+
*
|
|
304
|
+
* It compares them and drops them. Nothing is printed, returned, logged or put
|
|
305
|
+
* in a message on any path — every finding this produces carries a variable
|
|
306
|
+
* name, a file path and a line number, exactly like the name-only ones. The
|
|
307
|
+
* only new capability is answering "same or different".
|
|
308
|
+
*
|
|
309
|
+
* ## Where it fails soft, and in which direction
|
|
310
|
+
*
|
|
311
|
+
* A file entry that cannot be resolved (a locked keychain, a helper that is not
|
|
312
|
+
* installed, a `secret-tool` with no D-Bus) yields no comparison, and the
|
|
313
|
+
* name-only finding for that variable stands unchanged. That is the safe
|
|
314
|
+
* direction: an unverifiable value keeps whatever scrutiny it already had, and
|
|
315
|
+
* a caller that cannot resolve anything gets exactly the pre-APRV-390 report.
|
|
316
|
+
*/
|
|
317
|
+
export function valueFindings(logPath, load, runner, ambientEnv = process.env) {
|
|
318
|
+
const envPath = envFilePathFor(logPath);
|
|
319
|
+
const named = instanceFindings(logPath, load, ambientEnv);
|
|
320
|
+
// EVERY variable whose value came from the shell and whose file has a line
|
|
321
|
+
// for it — not only the ones the name-only rule complained about.
|
|
322
|
+
//
|
|
323
|
+
// This is the correction that matters, and the reason the set is not taken
|
|
324
|
+
// from `named`. The provenance claim (APRV-278) vouches for an export by
|
|
325
|
+
// naming this instance, this file's DIGEST and this variable, and all three
|
|
326
|
+
// stay true when the file is untouched and the KEYSTORE ITEM behind one of
|
|
327
|
+
// its lines is re-stored. The claim is honest and the value is stale, so the
|
|
328
|
+
// vouched variables are exactly the ones this check must still look at.
|
|
329
|
+
const nameOnly = resolveEnvironment(load, envPath, NON_RESOLVING_RUNNER, ambientEnv);
|
|
330
|
+
if (!nameOnly.ok)
|
|
331
|
+
return named;
|
|
332
|
+
const ambientNames = new Set(nameOnly.variables
|
|
333
|
+
.filter((variable) => variable.status === "set-in-environment" && variable.fileSource !== undefined)
|
|
334
|
+
.map((variable) => variable.name));
|
|
335
|
+
if (ambientNames.size === 0)
|
|
336
|
+
return named;
|
|
337
|
+
// Resolve the FILE, by hiding exactly those names from the resolution: the
|
|
338
|
+
// ambient environment wins otherwise, and the answer would be the value we
|
|
339
|
+
// are trying to check. Nothing here is exported — this process's own
|
|
340
|
+
// environment is untouched, so invariant 7 is as true after this call as
|
|
341
|
+
// before it. The file cannot SET anything; it can only fail to match.
|
|
342
|
+
const hidden = { ...ambientEnv };
|
|
343
|
+
for (const name of ambientNames)
|
|
344
|
+
delete hidden[name];
|
|
345
|
+
const fromFile = resolveEnvironment(load, envPath, runner, hidden);
|
|
346
|
+
if (!fromFile.ok)
|
|
347
|
+
return named;
|
|
348
|
+
const fileValues = new Map();
|
|
349
|
+
for (const variable of fromFile.variables) {
|
|
350
|
+
if (variable.value !== undefined && variable.status !== "set-in-environment") {
|
|
351
|
+
fileValues.set(variable.name, variable.value);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
// Everything the name-only rule found that is NOT about an ambient value: a
|
|
355
|
+
// foreign item name and a legacy shared one are facts about names, and no
|
|
356
|
+
// comparison of values can make either of them go away.
|
|
357
|
+
const findings = named.filter((finding) => finding.kind !== "ambient-bleed");
|
|
358
|
+
for (const name of ambientNames) {
|
|
359
|
+
const fileValue = fileValues.get(name);
|
|
360
|
+
const ambientValue = ambientEnv[name];
|
|
361
|
+
// Unresolvable (a locked keychain, a missing helper, a missing item): no
|
|
362
|
+
// comparison was made, so whatever the name-only rule said still stands.
|
|
363
|
+
if (fileValue === undefined) {
|
|
364
|
+
const bleed = named.find((finding) => finding.kind === "ambient-bleed" && finding.variable === name);
|
|
365
|
+
if (bleed !== undefined)
|
|
366
|
+
findings.push(bleed);
|
|
367
|
+
continue;
|
|
368
|
+
}
|
|
369
|
+
// The shell holds exactly what the file configures. Correct, however it got
|
|
370
|
+
// there, and whatever the provenance claim did or did not say.
|
|
371
|
+
if (ambientValue === fileValue)
|
|
372
|
+
continue;
|
|
373
|
+
findings.push({
|
|
374
|
+
kind: "stale-export",
|
|
375
|
+
variable: name,
|
|
376
|
+
detail: `${name} is exported in this shell with a value that is NOT what ${envPath} resolves to today, and an export always wins over the file, so this process would use the stale one`,
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
return findings;
|
|
380
|
+
}
|
|
268
381
|
/** The name-only rules, over an already-resolved variable set. */
|
|
269
382
|
export function findingsFor(logPath, variables, context = {}) {
|
|
270
383
|
const home = instanceHomeFor(logPath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instance.js","sourceRoot":"","sources":["../../../src/core/instance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,kBAAkB,
|
|
1
|
+
{"version":3,"file":"instance.js","s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AE,SAAS;QACpC,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC/C,IAAI,KAAK,KAAK,gBAAgB,EAAE,CAAC;YAC/B,QAAQ,CAAC,IAAI,CAAC;gBACZ,IAAI,EAAE,kBAAkB;gBACxB,QAAQ,EAAE,QAAQ,CAAC,IAAI;gBACvB,OAAO;gBACP,MAAM,EAAE,GAAG,QAAQ,CAAC,IAAI,UAAU,OAAO,gDAAgD,aAAa,CAAC,OAAO,CAAC,KAAK,IAAI,4DAA4D;aACrL,CAAC,CAAC;QACL,CAAC;aAAM,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,QAAQ,CAAC,IAAI,CAAC;gBACZ,IAAI,EAAE,eAAe;gBACrB,QAAQ,EAAE,QAAQ,CAAC,IAAI;gBACvB,OAAO;gBACP,MAAM,EAAE,GAAG,QAAQ,CAAC,IAAI,UAAU,OAAO,gFAAgF;aAC1H,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/src/core/log.d.ts
CHANGED
|
@@ -119,8 +119,46 @@ export declare const GENESIS_PREV: null;
|
|
|
119
119
|
* attested policy as `hash-mismatch` and refused every gate operation until
|
|
120
120
|
* somebody re-attested it. The `gate.` prefix already carries the write-boundary
|
|
121
121
|
* clock in `core/verify.ts`, which is what an attestation's `ts` has to be.
|
|
122
|
+
*
|
|
123
|
+
* `audit.gesture_refused` (APRV-355) is the seventeenth: a human made a gesture
|
|
124
|
+
* on a decision surface that is NOT a decision — a checkpoint signature, a
|
|
125
|
+
* review — and the surface refused it before any verb ran. `audit.decision_refused`
|
|
126
|
+
* cannot carry one: it requires an `action_key` and a `decision` of grant,
|
|
127
|
+
* reject or revoke, and a signature has neither, so recording a refused
|
|
128
|
+
* signature there would mean manufacturing both. Audit tier on the same strict
|
|
129
|
+
* terms, `system:` actor for the same reason, and `core/gesture-refusal.ts`
|
|
130
|
+
* states the asymmetry it inherits.
|
|
131
|
+
*
|
|
132
|
+
* `audit.question_preempted` (APRV-378) is the eighteenth: something other than
|
|
133
|
+
* this gate answered a question this gate exists to ask. The first instance is
|
|
134
|
+
* Codex's server-side auto-reviewer, which can resolve an approval with a model
|
|
135
|
+
* call before `approval codex bridge` is asked and discloses it afterwards
|
|
136
|
+
* through an `item/autoApprovalReview` notification. None of the three audit
|
|
137
|
+
* records above it fits: the sweep is about activity with no records beside it,
|
|
138
|
+
* and both refusal records are about a human gesture. Here the question
|
|
139
|
+
* existed, the gate would have asked it, and somebody else answered first, so
|
|
140
|
+
* the log's silence about it would be indistinguishable from a turn that never
|
|
141
|
+
* wanted to act. Audit tier on the same strict terms, `system:` actor for the
|
|
142
|
+
* same reason, and a closed `source` enum so the next party to do this gains a
|
|
143
|
+
* member rather than a type. `core/question-preempted.ts` states the rest.
|
|
144
|
+
*
|
|
145
|
+
* `gate.path.signed_off` (APRV-338) is the sixteenth: a human's sign-off on the
|
|
146
|
+
* exact bytes of one PROTECTED PATH whose edits classify `policy.edit` or a
|
|
147
|
+
* `policy.edit.*` sub-class (amended SPEC.md §5.2, §8, §10.1). `human:` actor,
|
|
148
|
+
* and the schema refuses any other.
|
|
149
|
+
*
|
|
150
|
+
* It is a sibling of `gate.organ.attested` and not the same type, because the
|
|
151
|
+
* surfaces differ in what evidence is available for them. An organ is
|
|
152
|
+
* `policy.core`, the gate mints nothing for it, and content attestation is
|
|
153
|
+
* therefore the ONLY evidence that can exist. A protected path has grants
|
|
154
|
+
* available to it, and the after-the-fact checker of §10.1 prefers them: a
|
|
155
|
+
* grant binds the exact hunk, this record stands for the whole file, and one
|
|
156
|
+
* type carrying both claims would have let the weaker one be read as the
|
|
157
|
+
* stronger. It is in the `gate.` namespace for the reason the organ record is:
|
|
158
|
+
* §8 keys the write-boundary clock on that prefix, and a human who could
|
|
159
|
+
* backdate a sign-off could place it before bytes they never saw.
|
|
122
160
|
*/
|
|
123
|
-
export type EventType = "task.registered" | "route.proposed" | "route.accepted" | "approval.requested" | "approval.granted" | "approval.rejected" | "approval.expired" | "approval.revoked" | "approval.withdrawn" | "execution.started" | "execution.completed" | "execution.failed" | "execution.indeterminate" | "execution.reconciled" | "budget.exceeded" | "policy.updated" | "policy.proposed" | "policy.declined" | "envelope.drift" | "audit.sampled" | "audit.reviewed" | "audit.dark_session" | "audit.decision_refused" | "reconciliation.required" | "reconciliation.satisfied" | "payload.pruned" | "gate.opened" | "gate.closed" | "gate.bypassed" | "gate.organ.attested" | "log.checkpoint";
|
|
161
|
+
export type EventType = "task.registered" | "route.proposed" | "route.accepted" | "approval.requested" | "approval.granted" | "approval.rejected" | "approval.expired" | "approval.revoked" | "approval.withdrawn" | "execution.started" | "execution.completed" | "execution.failed" | "execution.indeterminate" | "execution.reconciled" | "budget.exceeded" | "policy.updated" | "policy.proposed" | "policy.declined" | "envelope.drift" | "audit.sampled" | "audit.reviewed" | "audit.dark_session" | "audit.decision_refused" | "audit.gesture_refused" | "audit.question_preempted" | "reconciliation.required" | "reconciliation.satisfied" | "payload.pruned" | "gate.opened" | "gate.closed" | "gate.bypassed" | "gate.organ.attested" | "gate.path.signed_off" | "log.checkpoint";
|
|
124
162
|
/** Caller-supplied content of an event. Chain fields are not accepted. */
|
|
125
163
|
export interface EventInput {
|
|
126
164
|
/** RFC 3339 timestamp. Supplied by the caller; never read from the clock. */
|
package/dist/src/core/log.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../../src/core/log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,SAAS,GACV,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,MA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EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC9B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,IAAI,EAAE,OAAO,OAAO,oCAAoC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC7F,CAAC;QACD,IAAI,CAAC;YACH,kFAAkF;YAClF,SAAS,CAAC,EAAE,EAAE,GAAG,IAAI,IAAI,CAAC,CAAC;QAC7B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,IAAI,EAAE,OAAO,OAAO,0BAA0B,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACnF,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC;gBACH,SAAS,CAAC,EAAE,CAAC,CAAC;YAChB,CAAC;YAAC,MAAM,CAAC;gBACP,gEAAgE;YAClE,CAAC;QACH,CAAC;QAED,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACpC,CAAC,EAAE,OAAO,CAAC,CAAC;IAEZ,MAAM,MAAM,GAAiB,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;IACrF,6EAA6E;IAC7E,yEAAyE;IACzE,IAAI,MAAM,CAAC,EAAE;QAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IACnC,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -138,6 +138,16 @@ export interface Explanation {
|
|
|
138
138
|
export interface ExplainOptions {
|
|
139
139
|
/** `false` engages the SPEC.md §7 irreversibility floor. */
|
|
140
140
|
reversible?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* The system read roots the CALLER resolved — the session scratchpad and the
|
|
143
|
+
* temp root (APRV-347).
|
|
144
|
+
*
|
|
145
|
+
* Passed in rather than computed here, because this module is pure and those
|
|
146
|
+
* come off an environment and a filesystem. Absent means the line names the
|
|
147
|
+
* gate root and the policy's own entries and says the system roots were not
|
|
148
|
+
* resolved, which is the honest thing for a caller that did not resolve them.
|
|
149
|
+
*/
|
|
150
|
+
systemReadRoots?: readonly string[];
|
|
141
151
|
}
|
|
142
152
|
/**
|
|
143
153
|
* Explain what `load`'s policy does with `actionClass`.
|