approval-md 0.2.0 → 0.4.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 +85 -877
- package/SPEC.md +150 -19
- package/cli.js +66 -7
- package/dist/src/adapters/smtp.d.ts +18 -0
- package/dist/src/adapters/smtp.js +24 -3
- package/dist/src/adapters/smtp.js.map +1 -1
- package/dist/src/channels/contract.d.ts +53 -1
- package/dist/src/channels/contract.js +304 -7
- package/dist/src/channels/contract.js.map +1 -1
- package/dist/src/channels/relay-server.d.ts +90 -0
- package/dist/src/channels/relay-server.js +295 -0
- package/dist/src/channels/relay-server.js.map +1 -0
- package/dist/src/channels/relay.d.ts +273 -0
- package/dist/src/channels/relay.js +564 -0
- package/dist/src/channels/relay.js.map +1 -0
- package/dist/src/channels/tagging.js +6 -1
- package/dist/src/channels/tagging.js.map +1 -1
- package/dist/src/channels/telegram-webhook.d.ts +273 -0
- package/dist/src/channels/telegram-webhook.js +536 -0
- package/dist/src/channels/telegram-webhook.js.map +1 -0
- package/dist/src/channels/telegram.d.ts +394 -12
- package/dist/src/channels/telegram.js +621 -68
- 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 +564 -34
- package/dist/src/cli/amend.js.map +1 -1
- package/dist/src/cli/attest.d.ts +9 -0
- package/dist/src/cli/attest.js +177 -13
- package/dist/src/cli/attest.js.map +1 -1
- package/dist/src/cli/channel-relay.d.ts +108 -0
- package/dist/src/cli/channel-relay.js +334 -0
- package/dist/src/cli/channel-relay.js.map +1 -0
- package/dist/src/cli/channel-telegram-webhook.d.ts +273 -0
- package/dist/src/cli/channel-telegram-webhook.js +709 -0
- package/dist/src/cli/channel-telegram-webhook.js.map +1 -0
- package/dist/src/cli/channel-telegram.d.ts +347 -28
- package/dist/src/cli/channel-telegram.js +763 -28
- package/dist/src/cli/channel-telegram.js.map +1 -1
- package/dist/src/cli/channel.d.ts +10 -1
- package/dist/src/cli/channel.js +14 -1
- 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 +41 -6
- package/dist/src/cli/daemon.js.map +1 -1
- package/dist/src/cli/doctor.d.ts +63 -0
- package/dist/src/cli/doctor.js +1322 -122
- package/dist/src/cli/doctor.js.map +1 -1
- package/dist/src/cli/execute.d.ts +17 -1
- package/dist/src/cli/execute.js +366 -22
- package/dist/src/cli/execute.js.map +1 -1
- package/dist/src/cli/exit-codes.d.ts +12 -0
- package/dist/src/cli/exit-codes.js +13 -0
- package/dist/src/cli/exit-codes.js.map +1 -1
- package/dist/src/cli/gate.d.ts +2 -0
- package/dist/src/cli/gate.js +233 -2
- package/dist/src/cli/gate.js.map +1 -1
- package/dist/src/cli/help.d.ts +14 -2
- package/dist/src/cli/help.js +395 -82
- 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 +828 -4
- package/dist/src/cli/hook.js +2972 -142
- 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/init.js +16 -7
- package/dist/src/cli/init.js.map +1 -1
- package/dist/src/cli/instructions.js +24 -3
- package/dist/src/cli/instructions.js.map +1 -1
- package/dist/src/cli/log-anchor.d.ts +55 -0
- package/dist/src/cli/log-anchor.js +199 -60
- package/dist/src/cli/log-anchor.js.map +1 -1
- package/dist/src/cli/main.d.ts +0 -12
- package/dist/src/cli/main.js +56 -3
- package/dist/src/cli/main.js.map +1 -1
- package/dist/src/cli/muse.d.ts +2 -0
- package/dist/src/cli/muse.js +62 -0
- package/dist/src/cli/muse.js.map +1 -0
- package/dist/src/cli/payload.js +79 -1
- package/dist/src/cli/payload.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 +7 -1
- package/dist/src/cli/scaffold.js.map +1 -1
- package/dist/src/cli/serve.d.ts +53 -0
- package/dist/src/cli/serve.js +270 -0
- package/dist/src/cli/serve.js.map +1 -0
- 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 +134 -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.d.ts +2 -0
- package/dist/src/cli/verb-registry.js +510 -47
- 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-bootstrap.d.ts +95 -0
- package/dist/src/core/attest-bootstrap.js +135 -0
- package/dist/src/core/attest-bootstrap.js.map +1 -0
- package/dist/src/core/attest.d.ts +234 -2
- package/dist/src/core/attest.js +342 -7
- package/dist/src/core/attest.js.map +1 -1
- package/dist/src/core/audit.d.ts +73 -3
- package/dist/src/core/audit.js +65 -5
- package/dist/src/core/audit.js.map +1 -1
- package/dist/src/core/channel-lease.d.ts +322 -0
- package/dist/src/core/channel-lease.js +663 -0
- package/dist/src/core/channel-lease.js.map +1 -0
- 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 +205 -0
- package/dist/src/core/command-class.js +1433 -28
- 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/daemon-host.d.ts +178 -0
- package/dist/src/core/daemon-host.js +228 -0
- package/dist/src/core/daemon-host.js.map +1 -0
- package/dist/src/core/daemon-identity.d.ts +238 -0
- package/dist/src/core/daemon-identity.js +252 -0
- package/dist/src/core/daemon-identity.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 +392 -6
- package/dist/src/core/gate.js +852 -24
- 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 +128 -4
- package/dist/src/core/harness-version.js +181 -12
- package/dist/src/core/harness-version.js.map +1 -1
- package/dist/src/core/harness-wait.d.ts +82 -3
- package/dist/src/core/harness-wait.js +89 -3
- package/dist/src/core/harness-wait.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-subscribe.d.ts +21 -0
- package/dist/src/core/log-subscribe.js +16 -6
- package/dist/src/core/log-subscribe.js.map +1 -1
- package/dist/src/core/log-write-layer.d.ts +55 -0
- package/dist/src/core/log-write-layer.js +91 -0
- package/dist/src/core/log-write-layer.js.map +1 -0
- package/dist/src/core/log.d.ts +89 -22
- package/dist/src/core/log.js +197 -19
- package/dist/src/core/log.js.map +1 -1
- package/dist/src/core/payload-census.d.ts +51 -0
- package/dist/src/core/payload-census.js +125 -2
- package/dist/src/core/payload-census.js.map +1 -1
- package/dist/src/core/payload-store.d.ts +31 -0
- package/dist/src/core/payload-store.js +113 -8
- package/dist/src/core/payload-store.js.map +1 -1
- package/dist/src/core/payload.d.ts +18 -3
- package/dist/src/core/payload.js +20 -4
- package/dist/src/core/payload.js.map +1 -1
- package/dist/src/core/policy-diff.d.ts +10 -0
- package/dist/src/core/policy-diff.js +10 -2
- package/dist/src/core/policy-diff.js.map +1 -1
- package/dist/src/core/policy-explain.d.ts +17 -1
- package/dist/src/core/policy-explain.js +48 -1
- package/dist/src/core/policy-explain.js.map +1 -1
- package/dist/src/core/policy-load.d.ts +65 -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 +81 -0
- package/dist/src/core/policy-match.js +87 -0
- package/dist/src/core/policy-match.js.map +1 -1
- package/dist/src/core/policy-proposal.d.ts +75 -0
- package/dist/src/core/policy-proposal.js +110 -4
- 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 +182 -0
- package/dist/src/core/read-scope.js +256 -0
- package/dist/src/core/read-scope.js.map +1 -0
- package/dist/src/core/run-payload.d.ts +160 -0
- package/dist/src/core/run-payload.js +304 -0
- package/dist/src/core/run-payload.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 +501 -0
- package/dist/src/core/sender-identity.js +609 -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/state.d.ts +52 -1
- package/dist/src/core/state.js +52 -6
- package/dist/src/core/state.js.map +1 -1
- package/dist/src/core/telegram-config.d.ts +79 -0
- package/dist/src/core/telegram-config.js +108 -0
- package/dist/src/core/telegram-config.js.map +1 -1
- 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/core/verify.d.ts +23 -1
- package/dist/src/core/verify.js +20 -2
- package/dist/src/core/verify.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/audit.d.ts +80 -5
- package/dist/src/daemon/audit.js +126 -6
- package/dist/src/daemon/audit.js.map +1 -1
- package/dist/src/daemon/daemon.d.ts +174 -2
- package/dist/src/daemon/daemon.js +307 -7
- 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/daemon/projection.d.ts +13 -2
- package/dist/src/daemon/projection.js +39 -6
- package/dist/src/daemon/projection.js.map +1 -1
- package/dist/src/mcp/server.d.ts +39 -3
- package/dist/src/mcp/server.js +30 -3
- package/dist/src/mcp/server.js.map +1 -1
- package/dist/src/muse/server.d.ts +16 -0
- package/dist/src/muse/server.js +238 -0
- package/dist/src/muse/server.js.map +1 -0
- package/dist/src/serve/archive.d.ts +158 -0
- package/dist/src/serve/archive.js +354 -0
- package/dist/src/serve/archive.js.map +1 -0
- package/dist/src/serve/arguments.d.ts +93 -0
- package/dist/src/serve/arguments.js +228 -0
- package/dist/src/serve/arguments.js.map +1 -0
- package/dist/src/serve/credentials.d.ts +91 -0
- package/dist/src/serve/credentials.js +143 -0
- package/dist/src/serve/credentials.js.map +1 -0
- package/dist/src/serve/follow.d.ts +86 -0
- package/dist/src/serve/follow.js +101 -0
- package/dist/src/serve/follow.js.map +1 -0
- package/dist/src/serve/hook-thread.d.ts +134 -0
- package/dist/src/serve/hook-thread.js +333 -0
- package/dist/src/serve/hook-thread.js.map +1 -0
- package/dist/src/serve/hook-worker.d.ts +134 -0
- package/dist/src/serve/hook-worker.js +173 -0
- package/dist/src/serve/hook-worker.js.map +1 -0
- package/dist/src/serve/server.d.ts +412 -0
- package/dist/src/serve/server.js +1251 -0
- package/dist/src/serve/server.js.map +1 -0
- package/docs/README-extended.md +766 -0
- package/docs/cli-reference.md +2563 -73
- package/docs/codex-enforced-session.md +75 -2
- package/docs/codex-workspace-broker.md +118 -0
- package/package.json +6 -2
- package/schema/event.schema.json +595 -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/daemon-id-malformed.json +15 -0
- package/schema/fixtures/event/invalid/execution-started-truncated-policy-sha256.json +18 -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/invalid/harness-cap-at-margin.json +16 -0
- package/schema/fixtures/event/invalid/harness-cap-fractional.json +16 -0
- package/schema/fixtures/event/invalid/harness-cap-negative.json +16 -0
- package/schema/fixtures/event/invalid/harness-cap-string.json +16 -0
- package/schema/fixtures/event/invalid/harness-cap-without-harness-execution.json +16 -0
- package/schema/fixtures/event/invalid/harness-cap-zero.json +16 -0
- package/schema/fixtures/event/valid/approval-granted-sender-hashed.json +20 -0
- package/schema/fixtures/event/valid/approval-requested-harness-cap.json +18 -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/daemon-identity-declared.json +17 -0
- package/schema/fixtures/event/valid/daemon-identity.json +15 -0
- package/schema/fixtures/event/valid/execution-started-policy-sha256.json +18 -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-hermes.json +23 -0
- package/schema/fixtures/event/valid/harness-kind-muse.json +23 -0
- package/schema/fixtures/policy/invalid/daemons-malformed-id.json +10 -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/daemons-allowlist.json +19 -0
- package/schema/fixtures/policy/valid/senders-keyed.json +24 -0
- package/schema/fixtures/policy-md/invalid/schema-invalid-agent-may-request.md +21 -0
- package/schema/fixtures/policy-md/valid/agent-may-request.md +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 +100 -4
- package/schema/values.schema.json +7 -11
- package/schema/fixtures/values/invalid/version-string.json +0 -1
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The filesystem calls that put durable bytes on disk: `core/log.ts`'s append
|
|
3
|
+
* (APRV-440) and `core/payload-store.ts`'s atomic write (APRV-457). They are
|
|
4
|
+
* kept in their own module so that `core/log.ts`'s public surface stays what
|
|
5
|
+
* `tests/log.test.ts` pins: no mutation, no reorder, no truncate, and no way to
|
|
6
|
+
* change how its bytes reach the disk.
|
|
7
|
+
*
|
|
8
|
+
* Why a seam at all. The durability claim is "fsync after the write and before
|
|
9
|
+
* ok", and a page cache that was flushed reads back exactly like one that was
|
|
10
|
+
* not until the machine dies. Only a layer that records the ORDER of the calls
|
|
11
|
+
* can prove the claim, so `tests/log-fsync.test.ts` and
|
|
12
|
+
* `tests/payload-fsync.test.ts` install one that records every call and then
|
|
13
|
+
* delegates to the real one, which keeps each log they build a real log built
|
|
14
|
+
* through the real append path.
|
|
15
|
+
*
|
|
16
|
+
* One seam for both writers, deliberately. A log record is only as durable as
|
|
17
|
+
* the payload it binds: a record that survives a crash while its payload comes
|
|
18
|
+
* back NUL-filled verifies and points at nothing (APRV-457). Proving the two
|
|
19
|
+
* through one layer keeps one model of "what reached the disk" for both.
|
|
20
|
+
*
|
|
21
|
+
* Nothing in `src/` calls {@link setAppendWriteLayerForTests}. It changes how
|
|
22
|
+
* the bytes reach the disk and nothing about which bytes, so every check before
|
|
23
|
+
* the write (lock, tail, compare-and-append, schema, payload hashing) runs as in
|
|
24
|
+
* production.
|
|
25
|
+
*/
|
|
26
|
+
import { closeSync, constants as fsConstants, fsyncSync, openSync, renameSync, writeSync } from "node:fs";
|
|
27
|
+
/** Node's own `fs`, which is the only layer production ever runs. */
|
|
28
|
+
const NODE_WRITE_LAYER = {
|
|
29
|
+
open: (path, flags, mode) => openSync(path, flags, mode),
|
|
30
|
+
write: (fd, data) => writeSync(fd, data, 0, data.length),
|
|
31
|
+
fsync: (fd) => {
|
|
32
|
+
fsyncSync(fd);
|
|
33
|
+
},
|
|
34
|
+
close: (fd) => {
|
|
35
|
+
closeSync(fd);
|
|
36
|
+
},
|
|
37
|
+
rename: (from, to) => {
|
|
38
|
+
renameSync(from, to);
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
let current = NODE_WRITE_LAYER;
|
|
42
|
+
/** The layer the next append (or payload store write) uses. */
|
|
43
|
+
export function appendWriteLayer() {
|
|
44
|
+
return current;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Replace the append's write layer, or restore Node's with `null`. For tests
|
|
48
|
+
* and the opt-in benchmarks only.
|
|
49
|
+
*/
|
|
50
|
+
export function setAppendWriteLayerForTests(layer) {
|
|
51
|
+
current = layer ?? NODE_WRITE_LAYER;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The errors a directory fsync returns on a filesystem that cannot sync a
|
|
55
|
+
* directory at all (some FUSE, SMB and drvfs mounts). The same set `core/log.ts`
|
|
56
|
+
* tolerates for its first append (APRV-440); log.ts keeps its own copy so its
|
|
57
|
+
* append path stays exactly what APRV-440 shipped. EIO and everything else
|
|
58
|
+
* still fail.
|
|
59
|
+
*/
|
|
60
|
+
const DIRECTORY_FSYNC_UNSUPPORTED = new Set(["EINVAL", "EBADF", "ENOTSUP", "EOPNOTSUPP"]);
|
|
61
|
+
/**
|
|
62
|
+
* fsync a directory through the current layer, so a name created or renamed
|
|
63
|
+
* into it survives a crash. Skipped on Windows (a directory cannot be opened
|
|
64
|
+
* for this there, and its filesystems journal names themselves) and tolerated
|
|
65
|
+
* where the filesystem reports directory fsync as unsupported; every other
|
|
66
|
+
* failure throws for the caller to report. The read-only handle is closed even
|
|
67
|
+
* when the fsync throws.
|
|
68
|
+
*/
|
|
69
|
+
export function fsyncDirectory(dir) {
|
|
70
|
+
if (process.platform === "win32")
|
|
71
|
+
return;
|
|
72
|
+
const writeLayer = current;
|
|
73
|
+
const fd = writeLayer.open(dir, fsConstants.O_RDONLY, 0);
|
|
74
|
+
try {
|
|
75
|
+
writeLayer.fsync(fd);
|
|
76
|
+
}
|
|
77
|
+
catch (cause) {
|
|
78
|
+
if (!DIRECTORY_FSYNC_UNSUPPORTED.has(cause.code ?? ""))
|
|
79
|
+
throw cause;
|
|
80
|
+
}
|
|
81
|
+
finally {
|
|
82
|
+
try {
|
|
83
|
+
writeLayer.close(fd);
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
// The fsync above is what mattered; a failed close of a read-only
|
|
87
|
+
// directory handle changes nothing on disk.
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=log-write-layer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-write-layer.js","sourceRoot":"","sources":["../../../src/core/log-write-layer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,SAAS,EAAE,SAAS,IAAI,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAiB1G,qEAAqE;AACrE,MAAM,gBA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AC,CAAC;IACvB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,2BAA2B,CAAC,GAAG,CAAE,KAA+B,CAAC,IAAI,IAAI,EAAE,CAAC;YAAE,MAAM,KAAK,CAAC;IACjG,CAAC;YAAS,CAAC;QACT,IAAI,CAAC;YACH,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACvB,CAAC;QAAC,MAAM,CAAC;YACP,kEAAkE;YAClE,4CAA4C;QAC9C,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/src/core/log.d.ts
CHANGED
|
@@ -42,10 +42,31 @@
|
|
|
42
42
|
* canonicalization minus the `hash` field. One scheme, two inputs — a
|
|
43
43
|
* verifier strips `hash` and re-derives. Appended with a single `write(2)`
|
|
44
44
|
* on a handle opened `O_APPEND`.
|
|
45
|
+
* 5b. **Durable before ok (APRV-440).** The write is followed by `fsync(2)` on
|
|
46
|
+
* the same descriptor, and only then does the append report ok. When this
|
|
47
|
+
* append created the file, the log directory is fsynced too (and the parent
|
|
48
|
+
* of every directory this call created), so the new name survives along with
|
|
49
|
+
* its bytes. Without this, an acknowledged record lived in the page cache
|
|
50
|
+
* only: a platform kill before writeback left the file extended over blocks
|
|
51
|
+
* that were never written, which reads back as a NUL-filled unterminated tail
|
|
52
|
+
* (observed on a hosted tenant on 2026-09-25: an acknowledged attestation
|
|
53
|
+
* lost, 456 NUL bytes in its place). Atomicity against concurrent writers
|
|
54
|
+
* was guarantee 5 all along; durability against the machine dying is this one.
|
|
55
|
+
*
|
|
56
|
+
* 6. **The writing daemon names itself, or is refused (APRV-383).** A record
|
|
57
|
+
* appended by a declaring daemon process carries `daemon`, the id of the
|
|
58
|
+
* instance that wrote it, so a tenant reading a log hosted by somebody else can
|
|
59
|
+
* tell which daemon acted on their behalf. The id comes from this process's own
|
|
60
|
+
* state (`core/daemon-identity.ts`) and never from the caller, and where the
|
|
61
|
+
* attested policy lists the ids that may write, an unlisted one is refused here
|
|
62
|
+
* with nothing written. Every earlier record, carrying no such field, validates
|
|
63
|
+
* and verifies unchanged.
|
|
45
64
|
*
|
|
46
65
|
* Determinism: `ts` is supplied by the caller. This module never reads the
|
|
47
66
|
* clock, because a hash-relevant field sourced from ambient state would make
|
|
48
|
-
* the log irreproducible.
|
|
67
|
+
* the log irreproducible. `daemon` is ambient in the same sense and is not a
|
|
68
|
+
* counter-example: a log is reproducible per WRITER, the field says which writer,
|
|
69
|
+
* and a verifier re-derives the hash from the record's own bytes either way.
|
|
49
70
|
*/
|
|
50
71
|
import { type ValidateOptions, type ValidationError } from "./validate.js";
|
|
51
72
|
/** SPEC.md §8: the hash scheme identifier stamped on every v0.1 record. */
|
|
@@ -119,9 +140,55 @@ export declare const GENESIS_PREV: null;
|
|
|
119
140
|
* attested policy as `hash-mismatch` and refused every gate operation until
|
|
120
141
|
* somebody re-attested it. The `gate.` prefix already carries the write-boundary
|
|
121
142
|
* clock in `core/verify.ts`, which is what an attestation's `ts` has to be.
|
|
143
|
+
*
|
|
144
|
+
* `audit.gesture_refused` (APRV-355) is the seventeenth: a human made a gesture
|
|
145
|
+
* on a decision surface that is NOT a decision — a checkpoint signature, a
|
|
146
|
+
* review — and the surface refused it before any verb ran. `audit.decision_refused`
|
|
147
|
+
* cannot carry one: it requires an `action_key` and a `decision` of grant,
|
|
148
|
+
* reject or revoke, and a signature has neither, so recording a refused
|
|
149
|
+
* signature there would mean manufacturing both. Audit tier on the same strict
|
|
150
|
+
* terms, `system:` actor for the same reason, and `core/gesture-refusal.ts`
|
|
151
|
+
* states the asymmetry it inherits.
|
|
152
|
+
*
|
|
153
|
+
* `audit.question_preempted` (APRV-378) is the eighteenth: something other than
|
|
154
|
+
* this gate answered a question this gate exists to ask. The first instance is
|
|
155
|
+
* Codex's server-side auto-reviewer, which can resolve an approval with a model
|
|
156
|
+
* call before `approval codex bridge` is asked and discloses it afterwards
|
|
157
|
+
* through an `item/autoApprovalReview` notification. None of the three audit
|
|
158
|
+
* records above it fits: the sweep is about activity with no records beside it,
|
|
159
|
+
* and both refusal records are about a human gesture. Here the question
|
|
160
|
+
* existed, the gate would have asked it, and somebody else answered first, so
|
|
161
|
+
* the log's silence about it would be indistinguishable from a turn that never
|
|
162
|
+
* wanted to act. Audit tier on the same strict terms, `system:` actor for the
|
|
163
|
+
* same reason, and a closed `source` enum so the next party to do this gains a
|
|
164
|
+
* member rather than a type. `core/question-preempted.ts` states the rest.
|
|
165
|
+
*
|
|
166
|
+
* `gate.path.signed_off` (APRV-338) is the sixteenth: a human's sign-off on the
|
|
167
|
+
* exact bytes of one PROTECTED PATH whose edits classify `policy.edit` or a
|
|
168
|
+
* `policy.edit.*` sub-class (amended SPEC.md §5.2, §8, §10.1). `human:` actor,
|
|
169
|
+
* and the schema refuses any other.
|
|
170
|
+
*
|
|
171
|
+
* It is a sibling of `gate.organ.attested` and not the same type, because the
|
|
172
|
+
* surfaces differ in what evidence is available for them. An organ is
|
|
173
|
+
* `policy.core`, the gate mints nothing for it, and content attestation is
|
|
174
|
+
* therefore the ONLY evidence that can exist. A protected path has grants
|
|
175
|
+
* available to it, and the after-the-fact checker of §10.1 prefers them: a
|
|
176
|
+
* grant binds the exact hunk, this record stands for the whole file, and one
|
|
177
|
+
* type carrying both claims would have let the weaker one be read as the
|
|
178
|
+
* stronger. It is in the `gate.` namespace for the reason the organ record is:
|
|
179
|
+
* §8 keys the write-boundary clock on that prefix, and a human who could
|
|
180
|
+
* backdate a sign-off could place it before bytes they never saw.
|
|
181
|
+
*/
|
|
182
|
+
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";
|
|
183
|
+
/**
|
|
184
|
+
* Caller-supplied content of an event. Chain fields are not accepted.
|
|
185
|
+
*
|
|
186
|
+
* Nor is `daemon` (APRV-383): which daemon wrote a record is a fact about the
|
|
187
|
+
* writing PROCESS, and a member here would be a field any caller could set. It is
|
|
188
|
+
* stamped by {@link buildRecord} from `core/daemon-identity.ts`'s process state,
|
|
189
|
+
* and a caller that puts the property on its input object anyway is ignored,
|
|
190
|
+
* because a record is composed field by field rather than spread.
|
|
122
191
|
*/
|
|
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";
|
|
124
|
-
/** Caller-supplied content of an event. Chain fields are not accepted. */
|
|
125
192
|
export interface EventInput {
|
|
126
193
|
/** RFC 3339 timestamp. Supplied by the caller; never read from the clock. */
|
|
127
194
|
ts: string;
|
|
@@ -139,6 +206,19 @@ export interface EventRecord extends EventInput {
|
|
|
139
206
|
alg: typeof ALG;
|
|
140
207
|
hash: string;
|
|
141
208
|
prev: string | null;
|
|
209
|
+
/**
|
|
210
|
+
* WHICH daemon instance appended this record (APRV-383), present exactly on the
|
|
211
|
+
* records a declaring daemon process wrote.
|
|
212
|
+
*
|
|
213
|
+
* OPTIONAL and additive: every record written before the field existed
|
|
214
|
+
* validates and verifies unchanged, and its absence means what it has always
|
|
215
|
+
* meant — nothing about this record says a daemon wrote it. It is a top-level
|
|
216
|
+
* field, so the record's own chain hash covers it the way it covers `actor`; it
|
|
217
|
+
* never reaches a payload hash or a token, and nothing in the runtime reads it
|
|
218
|
+
* as an input to a verdict (SPEC.md §11.1 invariant 4, and
|
|
219
|
+
* `core/daemon-identity.ts` for the whole of that argument).
|
|
220
|
+
*/
|
|
221
|
+
daemon?: string;
|
|
142
222
|
}
|
|
143
223
|
/** The hash input: a record with every field except `hash`. */
|
|
144
224
|
export type UnhashedRecord = Omit<EventRecord, "hash">;
|
|
@@ -150,24 +230,7 @@ export type UnhashedRecord = Omit<EventRecord, "hash">;
|
|
|
150
230
|
* breaking change. `head-moved` is the APRV-20 addition (finding B1), sanctioned
|
|
151
231
|
* by the human decision of 2026-08-07.
|
|
152
232
|
*/
|
|
153
|
-
export declare const APPEND_ERROR_CODES: readonly [
|
|
154
|
-
/** The lockfile was held by another writer for longer than the timeout. */
|
|
155
|
-
"lock-timeout",
|
|
156
|
-
/** The file's last line is truncated or unparseable; nothing may chain onto it. */
|
|
157
|
-
"corrupt-tail",
|
|
158
|
-
/** The complete record failed the `event` schema at the write boundary. */
|
|
159
|
-
"validation",
|
|
160
|
-
/** The record could not be canonicalized (RFC 8785). */
|
|
161
|
-
"canonicalization",
|
|
162
|
-
/** The log could not be created, opened, or written. */
|
|
163
|
-
"io",
|
|
164
|
-
/**
|
|
165
|
-
* The caller supplied {@link AppendOptions.expectedHead} and the log's actual
|
|
166
|
-
* tail, read under the lock, is a different `(seq, hash)`. Someone appended
|
|
167
|
-
* between the caller's read and this append, so every read-dependent check the
|
|
168
|
-
* caller made is stale. Nothing was written.
|
|
169
|
-
*/
|
|
170
|
-
"head-moved"];
|
|
233
|
+
export declare const APPEND_ERROR_CODES: readonly ["lock-timeout", "corrupt-tail", "validation", "canonicalization", "io", "head-moved", "daemon-id-invalid", "daemon-not-allowed"];
|
|
171
234
|
export type AppendErrorCode = (typeof APPEND_ERROR_CODES)[number];
|
|
172
235
|
export interface AppendError {
|
|
173
236
|
code: AppendErrorCode;
|
|
@@ -273,6 +336,10 @@ export declare function serializeRecord(record: EventRecord): string;
|
|
|
273
336
|
* guarantee that nobody else is appending while it works.
|
|
274
337
|
*/
|
|
275
338
|
export declare function withAppendLock<T>(logPath: string, run: () => T, options?: LockOptions): LockedResult<T>;
|
|
276
|
-
/**
|
|
339
|
+
/**
|
|
340
|
+
* Subscribe to appends that put bytes in the file: every successful one, and
|
|
341
|
+
* since APRV-440 one that wrote and then failed to confirm them durable (a
|
|
342
|
+
* short write, a failed fsync). Process-wide, memory-only, additive.
|
|
343
|
+
*/
|
|
277
344
|
export declare function onLogAppended(listener: (logPath: string) => void): void;
|
|
278
345
|
export declare function appendEvent(logPath: string, input: EventInput, options?: AppendOptions): AppendResult;
|
package/dist/src/core/log.js
CHANGED
|
@@ -42,15 +42,38 @@
|
|
|
42
42
|
* canonicalization minus the `hash` field. One scheme, two inputs — a
|
|
43
43
|
* verifier strips `hash` and re-derives. Appended with a single `write(2)`
|
|
44
44
|
* on a handle opened `O_APPEND`.
|
|
45
|
+
* 5b. **Durable before ok (APRV-440).** The write is followed by `fsync(2)` on
|
|
46
|
+
* the same descriptor, and only then does the append report ok. When this
|
|
47
|
+
* append created the file, the log directory is fsynced too (and the parent
|
|
48
|
+
* of every directory this call created), so the new name survives along with
|
|
49
|
+
* its bytes. Without this, an acknowledged record lived in the page cache
|
|
50
|
+
* only: a platform kill before writeback left the file extended over blocks
|
|
51
|
+
* that were never written, which reads back as a NUL-filled unterminated tail
|
|
52
|
+
* (observed on a hosted tenant on 2026-09-25: an acknowledged attestation
|
|
53
|
+
* lost, 456 NUL bytes in its place). Atomicity against concurrent writers
|
|
54
|
+
* was guarantee 5 all along; durability against the machine dying is this one.
|
|
55
|
+
*
|
|
56
|
+
* 6. **The writing daemon names itself, or is refused (APRV-383).** A record
|
|
57
|
+
* appended by a declaring daemon process carries `daemon`, the id of the
|
|
58
|
+
* instance that wrote it, so a tenant reading a log hosted by somebody else can
|
|
59
|
+
* tell which daemon acted on their behalf. The id comes from this process's own
|
|
60
|
+
* state (`core/daemon-identity.ts`) and never from the caller, and where the
|
|
61
|
+
* attested policy lists the ids that may write, an unlisted one is refused here
|
|
62
|
+
* with nothing written. Every earlier record, carrying no such field, validates
|
|
63
|
+
* and verifies unchanged.
|
|
45
64
|
*
|
|
46
65
|
* Determinism: `ts` is supplied by the caller. This module never reads the
|
|
47
66
|
* clock, because a hash-relevant field sourced from ambient state would make
|
|
48
|
-
* the log irreproducible.
|
|
67
|
+
* the log irreproducible. `daemon` is ambient in the same sense and is not a
|
|
68
|
+
* counter-example: a log is reproducible per WRITER, the field says which writer,
|
|
69
|
+
* and a verifier re-derives the hash from the record's own bytes either way.
|
|
49
70
|
*/
|
|
50
71
|
import { createHash } from "node:crypto";
|
|
51
|
-
import { closeSync, fstatSync, mkdirSync, openSync, readSync, unlinkSync,
|
|
72
|
+
import { closeSync, constants as fsConstants, fstatSync, mkdirSync, openSync, readSync, unlinkSync, } from "node:fs";
|
|
52
73
|
import { dirname } from "node:path";
|
|
74
|
+
import { DAEMON_APPEND_REFUSAL_CODES, daemonStampForAppend, } from "./daemon-identity.js";
|
|
53
75
|
import { canonicalize, JcsError } from "./jcs.js";
|
|
76
|
+
import { appendWriteLayer } from "./log-write-layer.js";
|
|
54
77
|
import { validate } from "./validate.js";
|
|
55
78
|
/** SPEC.md §8: the hash scheme identifier stamped on every v0.1 record. */
|
|
56
79
|
export const ALG = "sha256/jcs";
|
|
@@ -85,6 +108,15 @@ export const APPEND_ERROR_CODES = [
|
|
|
85
108
|
* caller made is stale. Nothing was written.
|
|
86
109
|
*/
|
|
87
110
|
"head-moved",
|
|
111
|
+
/**
|
|
112
|
+
* The two identity refusals of APRV-383, spread in from
|
|
113
|
+
* `core/daemon-identity.ts` where the logic that emits them lives: a daemon that
|
|
114
|
+
* declared an unusable id, and a daemon whose id the attested policy's `daemons`
|
|
115
|
+
* list does not admit. Both leave the file byte-identical, like every member
|
|
116
|
+
* above them, and both are additions to the closed union rather than renames of
|
|
117
|
+
* anything in it.
|
|
118
|
+
*/
|
|
119
|
+
...DAEMON_APPEND_REFUSAL_CODES,
|
|
88
120
|
];
|
|
89
121
|
const DEFAULT_LOCK_TIMEOUT_MS = 2_000;
|
|
90
122
|
const DEFAULT_LOCK_RETRY_MS = 20;
|
|
@@ -138,6 +170,82 @@ function sleepSync(ms) {
|
|
|
138
170
|
const buffer = new Int32Array(new SharedArrayBuffer(4));
|
|
139
171
|
Atomics.wait(buffer, 0, 0, ms);
|
|
140
172
|
}
|
|
173
|
+
/** `O_APPEND` writer flags; `O_EXCL` added for the first try, so creation is known. */
|
|
174
|
+
const APPEND_FLAGS = fsConstants.O_WRONLY | fsConstants.O_APPEND | fsConstants.O_CREAT;
|
|
175
|
+
/** The mode Node's `"a"` opens with; the umask applies as it always did. */
|
|
176
|
+
const APPEND_MODE = 0o666;
|
|
177
|
+
/**
|
|
178
|
+
* Open `logPath` for append and say whether this call created it. `O_EXCL`
|
|
179
|
+
* first: under the append lock no other sanctioned writer can race the create, so
|
|
180
|
+
* `EEXIST` means the file was already there and a plain append open follows.
|
|
181
|
+
*/
|
|
182
|
+
function openForAppend(logPath) {
|
|
183
|
+
const writeLayer = appendWriteLayer();
|
|
184
|
+
try {
|
|
185
|
+
return { fd: writeLayer.open(logPath, APPEND_FLAGS | fsConstants.O_EXCL, APPEND_MODE), created: true };
|
|
186
|
+
}
|
|
187
|
+
catch (cause) {
|
|
188
|
+
if (cause.code !== "EEXIST")
|
|
189
|
+
throw cause;
|
|
190
|
+
}
|
|
191
|
+
return { fd: writeLayer.open(logPath, APPEND_FLAGS, APPEND_MODE), created: false };
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* The errors a directory fsync returns on a filesystem that cannot sync a
|
|
195
|
+
* directory at all (some FUSE, SMB and drvfs mounts). PostgreSQL ignores the
|
|
196
|
+
* same set for the same reason: there, every first append would otherwise
|
|
197
|
+
* report io with record 1 already in the file, inviting a re-run and a
|
|
198
|
+
* duplicate. EIO and everything else still fail the append.
|
|
199
|
+
*/
|
|
200
|
+
const DIRECTORY_FSYNC_UNSUPPORTED = new Set(["EINVAL", "EBADF", "ENOTSUP", "EOPNOTSUPP"]);
|
|
201
|
+
/**
|
|
202
|
+
* fsync a directory, so a name created in it survives a crash. Windows cannot
|
|
203
|
+
* open a directory for this and its filesystems journal names themselves, so it
|
|
204
|
+
* is skipped there, as is a filesystem that reports directory fsync as
|
|
205
|
+
* unsupported; everywhere else a failure is the caller's to report.
|
|
206
|
+
*/
|
|
207
|
+
function fsyncDirectory(dir) {
|
|
208
|
+
if (process.platform === "win32")
|
|
209
|
+
return;
|
|
210
|
+
const writeLayer = appendWriteLayer();
|
|
211
|
+
const fd = writeLayer.open(dir, fsConstants.O_RDONLY, 0);
|
|
212
|
+
try {
|
|
213
|
+
writeLayer.fsync(fd);
|
|
214
|
+
}
|
|
215
|
+
catch (cause) {
|
|
216
|
+
if (!DIRECTORY_FSYNC_UNSUPPORTED.has(cause.code ?? ""))
|
|
217
|
+
throw cause;
|
|
218
|
+
}
|
|
219
|
+
finally {
|
|
220
|
+
try {
|
|
221
|
+
writeLayer.close(fd);
|
|
222
|
+
}
|
|
223
|
+
catch {
|
|
224
|
+
// The fsync above is what mattered; a failed close of a read-only
|
|
225
|
+
// directory handle changes nothing on disk.
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* The directories whose entries a first append made new: the log's own
|
|
231
|
+
* directory (which gained the file), and, when `withAppendLock` had to create
|
|
232
|
+
* directories, the parent of each one it created, up to and including the
|
|
233
|
+
* parent of the topmost. Ordered innermost first.
|
|
234
|
+
*/
|
|
235
|
+
function directoriesToSync(logPath, firstCreatedDir) {
|
|
236
|
+
const dirs = [dirname(logPath)];
|
|
237
|
+
if (firstCreatedDir === undefined)
|
|
238
|
+
return dirs;
|
|
239
|
+
const stop = dirname(firstCreatedDir);
|
|
240
|
+
for (let dir = dirs[0]; dir !== stop;) {
|
|
241
|
+
const parent = dirname(dir);
|
|
242
|
+
if (parent === dir)
|
|
243
|
+
break; // the filesystem root: nothing above to sync
|
|
244
|
+
dirs.push(parent);
|
|
245
|
+
dir = parent;
|
|
246
|
+
}
|
|
247
|
+
return dirs;
|
|
248
|
+
}
|
|
141
249
|
/**
|
|
142
250
|
* Acquire `<logPath>.lock` by `open(…, "wx")` — atomic create-or-fail, which
|
|
143
251
|
* needs no dependency and works on every platform Node supports. Retries with
|
|
@@ -385,8 +493,13 @@ function headPrecondition(logPath, expected, tail) {
|
|
|
385
493
|
* Build a complete record from caller content plus chain state. Property
|
|
386
494
|
* insertion order is irrelevant to the digest (JCS sorts keys) but is kept
|
|
387
495
|
* readable here for anyone eyeballing the code.
|
|
496
|
+
*
|
|
497
|
+
* `daemon` comes from the writing process and never from `input`, which is why it
|
|
498
|
+
* is a parameter here rather than a member of {@link EventInput}: this function
|
|
499
|
+
* composes a record field by field, so there is no spelling of a caller's input
|
|
500
|
+
* that can put a `daemon` on a record.
|
|
388
501
|
*/
|
|
389
|
-
function buildRecord(input, seq, prev) {
|
|
502
|
+
function buildRecord(input, seq, prev, daemon) {
|
|
390
503
|
const record = {
|
|
391
504
|
seq,
|
|
392
505
|
ts: input.ts,
|
|
@@ -396,6 +509,10 @@ function buildRecord(input, seq, prev) {
|
|
|
396
509
|
prev,
|
|
397
510
|
hash: "",
|
|
398
511
|
};
|
|
512
|
+
// Beside `actor`, because it answers the same question about a different layer:
|
|
513
|
+
// who caused the event, and which process wrote it down.
|
|
514
|
+
if (daemon !== null)
|
|
515
|
+
record.daemon = daemon;
|
|
399
516
|
if (input.task !== undefined)
|
|
400
517
|
record.task = input.task;
|
|
401
518
|
if (input.action_key !== undefined)
|
|
@@ -434,8 +551,17 @@ function buildRecord(input, seq, prev) {
|
|
|
434
551
|
* guarantee that nobody else is appending while it works.
|
|
435
552
|
*/
|
|
436
553
|
export function withAppendLock(logPath, run, options = {}) {
|
|
554
|
+
return lockedRun(logPath, () => run(), options);
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* {@link withAppendLock}, also telling `run` the first directory its `mkdir`
|
|
558
|
+
* created (`undefined` when the log's directory already existed), which the
|
|
559
|
+
* append needs to know which directory entries are new (APRV-440).
|
|
560
|
+
*/
|
|
561
|
+
function lockedRun(logPath, run, options) {
|
|
562
|
+
let firstCreatedDir;
|
|
437
563
|
try {
|
|
438
|
-
mkdirSync(dirname(logPath), { recursive: true });
|
|
564
|
+
firstCreatedDir = mkdirSync(dirname(logPath), { recursive: true });
|
|
439
565
|
}
|
|
440
566
|
catch (cause) {
|
|
441
567
|
return {
|
|
@@ -450,7 +576,7 @@ export function withAppendLock(logPath, run, options = {}) {
|
|
|
450
576
|
if (!lock.ok)
|
|
451
577
|
return { ok: false, error: lock.error };
|
|
452
578
|
try {
|
|
453
|
-
return { ok: true, value: run() };
|
|
579
|
+
return { ok: true, value: run(firstCreatedDir) };
|
|
454
580
|
}
|
|
455
581
|
finally {
|
|
456
582
|
releaseLock(lock.path);
|
|
@@ -467,7 +593,11 @@ export function withAppendLock(logPath, run, options = {}) {
|
|
|
467
593
|
* not turn a written record into a failed one, so throws are swallowed.
|
|
468
594
|
*/
|
|
469
595
|
const appendListeners = [];
|
|
470
|
-
/**
|
|
596
|
+
/**
|
|
597
|
+
* Subscribe to appends that put bytes in the file: every successful one, and
|
|
598
|
+
* since APRV-440 one that wrote and then failed to confirm them durable (a
|
|
599
|
+
* short write, a failed fsync). Process-wide, memory-only, additive.
|
|
600
|
+
*/
|
|
471
601
|
export function onLogAppended(listener) {
|
|
472
602
|
appendListeners.push(listener);
|
|
473
603
|
}
|
|
@@ -482,7 +612,22 @@ function noteAppend(logPath) {
|
|
|
482
612
|
}
|
|
483
613
|
}
|
|
484
614
|
export function appendEvent(logPath, input, options = {}) {
|
|
485
|
-
|
|
615
|
+
// Which daemon is writing, and whether it may (APRV-383). Asked of this
|
|
616
|
+
// process's own state rather than of the caller, and asked BEFORE the lock
|
|
617
|
+
// because it reads no log state: taking a lock only to refuse would make every
|
|
618
|
+
// other writer wait for an answer that was never going to touch the file. It is
|
|
619
|
+
// the write boundary in the sense that matters — one code path, nothing written
|
|
620
|
+
// on the refused branch, and the record's own schema pins the field's shape so a
|
|
621
|
+
// malformed id could not land even if this check were absent.
|
|
622
|
+
const stamp = daemonStampForAppend();
|
|
623
|
+
if (stamp.kind === "refuse")
|
|
624
|
+
return fail(stamp.code, stamp.message);
|
|
625
|
+
const daemon = stamp.kind === "stamp" ? stamp.id : null;
|
|
626
|
+
// Set once bytes may reach the file, success or not: the read cache
|
|
627
|
+
// must re-prove a log whose bytes changed even when the append then failed to
|
|
628
|
+
// confirm them durable.
|
|
629
|
+
let wrote = false;
|
|
630
|
+
const held = lockedRun(logPath, (firstCreatedDir) => {
|
|
486
631
|
const tail = readTail(logPath);
|
|
487
632
|
if (!tail.ok)
|
|
488
633
|
return { ok: false, error: tail.error };
|
|
@@ -497,7 +642,7 @@ export function appendEvent(logPath, input, options = {}) {
|
|
|
497
642
|
let record;
|
|
498
643
|
let line;
|
|
499
644
|
try {
|
|
500
|
-
record = buildRecord(input, tail.tail.seq + 1, tail.tail.hash);
|
|
645
|
+
record = buildRecord(input, tail.tail.seq + 1, tail.tail.hash, daemon);
|
|
501
646
|
// Stored line = JCS of the complete record; digest input excluded `hash`.
|
|
502
647
|
line = serializeRecord(record);
|
|
503
648
|
}
|
|
@@ -512,34 +657,67 @@ export function appendEvent(logPath, input, options = {}) {
|
|
|
512
657
|
if (!validation.ok) {
|
|
513
658
|
return fail("validation", `event failed schema validation at the write boundary; log left unchanged`, validation.errors);
|
|
514
659
|
}
|
|
515
|
-
let
|
|
660
|
+
let opened;
|
|
516
661
|
try {
|
|
517
|
-
|
|
662
|
+
opened = openForAppend(logPath);
|
|
518
663
|
}
|
|
519
664
|
catch (cause) {
|
|
520
665
|
return fail("io", `log ${logPath} could not be opened for append: ${errorMessage(cause)}`);
|
|
521
666
|
}
|
|
667
|
+
const { fd, created } = opened;
|
|
668
|
+
const writeLayer = appendWriteLayer();
|
|
669
|
+
const bytes = Buffer.from(`${line}\n`, "utf8");
|
|
522
670
|
try {
|
|
523
671
|
// Single write syscall on an O_APPEND handle: the line lands whole or not at all.
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
672
|
+
// Set BEFORE the write: one that throws may still have put bytes in the
|
|
673
|
+
// file, and a needless re-proof by the read cache costs only time.
|
|
674
|
+
wrote = true;
|
|
675
|
+
let written;
|
|
676
|
+
try {
|
|
677
|
+
written = writeLayer.write(fd, bytes);
|
|
678
|
+
}
|
|
679
|
+
catch (cause) {
|
|
680
|
+
return fail("io", `log ${logPath} could not be written: ${errorMessage(cause)}`);
|
|
681
|
+
}
|
|
682
|
+
if (written !== bytes.length) {
|
|
683
|
+
return fail("io", `log ${logPath} took ${String(written)} of ${String(bytes.length)} bytes of seq ${String(record.seq)}: the write was short, so the file now ends with a torn line and the record was not appended`);
|
|
684
|
+
}
|
|
685
|
+
// Durable before ok (guarantee 5b). Until this returns, the record exists
|
|
686
|
+
// in the page cache only, and a kill before writeback leaves the file
|
|
687
|
+
// extended over unwritten blocks: a NUL-filled tail where the record was.
|
|
688
|
+
try {
|
|
689
|
+
writeLayer.fsync(fd);
|
|
690
|
+
}
|
|
691
|
+
catch (cause) {
|
|
692
|
+
return fail("io", `log ${logPath}: seq ${String(record.seq)} was written but fsync failed (${errorMessage(cause)}), so it is not known to be durable: it may be in the file now and gone after a crash. Re-read the log before deciding anything from it.`);
|
|
693
|
+
}
|
|
528
694
|
}
|
|
529
695
|
finally {
|
|
530
696
|
try {
|
|
531
|
-
|
|
697
|
+
writeLayer.close(fd);
|
|
532
698
|
}
|
|
533
699
|
catch {
|
|
534
|
-
// Nothing actionable
|
|
700
|
+
// Nothing actionable: the bytes are written and, on the ok path, synced.
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
// A new file is a new directory entry, and fsync of the file does not make
|
|
704
|
+
// its NAME durable: without this a crash can keep the bytes and lose the file.
|
|
705
|
+
if (created) {
|
|
706
|
+
for (const dir of directoriesToSync(logPath, firstCreatedDir)) {
|
|
707
|
+
try {
|
|
708
|
+
fsyncDirectory(dir);
|
|
709
|
+
}
|
|
710
|
+
catch (cause) {
|
|
711
|
+
return fail("io", `log ${logPath}: seq ${String(record.seq)} was written and synced but its directory ${dir} could not be (${errorMessage(cause)}), so the newly created file is not known to survive a crash. Re-read the log before deciding anything from it.`);
|
|
712
|
+
}
|
|
535
713
|
}
|
|
536
714
|
}
|
|
537
715
|
return { ok: true, record, line };
|
|
538
716
|
}, options);
|
|
539
717
|
const result = held.ok ? held.value : { ok: false, error: held.error };
|
|
540
|
-
// After the lock is released
|
|
541
|
-
// reader cache must not serve a prefix proof anchored before this write.
|
|
542
|
-
if (
|
|
718
|
+
// After the lock is released, for every append that put bytes in the file:
|
|
719
|
+
// the reader cache must not serve a prefix proof anchored before this write.
|
|
720
|
+
if (wrote)
|
|
543
721
|
noteAppend(logPath);
|
|
544
722
|
return result;
|
|
545
723
|
}
|
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,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,QAAQ,EAA8C,MAAM,eAAe,CAAC;AAErF,2EAA2E;AAC3E,MAAM,CAAC,MAAM,GAAG,GAAG,YAAY,CAA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