approval-md 0.4.0 → 0.4.1
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/SPEC.md +3 -0
- package/cli.js +72 -4
- package/dist/src/channels/contract.d.ts +53 -0
- package/dist/src/channels/contract.js +56 -0
- package/dist/src/channels/contract.js.map +1 -1
- package/dist/src/channels/tagging.d.ts +25 -0
- package/dist/src/channels/tagging.js +57 -5
- package/dist/src/channels/tagging.js.map +1 -1
- package/dist/src/channels/telegram-minimal.d.ts +251 -0
- package/dist/src/channels/telegram-minimal.js +618 -0
- package/dist/src/channels/telegram-minimal.js.map +1 -0
- package/dist/src/channels/telegram.d.ts +454 -19
- package/dist/src/channels/telegram.js +931 -80
- package/dist/src/channels/telegram.js.map +1 -1
- package/dist/src/cli/amend.js +8 -1
- package/dist/src/cli/amend.js.map +1 -1
- package/dist/src/cli/audit-card.d.ts +1 -1
- package/dist/src/cli/audit-card.js +40 -1
- package/dist/src/cli/audit-card.js.map +1 -1
- package/dist/src/cli/audit.d.ts +7 -5
- package/dist/src/cli/audit.js +22 -10
- package/dist/src/cli/audit.js.map +1 -1
- package/dist/src/cli/channel-telegram-webhook.d.ts +2 -0
- package/dist/src/cli/channel-telegram-webhook.js +7 -0
- package/dist/src/cli/channel-telegram-webhook.js.map +1 -1
- package/dist/src/cli/channel-telegram.d.ts +75 -2
- package/dist/src/cli/channel-telegram.js +170 -15
- package/dist/src/cli/channel-telegram.js.map +1 -1
- package/dist/src/cli/execute.d.ts +12 -0
- package/dist/src/cli/execute.js +46 -1
- package/dist/src/cli/execute.js.map +1 -1
- package/dist/src/cli/help.d.ts +1 -0
- package/dist/src/cli/help.js +39 -18
- package/dist/src/cli/help.js.map +1 -1
- package/dist/src/cli/hook.d.ts +114 -3
- package/dist/src/cli/hook.js +468 -50
- package/dist/src/cli/hook.js.map +1 -1
- package/dist/src/cli/log-unlock.d.ts +23 -0
- package/dist/src/cli/log-unlock.js +109 -0
- package/dist/src/cli/log-unlock.js.map +1 -0
- package/dist/src/cli/main.js +23 -6
- package/dist/src/cli/main.js.map +1 -1
- package/dist/src/cli/up.js +5 -0
- package/dist/src/cli/up.js.map +1 -1
- package/dist/src/cli/verb-registry.js +1 -0
- 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/core/audit.d.ts +98 -9
- package/dist/src/core/audit.js +363 -15
- package/dist/src/core/audit.js.map +1 -1
- package/dist/src/core/command-class.js +6 -0
- package/dist/src/core/command-class.js.map +1 -1
- package/dist/src/core/gate.d.ts +58 -1
- package/dist/src/core/gate.js +30 -3
- package/dist/src/core/gate.js.map +1 -1
- package/dist/src/core/log-lock.d.ts +435 -0
- package/dist/src/core/log-lock.js +1093 -0
- package/dist/src/core/log-lock.js.map +1 -0
- package/dist/src/core/log.d.ts +82 -3
- package/dist/src/core/log.js +285 -40
- package/dist/src/core/log.js.map +1 -1
- package/dist/src/core/policy-proposal.d.ts +17 -0
- package/dist/src/core/policy-proposal.js +29 -14
- package/dist/src/core/policy-proposal.js.map +1 -1
- package/dist/src/core/prompt-layout.d.ts +186 -1
- package/dist/src/core/prompt-layout.js +345 -3
- package/dist/src/core/prompt-layout.js.map +1 -1
- package/dist/src/core/sender-identity.d.ts +24 -1
- package/dist/src/core/sender-identity.js +31 -0
- package/dist/src/core/sender-identity.js.map +1 -1
- package/dist/src/core/validate.d.ts +20 -6
- package/dist/src/core/validate.js +0 -0
- package/dist/src/core/validate.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/serve/archive.d.ts +8 -0
- package/dist/src/serve/archive.js +11 -2
- package/dist/src/serve/archive.js.map +1 -1
- package/docs/README-extended.md +2 -0
- package/docs/cli-reference.md +507 -25
- package/package.json +2 -2
- package/schema/event.schema.json +354 -28
- package/schema/fixtures/event/invalid/audit-lock-reclaimed-age-without-created.json +19 -0
- package/schema/fixtures/event/invalid/audit-lock-reclaimed-agent-actor.json +14 -0
- package/schema/fixtures/event/invalid/audit-lock-reclaimed-lockfile-path.json +14 -0
- package/schema/fixtures/event/invalid/audit-lock-reclaimed-operator-cleared-system-actor.json +14 -0
- package/schema/fixtures/event/invalid/audit-lock-reclaimed-unknown-reason.json +14 -0
- package/schema/fixtures/event/invalid/audit-lock-reclaimed-without-age.json +13 -0
- package/schema/fixtures/event/invalid/audit-reviewed-agent-actor.json +6 -1
- package/schema/fixtures/event/invalid/audit-reviewed-bad-payload-hash.json +21 -0
- package/schema/fixtures/event/invalid/audit-reviewed-loved-no-note.json +5 -0
- package/schema/fixtures/event/invalid/audit-reviewed-no-subject-hash.json +19 -0
- package/schema/fixtures/event/invalid/audit-reviewed-no-subject-seq.json +19 -0
- package/schema/fixtures/event/invalid/audit-reviewed-no-verdict-source.json +19 -0
- package/schema/fixtures/event/invalid/audit-reviewed-no-verdict.json +19 -0
- package/schema/fixtures/event/invalid/audit-reviewed-system-actor.json +6 -1
- package/schema/fixtures/event/invalid/audit-sampled-no-policy-hash.json +14 -0
- package/schema/fixtures/event/valid/audit-lock-reclaimed-implausible-created.json +18 -0
- package/schema/fixtures/event/valid/audit-lock-reclaimed-legacy.json +14 -0
- package/schema/fixtures/event/valid/audit-lock-reclaimed-unlock.json +19 -0
- package/schema/fixtures/event/valid/audit-lock-reclaimed.json +19 -0
- package/schema/fixtures/event/valid/audit-reviewed-reaction.json +5 -0
- package/schema/fixtures/event/valid/audit-reviewed.json +6 -1
- package/schema/fixtures/event/valid/audit-sampled.json +2 -1
- package/schema/fixtures/event/valid/daemon-identity.json +2 -1
- package/schema/policy.schema.json +52 -0
|
@@ -7,7 +7,12 @@
|
|
|
7
7
|
"actor": "system:daemon",
|
|
8
8
|
"channel": "cli",
|
|
9
9
|
"payload": {
|
|
10
|
-
"
|
|
10
|
+
"subject_seq": 15,
|
|
11
|
+
"subject_event": "audit.sampled",
|
|
12
|
+
"reviewed": true,
|
|
13
|
+
"sampled_subject_hash": "6c1d3f0b9a8e7d6c5b4a39281706f5e4d3c2b1a09f8e7d6c5b4a392817060504",
|
|
14
|
+
"verdict": "ok",
|
|
15
|
+
"verdict_source": "explicit"
|
|
11
16
|
},
|
|
12
17
|
"alg": "sha256/jcs",
|
|
13
18
|
"prev": "7f625051c176f2f260a1f7e25c9a933717ebb49917a8788ac25ae7a4614ebb30",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"seq": 15,
|
|
3
|
+
"ts": "2026-08-04T09:25:02Z",
|
|
4
|
+
"event": "audit.sampled",
|
|
5
|
+
"task": "task-049",
|
|
6
|
+
"action_key": "task-049:archive:2026-08-04",
|
|
7
|
+
"actor": "system:auditor",
|
|
8
|
+
"payload": {
|
|
9
|
+
"rate": 0.1
|
|
10
|
+
},
|
|
11
|
+
"alg": "sha256/jcs",
|
|
12
|
+
"prev": "07453feb30c2b0b1a2806398cdd17b38d98f9abf52b8a75ca42878c9101d8264",
|
|
13
|
+
"hash": "7f625051c176f2f260a1f7e25c9a933717ebb49917a8788ac25ae7a4614ebb30"
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"seq": 216,
|
|
3
|
+
"ts": "2026-10-05T07:41:12.408Z",
|
|
4
|
+
"event": "audit.lock_reclaimed",
|
|
5
|
+
"actor": "system:log",
|
|
6
|
+
"payload": {
|
|
7
|
+
"lockfile": "events.jsonl.lock",
|
|
8
|
+
"reason": "holder-dead",
|
|
9
|
+
"holder": {
|
|
10
|
+
"pid": 48213,
|
|
11
|
+
"op": "append",
|
|
12
|
+
"created": null
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"alg": "sha256/jcs",
|
|
16
|
+
"prev": "7f625051c176f2f260a1f7e25c9a933717ebb49917a8788ac25ae7a4614ebb30",
|
|
17
|
+
"hash": "2e9b7c1a4d6f08213b5c7e9a0d2f416385a7c9e1b3d5f70921a3c5e7092b4d6f"
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"seq": 215,
|
|
3
|
+
"ts": "2026-10-05T07:52:03.010Z",
|
|
4
|
+
"event": "audit.lock_reclaimed",
|
|
5
|
+
"actor": "system:log",
|
|
6
|
+
"payload": {
|
|
7
|
+
"lockfile": "events.jsonl.lock",
|
|
8
|
+
"reason": "legacy-aged",
|
|
9
|
+
"age_ms": 612000
|
|
10
|
+
},
|
|
11
|
+
"alg": "sha256/jcs",
|
|
12
|
+
"prev": "7f625051c176f2f260a1f7e25c9a933717ebb49917a8788ac25ae7a4614ebb30",
|
|
13
|
+
"hash": "2e9b7c1a4d6f08213b5c7e9a0d2f416385a7c9e1b3d5f70921a3c5e7092b4d6f"
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"seq": 216,
|
|
3
|
+
"ts": "2026-10-05T11:02:40.115Z",
|
|
4
|
+
"event": "audit.lock_reclaimed",
|
|
5
|
+
"actor": "human:carter",
|
|
6
|
+
"payload": {
|
|
7
|
+
"lockfile": "events.jsonl.lock",
|
|
8
|
+
"reason": "operator-cleared",
|
|
9
|
+
"age_ms": 4021877,
|
|
10
|
+
"holder": {
|
|
11
|
+
"pid": 31,
|
|
12
|
+
"op": "append",
|
|
13
|
+
"created": "2026-10-05T09:55:38.238Z"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"alg": "sha256/jcs",
|
|
17
|
+
"prev": "7f625051c176f2f260a1f7e25c9a933717ebb49917a8788ac25ae7a4614ebb30",
|
|
18
|
+
"hash": "2e9b7c1a4d6f08213b5c7e9a0d2f416385a7c9e1b3d5f70921a3c5e7092b4d6f"
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"seq": 214,
|
|
3
|
+
"ts": "2026-10-05T07:41:12.408Z",
|
|
4
|
+
"event": "audit.lock_reclaimed",
|
|
5
|
+
"actor": "system:log",
|
|
6
|
+
"payload": {
|
|
7
|
+
"lockfile": "events.jsonl.lock",
|
|
8
|
+
"reason": "holder-dead",
|
|
9
|
+
"age_ms": 734211,
|
|
10
|
+
"holder": {
|
|
11
|
+
"pid": 48213,
|
|
12
|
+
"op": "append",
|
|
13
|
+
"created": "2026-10-05T07:28:58.197Z"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"alg": "sha256/jcs",
|
|
17
|
+
"prev": "7f625051c176f2f260a1f7e25c9a933717ebb49917a8788ac25ae7a4614ebb30",
|
|
18
|
+
"hash": "2e9b7c1a4d6f08213b5c7e9a0d2f416385a7c9e1b3d5f70921a3c5e7092b4d6f"
|
|
19
|
+
}
|
|
@@ -7,7 +7,12 @@
|
|
|
7
7
|
"actor": "human:carter",
|
|
8
8
|
"channel": "cli",
|
|
9
9
|
"payload": {
|
|
10
|
+
"subject_seq": 15,
|
|
11
|
+
"subject_event": "audit.sampled",
|
|
12
|
+
"reviewed": true,
|
|
13
|
+
"sampled_subject_hash": "6c1d3f0b9a8e7d6c5b4a39281706f5e4d3c2b1a09f8e7d6c5b4a392817060504",
|
|
10
14
|
"verdict": "ok",
|
|
15
|
+
"verdict_source": "explicit",
|
|
11
16
|
"reaction": "loved",
|
|
12
17
|
"note": "exactly the archive I would have written by hand"
|
|
13
18
|
},
|
|
@@ -7,7 +7,12 @@
|
|
|
7
7
|
"actor": "human:carter",
|
|
8
8
|
"channel": "cli",
|
|
9
9
|
"payload": {
|
|
10
|
-
"
|
|
10
|
+
"subject_seq": 15,
|
|
11
|
+
"subject_event": "audit.sampled",
|
|
12
|
+
"reviewed": true,
|
|
13
|
+
"sampled_subject_hash": "6c1d3f0b9a8e7d6c5b4a39281706f5e4d3c2b1a09f8e7d6c5b4a392817060504",
|
|
14
|
+
"verdict": "ok",
|
|
15
|
+
"verdict_source": "explicit"
|
|
11
16
|
},
|
|
12
17
|
"alg": "sha256/jcs",
|
|
13
18
|
"prev": "7f625051c176f2f260a1f7e25c9a933717ebb49917a8788ac25ae7a4614ebb30",
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
"action_key": "task-049:archive:2026-08-04",
|
|
7
7
|
"actor": "system:auditor",
|
|
8
8
|
"payload": {
|
|
9
|
-
"rate": 0.1
|
|
9
|
+
"rate": 0.1,
|
|
10
|
+
"policy_sha256": "3b1f0c9d8e7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c"
|
|
10
11
|
},
|
|
11
12
|
"alg": "sha256/jcs",
|
|
12
13
|
"prev": "07453feb30c2b0b1a2806398cdd17b38d98f9abf52b8a75ca42878c9101d8264",
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
"actor": "system:auditor",
|
|
8
8
|
"daemon": "daemon-3f2a9c11",
|
|
9
9
|
"payload": {
|
|
10
|
-
"rate": 0.1
|
|
10
|
+
"rate": 0.1,
|
|
11
|
+
"policy_sha256": "3b1f0c9d8e7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c"
|
|
11
12
|
},
|
|
12
13
|
"alg": "sha256/jcs",
|
|
13
14
|
"prev": "07453feb30c2b0b1a2806398cdd17b38d98f9abf52b8a75ca42878c9101d8264",
|
|
@@ -386,6 +386,58 @@
|
|
|
386
386
|
"$ref": "#/$defs/promptRows",
|
|
387
387
|
"description": "Visibility DOWN: the row never renders on this channel. Refused for the rows required for a decision — `action_key`, `class`, `command_breakdown`, `protected_path`, `policy_diff`, `policy_load` — and refused at policy load with the machine-readable keyword `prompt-row-required`, which fails the whole policy closed. `payload_hash` is NOT among them because the bound hash is stated inside the canonical block on every channel, so hiding the row removes a duplicate rather than the binding. Naming one row in both `always` and `hide` is refused rather than resolved by precedence: an author who wrote both believes one of them, and picking for them would be a guess.",
|
|
388
388
|
"examples": [["provenance", "chain", "requested_ts"]]
|
|
389
|
+
},
|
|
390
|
+
"style": {
|
|
391
|
+
"type": "string",
|
|
392
|
+
"enum": ["technical", "minimal"],
|
|
393
|
+
"default": "technical",
|
|
394
|
+
"description": "SPEC.md §5.2/§10.3 (APRV-489): how this channel lays out a prompt. `technical`, the default and what an absent key means, is the card every earlier build sent, byte for byte. `minimal` is a short card in plain words: a headline the runtime computes from the class, the payload's own words quoted from the bound bytes, a deadline in plain words, and the whole technical card, canonical rendering included, collapsed inside the same message as the Approve and Deny buttons (SPEC.md §10.3, amended APRV-489). Only Telegram draws it in this release; on `web` and `cli` the key is validated and IGNORED, which shows more than was asked for and never less. A request the minimal card cannot draw honestly (an opaque payload without a `say` declaration naming every key, an attestation, a policy edit, a digest, a truncated payload, an abnormal health row, a card over the message limit) is sent as the technical card. Review cards never change. The enum is closed: an unknown style fails validation, which fails the policy closed to all-`manual`.",
|
|
395
|
+
"examples": ["minimal"]
|
|
396
|
+
},
|
|
397
|
+
"say": {
|
|
398
|
+
"type": "object",
|
|
399
|
+
"propertyNames": { "type": "string", "pattern": "^[a-z0-9][a-z0-9_-]*(?:\\.[a-z0-9][a-z0-9_-]*)*$" },
|
|
400
|
+
"additionalProperties": { "$ref": "#/$defs/promptSay" },
|
|
401
|
+
"description": "SPEC.md §5.2 (APRV-489): what the minimal card says about a class, keyed by EXACT class name (no wildcard: one friendly phrase must never stand for several classes). Operator text the approver attests, never agent text. Read only under `style: minimal`.",
|
|
402
|
+
"examples": [
|
|
403
|
+
{
|
|
404
|
+
"digest.share": {
|
|
405
|
+
"does": "share a note about you",
|
|
406
|
+
"quote": { "scope": "Shared with", "expires_at": "Until", "text": "Note", "digest_id": null },
|
|
407
|
+
"note": "none"
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
]
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
"promptSay": {
|
|
415
|
+
"type": "object",
|
|
416
|
+
"additionalProperties": false,
|
|
417
|
+
"description": "SPEC.md §5.2 (APRV-489): one class's minimal-card declaration. `does` is required for a class core does not phrase itself and refused for one it does, or for a class the command classifier emits (checked at load). It is drawn only over an opaque payload: over a command, a file change or an email the runtime draws its own kind phrase.",
|
|
418
|
+
"properties": {
|
|
419
|
+
"does": {
|
|
420
|
+
"type": "string",
|
|
421
|
+
"minLength": 1,
|
|
422
|
+
"maxLength": 120,
|
|
423
|
+
"description": "The plain-words verb phrase the headline completes: `Your agent wants to <does>`. Starts with a letter; no line break, sentence punctuation (. ! ? … : ;), markup or ⚠ (checked at load). Not allowed for a class core phrases itself or a class the command classifier emits (`prompt-say-kind`). Drawn only over an opaque payload: over a command, a file change or an email the runtime's kind phrase is drawn instead and the decision record notes `say_does_ignored`. The runtime chooses the entry by the exact class the log records."
|
|
424
|
+
},
|
|
425
|
+
"quote": {
|
|
426
|
+
"type": "object",
|
|
427
|
+
"propertyNames": { "type": "string", "minLength": 1, "maxLength": 64 },
|
|
428
|
+
"additionalProperties": {
|
|
429
|
+
"oneOf": [
|
|
430
|
+
{ "type": "string", "maxLength": 24 },
|
|
431
|
+
{ "type": "null" }
|
|
432
|
+
]
|
|
433
|
+
},
|
|
434
|
+
"description": "The closed field set for an OPAQUE payload: every top-level key the payload may carry, mapped to the label its value is quoted under (`\"\"` for no label), or `~` for a key known and deliberately left off the simple card (the card then names it under the quotations). At least one key must be shown (checked at load). A payload carrying any key this map does not name is sent as the technical card. Ignored for command, file-change and email payloads, whose excerpt is built in."
|
|
435
|
+
},
|
|
436
|
+
"note": {
|
|
437
|
+
"type": "string",
|
|
438
|
+
"enum": ["summary", "none"],
|
|
439
|
+
"default": "summary",
|
|
440
|
+
"description": "Whether the agent's own summary is shown, labelled as the agent's and as not checked: `summary` (the default) or `none`."
|
|
389
441
|
}
|
|
390
442
|
}
|
|
391
443
|
},
|