approval-md 0.1.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 +629 -559
- package/SPEC.md +99 -24
- package/dist/src/adapters/agentmail.d.ts +426 -0
- package/dist/src/adapters/agentmail.js +2 -2
- package/dist/src/adapters/conformance.d.ts +149 -0
- package/dist/src/adapters/contract.d.ts +628 -0
- package/dist/src/adapters/contract.js +110 -16
- package/dist/src/adapters/contract.js.map +1 -1
- package/dist/src/adapters/email.d.ts +324 -0
- package/dist/src/adapters/env-passphrase.d.ts +93 -0
- package/dist/src/adapters/public.d.ts +11 -0
- package/dist/src/adapters/public.js +11 -0
- package/dist/src/adapters/public.js.map +1 -0
- package/dist/src/adapters/registry.d.ts +59 -0
- package/dist/src/adapters/registry.js +2 -1
- package/dist/src/adapters/registry.js.map +1 -1
- package/dist/src/adapters/smtp.d.ts +213 -0
- package/dist/src/adapters/vault-provider.d.ts +114 -0
- package/dist/src/adapters/vault-provider.js +3 -3
- package/dist/src/adapters/zzz.d.ts +66 -0
- package/dist/src/adapters/zzz.js +299 -0
- package/dist/src/adapters/zzz.js.map +1 -0
- package/dist/src/channels/batch.d.ts +109 -0
- package/dist/src/channels/cli.d.ts +193 -0
- package/dist/src/channels/conformance.d.ts +92 -0
- package/dist/src/channels/contract.d.ts +656 -0
- package/dist/src/channels/contract.js +200 -7
- package/dist/src/channels/contract.js.map +1 -1
- package/dist/src/channels/payload-view.d.ts +35 -0
- package/dist/src/channels/render-queue.d.ts +149 -0
- package/dist/src/channels/tagging.d.ts +196 -0
- package/dist/src/channels/telegram.d.ts +1944 -0
- package/dist/src/channels/telegram.js +218 -23
- package/dist/src/channels/telegram.js.map +1 -1
- package/dist/src/channels/web.d.ts +350 -0
- package/dist/src/channels/web.js +17 -0
- package/dist/src/channels/web.js.map +1 -1
- package/dist/src/cli/adapter.d.ts +90 -0
- package/dist/src/cli/adapter.js +25 -15
- package/dist/src/cli/adapter.js.map +1 -1
- package/dist/src/cli/amend.d.ts +59 -0
- package/dist/src/cli/amend.js +214 -30
- package/dist/src/cli/amend.js.map +1 -1
- package/dist/src/cli/args.d.ts +43 -0
- package/dist/src/cli/attest.d.ts +50 -0
- package/dist/src/cli/attest.js +134 -7
- package/dist/src/cli/attest.js.map +1 -1
- package/dist/src/cli/audit-card.d.ts +62 -0
- package/dist/src/cli/audit.d.ts +59 -0
- package/dist/src/cli/channel-telegram.d.ts +879 -0
- package/dist/src/cli/channel-telegram.js +311 -13
- package/dist/src/cli/channel-telegram.js.map +1 -1
- package/dist/src/cli/channel-web.d.ts +131 -0
- package/dist/src/cli/channel.d.ts +80 -0
- package/dist/src/cli/channel.js +9 -0
- package/dist/src/cli/channel.js.map +1 -1
- package/dist/src/cli/checkpoint-tap.d.ts +169 -0
- 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 +2 -0
- package/dist/src/cli/codex.js +469 -0
- package/dist/src/cli/codex.js.map +1 -0
- package/dist/src/cli/coverage.d.ts +61 -0
- package/dist/src/cli/daemon.d.ts +120 -0
- package/dist/src/cli/daemon.js +4 -1
- package/dist/src/cli/daemon.js.map +1 -1
- package/dist/src/cli/doctor.d.ts +129 -0
- package/dist/src/cli/doctor.js +586 -17
- package/dist/src/cli/doctor.js.map +1 -1
- package/dist/src/cli/env.d.ts +65 -0
- package/dist/src/cli/execute.d.ts +202 -0
- package/dist/src/cli/execute.js +25 -2
- package/dist/src/cli/execute.js.map +1 -1
- package/dist/src/cli/exit-codes.d.ts +73 -0
- package/dist/src/cli/feedback.d.ts +60 -0
- package/dist/src/cli/gate-window.d.ts +40 -0
- package/dist/src/cli/gate.d.ts +68 -0
- package/dist/src/cli/git-scope.d.ts +190 -0
- package/dist/src/cli/gloss-attach.d.ts +85 -0
- package/dist/src/cli/gloss-codex-child.d.ts +9 -0
- package/dist/src/cli/gloss-codex.d.ts +24 -0
- package/dist/src/cli/gloss-options.d.ts +42 -0
- package/dist/src/cli/gloss.d.ts +265 -0
- package/dist/src/cli/help.d.ts +107 -0
- package/dist/src/cli/help.js +320 -93
- package/dist/src/cli/help.js.map +1 -1
- package/dist/src/cli/hook-codex.d.ts +126 -0
- package/dist/src/cli/hook-codex.js +226 -0
- package/dist/src/cli/hook-codex.js.map +1 -0
- package/dist/src/cli/hook.d.ts +787 -0
- package/dist/src/cli/hook.js +1235 -181
- package/dist/src/cli/hook.js.map +1 -1
- package/dist/src/cli/import.d.ts +35 -0
- package/dist/src/cli/import.js +1 -1
- package/dist/src/cli/import.js.map +1 -1
- package/dist/src/cli/init.d.ts +84 -0
- package/dist/src/cli/init.js +2 -2
- package/dist/src/cli/init.js.map +1 -1
- package/dist/src/cli/instructions.d.ts +23 -0
- package/dist/src/cli/journal.d.ts +41 -0
- package/dist/src/cli/log-advance.d.ts +287 -0
- package/dist/src/cli/log-advance.js +102 -11
- package/dist/src/cli/log-advance.js.map +1 -1
- package/dist/src/cli/log-anchor.d.ts +176 -0
- package/dist/src/cli/log-checkpoint.d.ts +22 -0
- package/dist/src/cli/log-sync.d.ts +243 -0
- package/dist/src/cli/log-verbs.d.ts +16 -0
- package/dist/src/cli/log-verbs.js +7 -1
- package/dist/src/cli/log-verbs.js.map +1 -1
- package/dist/src/cli/long-help.d.ts +70 -0
- package/dist/src/cli/main.d.ts +77 -0
- package/dist/src/cli/main.js +159 -7
- package/dist/src/cli/main.js.map +1 -1
- package/dist/src/cli/mcp.d.ts +52 -0
- package/dist/src/cli/paths.d.ts +56 -0
- package/dist/src/cli/payload.d.ts +58 -0
- package/dist/src/cli/policy-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.d.ts +43 -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 +501 -0
- package/dist/src/cli/preflight.js +689 -45
- package/dist/src/cli/preflight.js.map +1 -1
- package/dist/src/cli/progress.d.ts +78 -0
- package/dist/src/cli/prompt.d.ts +209 -0
- package/dist/src/cli/quickstart.d.ts +46 -0
- package/dist/src/cli/quickstart.js +297 -0
- package/dist/src/cli/quickstart.js.map +1 -0
- package/dist/src/cli/records.d.ts +34 -0
- package/dist/src/cli/render.d.ts +22 -0
- package/dist/src/cli/sandbox.d.ts +51 -0
- package/dist/src/cli/sandbox.js +17 -1
- package/dist/src/cli/sandbox.js.map +1 -1
- package/dist/src/cli/scaffold.d.ts +79 -0
- package/dist/src/cli/scaffold.js +1 -1
- package/dist/src/cli/setup-adapter.d.ts +137 -0
- package/dist/src/cli/setup-adapter.js +38 -4
- package/dist/src/cli/setup-adapter.js.map +1 -1
- package/dist/src/cli/setup-channel.d.ts +126 -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-checkpoint.d.ts +57 -0
- package/dist/src/cli/setup-common.d.ts +277 -0
- package/dist/src/cli/setup-common.js +3 -2
- package/dist/src/cli/setup-common.js.map +1 -1
- package/dist/src/cli/setup-flow.d.ts +287 -0
- package/dist/src/cli/setup-service.d.ts +96 -0
- package/dist/src/cli/setup.d.ts +204 -0
- package/dist/src/cli/setup.js +94 -2
- package/dist/src/cli/setup.js.map +1 -1
- package/dist/src/cli/style.d.ts +320 -0
- package/dist/src/cli/token.d.ts +39 -0
- package/dist/src/cli/up.d.ts +155 -0
- package/dist/src/cli/up.js +119 -53
- package/dist/src/cli/up.js.map +1 -1
- package/dist/src/cli/usage.d.ts +37 -0
- package/dist/src/cli/values.d.ts +40 -0
- package/dist/src/cli/values.js +3 -4
- package/dist/src/cli/values.js.map +1 -1
- package/dist/src/cli/vault.d.ts +59 -0
- package/dist/src/cli/vault.js +2 -2
- package/dist/src/cli/vault.js.map +1 -1
- package/dist/src/cli/verb-registry.d.ts +76 -0
- package/dist/src/cli/verb-registry.js +344 -11
- package/dist/src/cli/verb-registry.js.map +1 -1
- package/dist/src/cli/wordmark.d.ts +31 -0
- package/dist/src/cli/wordmark.js +2 -2
- package/dist/src/codex/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/doctor.d.ts +13 -0
- package/dist/src/codex/doctor.js +41 -0
- package/dist/src/codex/doctor.js.map +1 -0
- package/dist/src/codex/manifest.d.ts +49 -0
- package/dist/src/codex/manifest.js +103 -0
- package/dist/src/codex/manifest.js.map +1 -0
- package/dist/src/codex/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/templates.d.ts +41 -0
- package/dist/src/codex/templates.js +319 -0
- package/dist/src/codex/templates.js.map +1 -0
- package/dist/src/codex/trust.d.ts +19 -0
- package/dist/src/codex/trust.js +183 -0
- package/dist/src/codex/trust.js.map +1 -0
- package/dist/src/codex/workspace-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/codex/workspace-plan.d.ts +131 -0
- package/dist/src/codex/workspace-plan.js +561 -0
- package/dist/src/codex/workspace-plan.js.map +1 -0
- package/dist/src/core/actor.d.ts +2 -0
- package/dist/src/core/actor.js +5 -0
- package/dist/src/core/actor.js.map +1 -0
- package/dist/src/core/advance-cycle.d.ts +221 -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 +278 -0
- package/dist/src/core/agents-md.js +33 -31
- package/dist/src/core/agents-md.js.map +1 -1
- package/dist/src/core/apply-patch.d.ts +49 -0
- package/dist/src/core/apply-patch.js +266 -0
- package/dist/src/core/apply-patch.js.map +1 -0
- package/dist/src/core/attest.d.ts +635 -0
- package/dist/src/core/attest.js +326 -4
- package/dist/src/core/attest.js.map +1 -1
- package/dist/src/core/audit.d.ts +510 -0
- package/dist/src/core/audit.js +13 -0
- package/dist/src/core/audit.js.map +1 -1
- package/dist/src/core/budgets.d.ts +238 -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/checkpoint.d.ts +500 -0
- package/dist/src/core/child-env.d.ts +88 -0
- package/dist/src/core/clock.d.ts +52 -0
- package/dist/src/core/command-class.d.ts +697 -0
- package/dist/src/core/command-class.js +713 -25
- 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/coverage-sources/adapter.d.ts +40 -0
- package/dist/src/core/coverage-sources/gh.d.ts +48 -0
- package/dist/src/core/coverage-sources/git.d.ts +101 -0
- package/dist/src/core/coverage.d.ts +217 -0
- package/dist/src/core/credential-spec.d.ts +72 -0
- package/dist/src/core/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 +432 -0
- 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 +206 -0
- 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 +455 -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 +871 -0
- package/dist/src/core/execute.js +59 -8
- package/dist/src/core/execute.js.map +1 -1
- package/dist/src/core/frontmatter.d.ts +78 -0
- package/dist/src/core/gate-window.d.ts +312 -0
- package/dist/src/core/gate.d.ts +1449 -0
- package/dist/src/core/gate.js +149 -14
- 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/git-run.d.ts +73 -0
- package/dist/src/core/harness-version.d.ts +157 -0
- package/dist/src/core/harness-version.js +4 -1
- package/dist/src/core/harness-version.js.map +1 -1
- package/dist/src/core/harness-wait.d.ts +55 -0
- package/dist/src/core/head-retry.d.ts +107 -0
- package/dist/src/core/instance.d.ts +310 -0
- package/dist/src/core/instance.js +113 -0
- package/dist/src/core/instance.js.map +1 -1
- package/dist/src/core/intake-limits.d.ts +247 -0
- package/dist/src/core/jcs.d.ts +52 -0
- package/dist/src/core/journal.d.ts +144 -0
- package/dist/src/core/live-draw.d.ts +436 -0
- package/dist/src/core/log-reconcile.d.ts +89 -0
- package/dist/src/core/log-subscribe.d.ts +36 -0
- package/dist/src/core/log-subscribe.js +162 -0
- package/dist/src/core/log-subscribe.js.map +1 -0
- package/dist/src/core/log.d.ts +316 -0
- package/dist/src/core/log.js.map +1 -1
- package/dist/src/core/loop.d.ts +274 -0
- package/dist/src/core/loop.js +11 -0
- package/dist/src/core/loop.js.map +1 -1
- package/dist/src/core/md-fence.d.ts +41 -0
- package/dist/src/core/money.d.ts +147 -0
- package/dist/src/core/payload-census.d.ts +74 -0
- package/dist/src/core/payload-store.d.ts +175 -0
- package/dist/src/core/payload.d.ts +71 -0
- package/dist/src/core/policy-diff.d.ts +292 -0
- package/dist/src/core/policy-diff.js +27 -4
- package/dist/src/core/policy-diff.js.map +1 -1
- package/dist/src/core/policy-expectations.d.ts +199 -0
- package/dist/src/core/policy-explain.d.ts +160 -0
- package/dist/src/core/policy-explain.js +63 -3
- package/dist/src/core/policy-explain.js.map +1 -1
- package/dist/src/core/policy-load.d.ts +567 -0
- package/dist/src/core/policy-load.js +36 -6
- package/dist/src/core/policy-load.js.map +1 -1
- package/dist/src/core/policy-match.d.ts +324 -0
- package/dist/src/core/policy-match.js +72 -9
- package/dist/src/core/policy-match.js.map +1 -1
- package/dist/src/core/policy-proposal.d.ts +317 -0
- package/dist/src/core/policy-proposal.js +102 -2
- package/dist/src/core/policy-proposal.js.map +1 -1
- package/dist/src/core/prompt-layout.d.ts +221 -0
- package/dist/src/core/protected-path-guard.d.ts +566 -0
- package/dist/src/core/protected-path-guard.js +848 -55
- 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/registration.d.ts +25 -0
- package/dist/src/core/reindex.d.ts +99 -0
- package/dist/src/core/sampler.d.ts +313 -0
- package/dist/src/core/sandbox.d.ts +371 -0
- package/dist/src/core/sandbox.js +190 -1
- package/dist/src/core/sandbox.js.map +1 -1
- package/dist/src/core/seal.d.ts +165 -0
- 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/state.d.ts +505 -0
- package/dist/src/core/task-file.d.ts +185 -0
- package/dist/src/core/telegram-config.d.ts +93 -0
- package/dist/src/core/token.d.ts +409 -0
- package/dist/src/core/token.js +21 -38
- package/dist/src/core/token.js.map +1 -1
- package/dist/src/core/validate.d.ts +138 -0
- package/dist/src/core/values.d.ts +147 -0
- package/dist/src/core/values.js +36 -1
- package/dist/src/core/values.js.map +1 -1
- package/dist/src/core/vault.d.ts +291 -0
- package/dist/src/core/verified-snapshot.d.ts +204 -0
- package/dist/src/core/verify.d.ts +336 -0
- package/dist/src/core/version.d.ts +8 -0
- package/dist/src/core/wysiwys.d.ts +370 -0
- package/dist/src/daemon/advance-child.d.ts +39 -0
- package/dist/src/daemon/advance.d.ts +476 -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 +87 -0
- package/dist/src/daemon/daemon.d.ts +1180 -0
- package/dist/src/daemon/daemon.js +9 -0
- package/dist/src/daemon/daemon.js.map +1 -1
- package/dist/src/daemon/dark-session.d.ts +64 -0
- package/dist/src/daemon/draw-child.d.ts +36 -0
- package/dist/src/daemon/draw.d.ts +154 -0
- package/dist/src/daemon/git-evidence.d.ts +173 -0
- package/dist/src/daemon/git-evidence.js +1 -1
- package/dist/src/daemon/projection.d.ts +180 -0
- package/dist/src/daemon/prune.d.ts +207 -0
- package/dist/src/mcp/http.d.ts +113 -0
- package/dist/src/mcp/server.d.ts +265 -0
- package/dist/src/mcp/server.js +17 -1
- package/dist/src/mcp/server.js.map +1 -1
- package/docs/adapter-api.md +106 -0
- package/docs/cli-reference.md +1316 -63
- package/docs/codex-enforced-session.md +103 -0
- package/docs/codex-workspace-broker.md +118 -0
- package/package.json +14 -2
- package/schema/codex-instance.schema.json +82 -0
- package/schema/event.schema.json +539 -9
- package/schema/fixtures/codex-instance/invalid/unpinned-codex-version.json +40 -0
- package/schema/fixtures/codex-instance/valid/canonical.json +40 -0
- 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 +75 -3
- package/schema/values.schema.json +7 -11
- package/templates/codex/README.md +9 -0
- package/schema/fixtures/values/invalid/version-string.json +0 -1
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which instance owns which bot (APRV-390).
|
|
3
|
+
*
|
|
4
|
+
* APRV-178 scoped the OS keystore's ITEM NAMES to an instance, which closed the
|
|
5
|
+
* half of the incident where two gates read one item. It did not close the
|
|
6
|
+
* other half: two instances can still be handed the same bot token under two
|
|
7
|
+
* perfectly distinct names. `core/instance.ts` answers its questions from names
|
|
8
|
+
* alone, on purpose, and a name cannot tell you that two different names hold
|
|
9
|
+
* one value.
|
|
10
|
+
*
|
|
11
|
+
* Observed again on 2026-09-19: the primary daemon and the demo gate in
|
|
12
|
+
* `~/demo-gate` both long-polled one bot, both printed `getUpdates` HTTP 409
|
|
13
|
+
* Conflict on every poll, and neither phone channel worked. The only thing that
|
|
14
|
+
* distinguishes those two processes is what the Bot API says the token IS, and
|
|
15
|
+
* the only call that asks is `getMe`. So this module records `getMe`'s answer
|
|
16
|
+
* and makes the second claim on one bot a refusal instead of a 409.
|
|
17
|
+
*
|
|
18
|
+
* ## The two records
|
|
19
|
+
*
|
|
20
|
+
* ```
|
|
21
|
+
* <instance>/.approval/channel-owner.json one instance's own bots
|
|
22
|
+
* <state dir>/approval/bots.json every instance's claims, per machine
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* The per-instance file is this instance's copy of what it probed, gitignored
|
|
26
|
+
* and rebuildable by one `getMe`. The registry is the part that has to be
|
|
27
|
+
* SHARED, because the question is "does anything else on this machine hold this
|
|
28
|
+
* bot", and no file inside one instance can answer that.
|
|
29
|
+
*
|
|
30
|
+
* ## Why the registry is a plain file, and why it is not under `.approval`
|
|
31
|
+
*
|
|
32
|
+
* **Not the OS keystore.** Every reader of this registry is a diagnostic or a
|
|
33
|
+
* start-up preflight, and neither may block on an unlock dialog — that is
|
|
34
|
+
* `NON_RESOLVING_RUNNER`'s rule in `core/env-file.ts`, and `approval doctor`
|
|
35
|
+
* already answers the whole keychain-scope row from names for exactly this
|
|
36
|
+
* reason. A machine with no keystore backend at all still needs this refusal,
|
|
37
|
+
* and would get nothing from a store it does not have. And there is no secret
|
|
38
|
+
* here to justify one: a bot id, a `@username`, an instance id and a directory
|
|
39
|
+
* path are all things `.approval/env` carries in the open.
|
|
40
|
+
*
|
|
41
|
+
* **Not a `.approval` directory under the home directory**, which was the other
|
|
42
|
+
* candidate. This project's own policy reserves anything under `.approval/` to
|
|
43
|
+
* the human's ceremony (`policy.core`, human-only), and the hook classifier
|
|
44
|
+
* applies that to the name wherever it appears. A file the runtime rewrites on
|
|
45
|
+
* every listener start does not belong in the directory the policy holds shut.
|
|
46
|
+
*
|
|
47
|
+
* So it goes where this runtime already puts per-user state that is derived
|
|
48
|
+
* rather than evidence: the same platform split `cli/setup-service.ts` uses for
|
|
49
|
+
* a service's console output. {@link APPROVAL_STATE_DIR_ENV} overrides it, which
|
|
50
|
+
* is what the test suite sets — a suite that wrote the operator's real registry
|
|
51
|
+
* would be the mistake the Muse probe's suite made with its live pointer.
|
|
52
|
+
*
|
|
53
|
+
* ## What it is not
|
|
54
|
+
*
|
|
55
|
+
* Not evidence, and never consulted by an enforcement path. Nothing in here
|
|
56
|
+
* widens a permission, and losing the whole file costs one re-probe. It answers
|
|
57
|
+
* one question — "is another instance on this machine already polling this
|
|
58
|
+
* bot?" — and that answer only ever produces a REFUSAL. A registry that could
|
|
59
|
+
* be edited into granting something would be a policy file; this one can be
|
|
60
|
+
* edited into letting a 409 happen, which is the state without it.
|
|
61
|
+
*/
|
|
62
|
+
import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
63
|
+
import { homedir } from "node:os";
|
|
64
|
+
import { dirname, join } from "node:path";
|
|
65
|
+
import { instanceHomeFor, instanceIdFor } from "./instance.js";
|
|
66
|
+
/** The per-instance record's filename, inside `.approval/`. Gitignored. */
|
|
67
|
+
export const CHANNEL_OWNER_FILE = "channel-owner.json";
|
|
68
|
+
/** The per-machine registry's filename, inside the state directory. */
|
|
69
|
+
export const BOT_REGISTRY_FILE = "bots.json";
|
|
70
|
+
/**
|
|
71
|
+
* Where the per-machine registry lives, overriding the platform default.
|
|
72
|
+
*
|
|
73
|
+
* Set by the test suite, and available to an operator running two gates under
|
|
74
|
+
* one account who wants them in separate state trees. An empty or unset value
|
|
75
|
+
* means the platform default.
|
|
76
|
+
*/
|
|
77
|
+
export const APPROVAL_STATE_DIR_ENV = "APPROVAL_STATE_DIR";
|
|
78
|
+
/** The only format version this build writes, and the only one it reads. */
|
|
79
|
+
export const CHANNEL_OWNER_VERSION = 1;
|
|
80
|
+
/**
|
|
81
|
+
* One Bot API base, reduced so two spellings of one deployment compare equal.
|
|
82
|
+
*
|
|
83
|
+
* Lowercased and stripped of trailing slashes, which are the two ways the same
|
|
84
|
+
* base is written. Nothing more is attempted: a host that resolves to the same
|
|
85
|
+
* server under two names is two names here, and that is the safe direction of
|
|
86
|
+
* the error — two identities, so the second gate is allowed to start, exactly
|
|
87
|
+
* as it was before this module existed.
|
|
88
|
+
*/
|
|
89
|
+
export function normaliseApiBase(apiBase) {
|
|
90
|
+
return apiBase.trim().replace(/\/+$/u, "").toLowerCase();
|
|
91
|
+
}
|
|
92
|
+
// ---------------------------------------------------------------------------
|
|
93
|
+
// Paths
|
|
94
|
+
// ---------------------------------------------------------------------------
|
|
95
|
+
/**
|
|
96
|
+
* The per-user state directory for this runtime.
|
|
97
|
+
*
|
|
98
|
+
* The split is `cli/setup-service.ts`'s `defaultLogsDir`, one level up: macOS
|
|
99
|
+
* keeps user application state under `Library/Application Support` and Linux
|
|
100
|
+
* under `.local/state` (XDG's state home, which is where "state that should
|
|
101
|
+
* persist between restarts but is not config and is not a cache" belongs).
|
|
102
|
+
*/
|
|
103
|
+
export function stateDirFor(env = process.env) {
|
|
104
|
+
const override = env[APPROVAL_STATE_DIR_ENV];
|
|
105
|
+
if (override !== undefined && override.length > 0)
|
|
106
|
+
return override;
|
|
107
|
+
if (process.platform === "darwin") {
|
|
108
|
+
return join(homedir(), "Library", "Application Support", "approval");
|
|
109
|
+
}
|
|
110
|
+
const xdg = env["XDG_STATE_HOME"];
|
|
111
|
+
const base = xdg !== undefined && xdg.length > 0 ? xdg : join(homedir(), ".local", "state");
|
|
112
|
+
return join(base, "approval");
|
|
113
|
+
}
|
|
114
|
+
/** The per-machine registry's path. */
|
|
115
|
+
export function registryPathFor(env = process.env) {
|
|
116
|
+
return join(stateDirFor(env), BOT_REGISTRY_FILE);
|
|
117
|
+
}
|
|
118
|
+
/** The per-instance record's path, for the instance owning `logPath`. */
|
|
119
|
+
export function ownerPathFor(logPath) {
|
|
120
|
+
return join(instanceHomeFor(logPath), CHANNEL_OWNER_FILE);
|
|
121
|
+
}
|
|
122
|
+
// ---------------------------------------------------------------------------
|
|
123
|
+
// Reading
|
|
124
|
+
// ---------------------------------------------------------------------------
|
|
125
|
+
/**
|
|
126
|
+
* Parse one claim, or `null`.
|
|
127
|
+
*
|
|
128
|
+
* Strict field by field, and `null` for anything short of complete: a
|
|
129
|
+
* half-readable claim is one this build cannot say whose bot it names, and the
|
|
130
|
+
* safe direction for THAT is to forget it (the preflight then re-probes and
|
|
131
|
+
* re-claims) rather than to refuse a start-up over a row nobody can read.
|
|
132
|
+
*/
|
|
133
|
+
function parseClaim(raw) {
|
|
134
|
+
if (typeof raw !== "object" || raw === null)
|
|
135
|
+
return null;
|
|
136
|
+
const record = raw;
|
|
137
|
+
const channel = record["channel"];
|
|
138
|
+
const botId = record["bot_id"];
|
|
139
|
+
const username = record["username"];
|
|
140
|
+
const apiBase = record["api_base"];
|
|
141
|
+
const instanceId = record["instance_id"];
|
|
142
|
+
const instanceHome = record["instance_home"];
|
|
143
|
+
const claimedAt = record["claimed_at"];
|
|
144
|
+
if (channel !== "telegram")
|
|
145
|
+
return null;
|
|
146
|
+
if (typeof botId !== "string" || botId.length === 0)
|
|
147
|
+
return null;
|
|
148
|
+
if (typeof username !== "string")
|
|
149
|
+
return null;
|
|
150
|
+
if (typeof apiBase !== "string" || apiBase.length === 0)
|
|
151
|
+
return null;
|
|
152
|
+
if (typeof instanceId !== "string" || instanceId.length === 0)
|
|
153
|
+
return null;
|
|
154
|
+
if (typeof instanceHome !== "string" || instanceHome.length === 0)
|
|
155
|
+
return null;
|
|
156
|
+
if (typeof claimedAt !== "string")
|
|
157
|
+
return null;
|
|
158
|
+
return { channel, botId, username, apiBase, instanceId, instanceHome, claimedAt };
|
|
159
|
+
}
|
|
160
|
+
function serialiseClaim(claim) {
|
|
161
|
+
return {
|
|
162
|
+
channel: claim.channel,
|
|
163
|
+
bot_id: claim.botId,
|
|
164
|
+
username: claim.username,
|
|
165
|
+
api_base: claim.apiBase,
|
|
166
|
+
instance_id: claim.instanceId,
|
|
167
|
+
instance_home: claim.instanceHome,
|
|
168
|
+
claimed_at: claim.claimedAt,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
function readJson(path) {
|
|
172
|
+
let raw;
|
|
173
|
+
try {
|
|
174
|
+
raw = readFileSync(path, "utf8");
|
|
175
|
+
}
|
|
176
|
+
catch {
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
try {
|
|
180
|
+
return JSON.parse(raw);
|
|
181
|
+
}
|
|
182
|
+
catch {
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Every claim recorded on this machine, newest write last.
|
|
188
|
+
*
|
|
189
|
+
* An unreadable, absent or malformed registry is an EMPTY one. It is a cache of
|
|
190
|
+
* probes, so "I do not know of any claim" is the honest answer and it costs one
|
|
191
|
+
* `getMe` to rebuild — whereas failing a listener start-up because a JSON file
|
|
192
|
+
* in a state directory got truncated would take the phone channel down for a
|
|
193
|
+
* reason that has nothing to do with the gate.
|
|
194
|
+
*/
|
|
195
|
+
export function readRegistry(env = process.env) {
|
|
196
|
+
const parsed = readJson(registryPathFor(env));
|
|
197
|
+
if (typeof parsed !== "object" || parsed === null)
|
|
198
|
+
return [];
|
|
199
|
+
const record = parsed;
|
|
200
|
+
if (record["version"] !== CHANNEL_OWNER_VERSION)
|
|
201
|
+
return [];
|
|
202
|
+
const claims = record["claims"];
|
|
203
|
+
if (!Array.isArray(claims))
|
|
204
|
+
return [];
|
|
205
|
+
return claims
|
|
206
|
+
.map((entry) => parseClaim(entry))
|
|
207
|
+
.filter((claim) => claim !== null);
|
|
208
|
+
}
|
|
209
|
+
/** What this instance last recorded about its own channels. */
|
|
210
|
+
export function readOwner(logPath) {
|
|
211
|
+
const parsed = readJson(ownerPathFor(logPath));
|
|
212
|
+
if (typeof parsed !== "object" || parsed === null)
|
|
213
|
+
return [];
|
|
214
|
+
const record = parsed;
|
|
215
|
+
if (record["version"] !== CHANNEL_OWNER_VERSION)
|
|
216
|
+
return [];
|
|
217
|
+
const claims = record["claims"];
|
|
218
|
+
if (!Array.isArray(claims))
|
|
219
|
+
return [];
|
|
220
|
+
return claims
|
|
221
|
+
.map((entry) => parseClaim(entry))
|
|
222
|
+
.filter((claim) => claim !== null);
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* The claim this instance holds on `channel`, or `null`.
|
|
226
|
+
*
|
|
227
|
+
* Read from the per-instance file, which is what `approval channel telegram
|
|
228
|
+
* health` and `approval doctor` report from: both are offline, and both must
|
|
229
|
+
* answer without a network call or a keystore lookup.
|
|
230
|
+
*/
|
|
231
|
+
export function ownedBot(logPath, channel) {
|
|
232
|
+
return readOwner(logPath).find((claim) => claim.channel === channel) ?? null;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Every OTHER instance on this machine that has claimed `botId`.
|
|
236
|
+
*
|
|
237
|
+
* "Other" is decided by instance id, so a re-run in the same instance is never
|
|
238
|
+
* reported against itself, and two directories that reach one gate by different
|
|
239
|
+
* spellings are two instances — which is `core/instance.ts`'s deliberate choice
|
|
240
|
+
* of the safe error direction, and this module inherits it rather than adding a
|
|
241
|
+
* second rule that could disagree.
|
|
242
|
+
*/
|
|
243
|
+
export function otherOwnersOf(logPath, botId, apiBase, env = process.env) {
|
|
244
|
+
const mine = instanceIdFor(logPath);
|
|
245
|
+
const base = normaliseApiBase(apiBase);
|
|
246
|
+
return readRegistry(env).filter((claim) => claim.botId === botId && normaliseApiBase(claim.apiBase) === base && claim.instanceId !== mine);
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* One sentence naming who else holds this bot, for a refusal or a 409 report.
|
|
250
|
+
*
|
|
251
|
+
* Exported because three surfaces print it — the listener preflight, `approval
|
|
252
|
+
* setup channel telegram`, and the runtime 409 report — and three spellings of
|
|
253
|
+
* "another instance owns this bot" is three chances for them to name different
|
|
254
|
+
* instances for one fact.
|
|
255
|
+
*/
|
|
256
|
+
export function describeOwners(owners) {
|
|
257
|
+
return owners
|
|
258
|
+
.map((claim) => `${claim.instanceHome} (instance ${claim.instanceId})`)
|
|
259
|
+
.join(" and ");
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Record this instance as `identity`'s owner, unless somebody else already is.
|
|
263
|
+
*
|
|
264
|
+
* Read-then-write rather than compare-and-append: this is a local cache of
|
|
265
|
+
* probes and not the log, so the property it needs is "two instances racing
|
|
266
|
+
* both see a refusal or one of them wins", which a same-machine read-then-write
|
|
267
|
+
* over a file rewritten in whole gives. It is deliberately NOT passed through
|
|
268
|
+
* the log's append path — nothing here is evidence, and putting a re-probe on
|
|
269
|
+
* every listener start into the hash chain would be writing a heartbeat into
|
|
270
|
+
* the record the project's whole argument says must stay small and meaningful.
|
|
271
|
+
*
|
|
272
|
+
* The refusal names the other instance, because "this bot is taken" without
|
|
273
|
+
* saying by what is a message that sends an operator looking through `ps`.
|
|
274
|
+
*/
|
|
275
|
+
export function claimBot(logPath, identity, options = {}) {
|
|
276
|
+
const env = options.env ?? process.env;
|
|
277
|
+
const now = options.now ?? (() => new Date());
|
|
278
|
+
const instanceId = instanceIdFor(logPath);
|
|
279
|
+
const instanceHome = instanceHomeFor(logPath);
|
|
280
|
+
const registry = readRegistry(env);
|
|
281
|
+
const base = normaliseApiBase(identity.apiBase);
|
|
282
|
+
const owners = registry.filter((claim) => claim.botId === identity.botId &&
|
|
283
|
+
normaliseApiBase(claim.apiBase) === base &&
|
|
284
|
+
claim.instanceId !== instanceId);
|
|
285
|
+
if (owners.length > 0) {
|
|
286
|
+
return {
|
|
287
|
+
ok: false,
|
|
288
|
+
code: "bot-owned-elsewhere",
|
|
289
|
+
owners,
|
|
290
|
+
message: `${identity.username} (bot id ${identity.botId}) is already recorded on this machine as ${describeOwners(owners)}, and this instance is ${instanceHome} (instance ${instanceId}). Two gates polling one bot is the HTTP 409 loop: their getUpdates offsets acknowledge each other's updates and an approval tap is answered by whichever listener asked first. Give this instance its own bot from @BotFather, or retire the other instance`,
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
const claim = {
|
|
294
|
+
...identity,
|
|
295
|
+
apiBase: base,
|
|
296
|
+
instanceId,
|
|
297
|
+
instanceHome,
|
|
298
|
+
claimedAt: now().toISOString(),
|
|
299
|
+
};
|
|
300
|
+
// This instance's rows for this channel are replaced, never appended to: an
|
|
301
|
+
// instance pointed at a new bot owns the new one and stops owning the old,
|
|
302
|
+
// and a registry that accumulated every bot an instance ever had would refuse
|
|
303
|
+
// a bot the operator deliberately moved between two gates.
|
|
304
|
+
const kept = registry.filter((entry) => !(entry.instanceId === instanceId && entry.channel === identity.channel));
|
|
305
|
+
writeRegistry([...kept, claim], env);
|
|
306
|
+
writeOwner(logPath, claim);
|
|
307
|
+
return { ok: true, claim };
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Drop this instance's claim on `channel`, from both records.
|
|
311
|
+
*
|
|
312
|
+
* Used by nothing on the happy path. It exists because the alternative to a way
|
|
313
|
+
* out is an operator hand-editing a JSON file in a state directory to recover
|
|
314
|
+
* from a stale claim, and a recovery step that is not a command is a recovery
|
|
315
|
+
* step that gets done wrong.
|
|
316
|
+
*/
|
|
317
|
+
export function releaseBot(logPath, channel, env = process.env) {
|
|
318
|
+
const instanceId = instanceIdFor(logPath);
|
|
319
|
+
writeRegistry(readRegistry(env).filter((claim) => !(claim.instanceId === instanceId && claim.channel === channel)), env);
|
|
320
|
+
writeOwnerClaims(logPath, readOwner(logPath).filter((claim) => claim.channel !== channel));
|
|
321
|
+
}
|
|
322
|
+
// ---------------------------------------------------------------------------
|
|
323
|
+
// Writing
|
|
324
|
+
// ---------------------------------------------------------------------------
|
|
325
|
+
/**
|
|
326
|
+
* Write `path` by rename, so a reader never sees half a file.
|
|
327
|
+
*
|
|
328
|
+
* A best-effort write: a state directory that cannot be created (a read-only
|
|
329
|
+
* home, a container with no writable state tree) leaves the runtime exactly
|
|
330
|
+
* where it was before this module existed, which is a machine that can still
|
|
331
|
+
* get a 409. Failing a listener start-up over it would trade a recoverable
|
|
332
|
+
* conflict for an unrecoverable one.
|
|
333
|
+
*/
|
|
334
|
+
function writeAtomic(path, body) {
|
|
335
|
+
try {
|
|
336
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
337
|
+
const temporary = `${path}.${String(process.pid)}.tmp`;
|
|
338
|
+
writeFileSync(temporary, body, { encoding: "utf8", mode: 0o600 });
|
|
339
|
+
renameSync(temporary, path);
|
|
340
|
+
}
|
|
341
|
+
catch {
|
|
342
|
+
/* see the doc above: the registry is a cache, and its absence is the status quo ante */
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
function writeRegistry(claims, env) {
|
|
346
|
+
const body = `${JSON.stringify({ version: CHANNEL_OWNER_VERSION, claims: claims.map((claim) => serialiseClaim(claim)) }, null, 2)}\n`;
|
|
347
|
+
writeAtomic(registryPathFor(env), body);
|
|
348
|
+
}
|
|
349
|
+
function writeOwnerClaims(logPath, claims) {
|
|
350
|
+
const body = `${JSON.stringify({ version: CHANNEL_OWNER_VERSION, claims: claims.map((claim) => serialiseClaim(claim)) }, null, 2)}\n`;
|
|
351
|
+
writeAtomic(ownerPathFor(logPath), body);
|
|
352
|
+
}
|
|
353
|
+
/** Record one claim in this instance's own file, replacing its channel's row. */
|
|
354
|
+
function writeOwner(logPath, claim) {
|
|
355
|
+
const kept = readOwner(logPath).filter((entry) => entry.channel !== claim.channel);
|
|
356
|
+
writeOwnerClaims(logPath, [...kept, claim]);
|
|
357
|
+
}
|
|
358
|
+
//# sourceMappingURL=channel-owner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel-owner.js","sourceRoot":"","sources":["../../../src/core/channel-owner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE/D,2EAA2E;AAC3E,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AAEvD,uEAAuE;AACvE,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;AAE3D,4EAA4E;AAC5E,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAiCvC;;;;;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