@runeditrun/rer 0.2.84 → 0.2.86
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 +156 -50
- package/cli/README.md +78 -2
- package/cli/agent-door.mjs +149 -0
- package/cli/agent-fixtures.mjs +16 -0
- package/cli/agent-mail.mjs +54 -0
- package/cli/agent-network.mjs +64 -0
- package/cli/agent-reviewers.mjs +110 -0
- package/cli/agent-secrets.mjs +23 -0
- package/cli/agent-sponsors.mjs +43 -0
- package/cli/agent-surface.mjs +34 -0
- package/cli/agent-webhooks.mjs +19 -0
- package/cli/authoring.mjs +2 -1
- package/cli/bounded.mjs +1 -1
- package/cli/business/archive-task.mjs +32 -0
- package/cli/business/carry.mjs +151 -0
- package/cli/business/catchup-task.mjs +42 -0
- package/cli/business/choices.mjs +97 -0
- package/cli/business/command.mjs +29 -6
- package/cli/business/connect.mjs +20 -8
- package/cli/business/detector.mjs +4 -1
- package/cli/business/device.mjs +13 -0
- package/cli/business/export-inputs.mjs +69 -0
- package/cli/business/export-task.mjs +17 -0
- package/cli/business/invocation.mjs +8 -1
- package/cli/business/keychain.mjs +8 -1
- package/cli/business/lease.mjs +11 -1
- package/cli/business/local-commands.mjs +80 -30
- package/cli/business/outbound.mjs +9 -4
- package/cli/business/parsers-config.mjs +8 -7
- package/cli/business/parsers-syntax.mjs +7 -3
- package/cli/business/permissions.mjs +2 -0
- package/cli/business/questions.mjs +89 -6
- package/cli/business/setup-command.mjs +49 -0
- package/cli/business/setup-company.json +15 -0
- package/cli/business/setup-demo.mjs +95 -0
- package/cli/business/state.mjs +44 -10
- package/cli/business/supervisor.mjs +97 -32
- package/cli/business/vendor-door.mjs +230 -0
- package/cli/business/vendors/README.md +29 -3
- package/cli/business/vendors/common.mjs +8 -6
- package/cli/business/vendors/index.mjs +22 -11
- package/cli/business/vendors/sorry.mjs +106 -0
- package/cli/container-transfer.mjs +2 -2
- package/cli/contract.mjs +7 -7
- package/cli/demo-deploy-error.mjs +14 -0
- package/cli/demo-native.mjs +6 -2
- package/cli/deploy-command.mjs +6 -4
- package/cli/deploy-config.mjs +1 -1
- package/cli/deploy-owner-input.mjs +3 -1
- package/cli/deploy-variables.mjs +58 -0
- package/cli/deploy.mjs +9 -7
- package/cli/door-clauses.mjs +157 -0
- package/cli/errors.mjs +1 -1
- package/cli/export.mjs +16 -4
- package/cli/hosted-output.mjs +17 -7
- package/cli/human-error.mjs +20 -0
- package/cli/inspect.mjs +4 -0
- package/cli/jsonc.mjs +8 -4
- package/cli/lifecycle.mjs +26 -6
- package/cli/main.mjs +2 -1
- package/cli/managed-data-schema.mjs +127 -0
- package/cli/managed-data-zip.mjs +116 -0
- package/cli/managed-data.mjs +110 -0
- package/cli/managed-server.mjs +25 -14
- package/cli/native-owner-entry.mjs +86 -0
- package/cli/output.mjs +3 -2
- package/cli/parse.mjs +2 -2
- package/cli/portability-empty.mjs +65 -0
- package/cli/portability-migrations.mjs +33 -9
- package/cli/portability-policy.mjs +5 -2
- package/cli/portability-worker.mjs +15 -6
- package/cli/portability.mjs +30 -8
- package/cli/production-auth.mjs +1 -1
- package/cli/production-mail.mjs +8 -2
- package/cli/ready-summary.mjs +9 -0
- package/cli/run-transfers.mjs +37 -0
- package/cli/runtime-front-door.mjs +4 -4
- package/cli/server-proxy.mjs +4 -3
- package/cli/server-registry.mjs +13 -8
- package/cli/site.mjs +6 -1
- package/cli/transfers.mjs +17 -4
- package/edition-authoring/archive-source.mjs +59 -0
- package/edition-authoring/base-copies.mjs +147 -25
- package/edition-authoring/cli.mjs +1 -1
- package/edition-authoring/edition-migrations.mjs +7 -3
- package/edition-authoring/module-closure.mjs +2 -16
- package/edition-authoring/workflow-copies.mjs +1 -1
- package/edition-authoring/workflow-scripts.mjs +12 -3
- package/foundation/runtime/contract-docs.mjs +218 -34
- package/foundation/runtime/contract-prose-patterns.mjs +14 -0
- package/foundation/runtime/contract-prose.mjs +88 -0
- package/foundation/runtime/run-data.d.mts +1 -0
- package/foundation/runtime/run-data.mjs +2 -0
- package/global/CHANGELOG.md +126 -0
- package/global/README.md +156 -50
- package/global/cli/command.mjs +8 -2
- package/global/cli/install.mjs +4 -5
- package/global/cli/path-link.mjs +3 -2
- package/global/cli/repo-command.mjs +3 -7
- package/global/door/command.mjs +3 -1
- package/global/launch/dev.mjs +12 -2
- package/global/launch/facts.mjs +2 -2
- package/global/launch/render.mjs +16 -9
- package/global/launch/state.mjs +4 -4
- package/global/main.mjs +13 -8
- package/install.sh +17 -6
- package/modules/agent-door/CLAUSES.md +215 -0
- package/modules/agent-door/conformance/audit.mjs +66 -0
- package/modules/agent-door/conformance/authority.d.mts +2 -0
- package/modules/agent-door/conformance/authority.mjs +17 -0
- package/modules/agent-door/conformance/crypto.mjs +36 -0
- package/modules/agent-door/conformance/discovery.mjs +61 -0
- package/modules/agent-door/conformance/index.mjs +41 -0
- package/modules/agent-door/conformance/invocation.mjs +32 -0
- package/modules/agent-door/conformance/journey.mjs +112 -0
- package/modules/agent-door/conformance/narrowing.d.mts +1 -0
- package/modules/agent-door/conformance/narrowing.mjs +21 -0
- package/modules/agent-door/conformance/negative.mjs +47 -0
- package/modules/agent-door/conformance/network-modules.mjs +86 -0
- package/modules/agent-door/conformance/network-runtime.mjs +46 -0
- package/modules/agent-door/conformance/policy-phases.mjs +75 -0
- package/modules/agent-door/conformance/protocol.mjs +145 -0
- package/modules/agent-door/conformance/replay.mjs +38 -0
- package/modules/agent-door/conformance/schema.mjs +71 -0
- package/modules/agent-door/conformance/security.mjs +33 -0
- package/modules/agent-door/conformance/sponsors.mjs +68 -0
- package/modules/agent-door/conformance/surface.mjs +89 -0
- package/modules/agent-door/conformance/target.mjs +18 -0
- package/modules/agent-door/conformance/tool-name.d.mts +1 -0
- package/modules/agent-door/conformance/tool-name.mjs +7 -0
- package/modules/agent-door/conformance/webhooks.mjs +30 -0
- package/modules/container/README.md +6 -1
- package/modules/container/adapters/d1-limits.mjs +286 -0
- package/modules/container/adapters/d1-sqlite.mjs +95 -0
- package/modules/container/adapters/d1-workerd-preload.mjs +19 -0
- package/modules/container/adapters/d1-workerd-setup.mjs +26 -0
- package/modules/container/adapters/d1-workerd.mjs +5 -0
- package/modules/container/adapters/sqlite-worker.mjs +5 -3
- package/modules/container/build.mjs +1 -0
- package/modules/container/image-variables.mjs +14 -3
- package/modules/container/transfer.mjs +14 -4
- package/modules/container/worker-engine.mjs +3 -3
- package/modules/demo-host/README.md +6 -0
- package/modules/demo-host/build.mjs +1 -0
- package/modules/demo-host/native/prepare.mjs +2 -1
- package/modules/demo-host/native/sql.mjs +7 -2
- package/modules/demo-host/ownership.mjs +39 -0
- package/modules/demo-host/plan.mjs +2 -1
- package/modules/demo-host/remove.mjs +6 -1
- package/modules/deploy-kit/README.md +22 -2
- package/modules/deploy-kit/d1-import-diagnostics.mjs +56 -0
- package/modules/deploy-kit/d1-import.mjs +17 -5
- package/modules/deploy-kit/diagnostics.mjs +29 -3
- package/modules/deploy-kit/owner-cli.mjs +20 -7
- package/modules/deploy-kit/provider-transport.mjs +19 -4
- package/modules/deploy-kit/provider.mjs +57 -22
- package/modules/deploy-kit/readiness-window.mjs +1 -1
- package/modules/deploy-kit/site.mjs +8 -3
- package/modules/deploy-kit/worker.mjs +4 -4
- package/modules/import-kit/schema/importer-verification-receipt.schema.json +171 -0
- package/modules/import-kit/schema/importers.schema.json +107 -0
- package/modules/import-kit/src/d1/README.md +23 -4
- package/modules/import-kit/src/d1/atomic-prefix.ts +2 -2
- package/modules/import-kit/src/d1/budget.ts +15 -7
- package/modules/import-kit/src/d1/column-layout.ts +5 -0
- package/modules/import-kit/src/d1/creation.ts +15 -8
- package/modules/import-kit/src/d1/database.ts +3 -3
- package/modules/import-kit/src/d1/erasure-pages.ts +2 -1
- package/modules/import-kit/src/d1/erasure.ts +2 -2
- package/modules/import-kit/src/d1/jobs.ts +10 -6
- package/modules/import-kit/src/d1/plans.ts +14 -8
- package/modules/import-kit/src/d1/retirement.ts +2 -2
- package/modules/import-kit/src/d1/sets.ts +1 -3
- package/modules/import-kit/src/d1/staged-creation.ts +3 -3
- package/modules/import-kit/src/door/ADOPTING.md +20 -0
- package/modules/import-kit/src/door/README.md +2 -1
- package/modules/import-kit/src/door/admission.ts +5 -3
- package/modules/import-kit/src/door/archive.ts +5 -2
- package/modules/import-kit/src/door/authority.ts +1 -0
- package/modules/import-kit/src/door/grants.ts +1 -1
- package/modules/import-kit/src/door/handler.ts +14 -8
- package/modules/import-kit/src/door/index.ts +1 -1
- package/modules/import-kit/src/door/jobs.ts +40 -0
- package/modules/import-kit/src/door/limits.ts +1 -1
- package/modules/import-kit/src/door/operator.ts +3 -3
- package/modules/import-kit/src/door/planning.ts +10 -6
- package/modules/import-kit/src/door/protocol.ts +2 -2
- package/modules/import-kit/src/door/raw.ts +25 -0
- package/modules/import-kit/src/door/refusals.ts +2 -1
- package/modules/import-kit/src/door/types.ts +26 -6
- package/modules/import-kit/src/receipt/encoding.ts +37 -0
- package/modules/import-kit/src/receipt/index.ts +69 -0
- package/modules/import-kit/src/receipt/policy.ts +24 -0
- package/modules/import-kit/src/receipt/types.ts +64 -0
- package/modules/import-kit/src/receipt/uri.ts +45 -0
- package/modules/import-kit/src/receipt/validation.ts +87 -0
- package/modules/import-kit/src/status/encoding.ts +13 -0
- package/modules/import-kit/src/status/evidence.ts +218 -0
- package/modules/import-kit/src/status/index.ts +56 -0
- package/modules/import-kit/src/status/schema.ts +208 -0
- package/modules/import-kit/src/status/types.ts +86 -0
- package/modules/operator-auth/accounts/delegated.mjs +48 -0
- package/modules/operator-auth/index.d.mts +7 -0
- package/modules/operator-auth/service.mjs +2 -0
- package/modules/portability/README.md +138 -9
- package/modules/portability/backfills.mjs +9 -8
- package/modules/portability/bridge.mjs +32 -5
- package/modules/portability/catalogue.mjs +12 -5
- package/modules/portability/copies.mjs +8 -1
- package/modules/portability/derived.mjs +33 -0
- package/modules/portability/files.mjs +4 -3
- package/modules/portability/http-errors.mjs +1 -1
- package/modules/portability/http.mjs +3 -3
- package/modules/portability/import.mjs +29 -13
- package/modules/portability/index.d.mts +4 -3
- package/modules/portability/index.mjs +1 -1
- package/modules/portability/ledgers.mjs +3 -2
- package/modules/portability/legacy-safety.mjs +11 -2
- package/modules/portability/migration-history.mjs +2 -2
- package/modules/portability/progress.mjs +1 -0
- package/modules/portability/restore-empty.mjs +12 -0
- package/modules/release/github-verify.mjs +11 -2
- package/onboarding/adapter.mjs +35 -6
- package/onboarding/app-fetch.mjs +6 -4
- package/onboarding/development-runtime.mjs +19 -0
- package/onboarding/local/operation.mjs +45 -27
- package/onboarding/loopback-fetch.mjs +16 -0
- package/onboarding/operator-installer.mjs +2 -4
- package/onboarding/process-diagnostics.mjs +6 -2
- package/onboarding/production-runtime.mjs +4 -2
- package/onboarding/readiness.mjs +1 -0
- package/package.json +4 -2
- package/scripts/publish-check/copy_identities.py +3 -1
- package/scripts/publish-check/github_refs.py +32 -13
- package/scripts/publish-check/public_hygiene.py +1 -1
- package/cli/business/opt-ins.mjs +0 -33
package/global/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,131 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.86
|
|
4
|
+
|
|
5
|
+
- Let verifier owner initializers and native journeys complete real email confirmation through a bounded captured-mail reader and supply per-run data to declared isolated provider edges. The controls stay outside production builds. Prove fresh agent-door/settings source copies typecheck with upstream tests omitted.
|
|
6
|
+
|
|
7
|
+
- Recheck native resource visibility before retained event replay and subscription delivery; accept single-segment and underscore tool names within MCP's 128-character limit; preserve opaque string or numeric revision tokens through approvals. Negotiate every advertised MCP version explicitly and document the unsupported March 2025 transport.
|
|
8
|
+
|
|
9
|
+
- Agent-door access/security tools can declare a machine-checked revoke/narrow contract and prove a native grant subset plus undeclared-argument refusal. Native-proof tools challenge with a human handoff, use the seed verifier before execution and remain subject to company policy and approval; conformance checks challenges, bogus references, audits and valid native proof.
|
|
10
|
+
|
|
11
|
+
- Carry agent/client scopes into resource authorization, delayed approvals and event/subscription filtering. Embedded callers supply explicit scopes; native current-grant hooks may only narrow their original authority.
|
|
12
|
+
|
|
13
|
+
- Agent-door verification can map native environment binding names to its disposable issuer, installation and owner/session values. Durable invocations retain their originating consent and refuse revoked consent at worker admission, with consent attribution in the audit.
|
|
14
|
+
|
|
15
|
+
- Agent-door verification fixtures generate disposable setup, session, local bearer, delivery and provider credentials at runtime while retaining signed receipts and isolated provider checks.
|
|
16
|
+
|
|
17
|
+
- Local `rer export` and `rer import` accept the historical `_rer_deploy_migrations` plus `d1_migrations` pair: the deploy ledger remains authoritative and Wrangler is skipped. Incomplete, pending or conflicting histories still refuse before transfer.
|
|
18
|
+
|
|
19
|
+
- **Known adapter change in 0.2.85:** the worker's `migration-preflight` receipt changed from `{platformLedger}` to `{nativeApply}`, and `platformMigrationPreflight` was renamed to `nativeMigrationPreflight`. Seeds wrapping the worker or importing the internal adapter must update; the supported adapter entry is `@runeditrun/rer/portability-migrations`, and native migrations run only when `nativeApply` is true.
|
|
20
|
+
|
|
21
|
+
- `rer deploy --dry-run` now accepts valid senders on reserved fixture domains and no longer requires an owner name to print its local plan. Real deploys keep placeholder-sender refusals and managed adapters check the owner email before asking for a missing name; deploy help documents that order.
|
|
22
|
+
|
|
23
|
+
- Contract conversion now reads requirement prose and acceptance lists in a blockquote after a legacy clause bullet, while preserving clause boundaries and refusing clauses with no requirement prose.
|
|
24
|
+
|
|
25
|
+
- Contract conversion now keeps requirement prose and acceptance points after a leading plain, italic or bold Status line, preserves the recorded status, and still refuses a clause with no requirement prose or a conflicting status.
|
|
26
|
+
|
|
27
|
+
- Import door sources may declare `format: 'raw'` and a seed-owned `readRaw` reader for ZIP and other binary exports. Verified upload bytes, hash and size reach that reader before text decoding; exact custody, reviewed plans and the existing apply, reconciliation, catch-up and Undo lifecycle are shared with JSON/NDJSON sources.
|
|
28
|
+
|
|
29
|
+
- Managed data restores now accept downloads that omit policy-declared derived virtual tables while retaining their triggers. Base creates those sandbox tables from destination migrations and atomically rebuilds external-content FTS5 search indexes from restored rows. Virtual-table SQL in downloads remains refused, and copy-normalization failures now have a named error.
|
|
30
|
+
|
|
31
|
+
- Refuse inherited names in the front-door CLI verb table and agent conformance schema predicates before dispatch. Unknown door commands keep exit 2, and unsupported schema types produce validation diagnostics.
|
|
32
|
+
|
|
33
|
+
- Agent-door verification follows signed and native owner lifecycles, supports isolated seed provider adapters, and accepts Base source archives for copy authoring.
|
|
34
|
+
|
|
35
|
+
- Fix unused bindings in the copied contract generator; add `check-prose` to `check` for generated acceptance and unclassified tools, with source-linked warnings for Base restatements and misplaced records, and require guarded request-name registries in foundation guidance.
|
|
36
|
+
|
|
37
|
+
- Bind agent sponsors to durable Business person ids from signed settings, enforce native admission including the allow-list, and honour signed agent and consent revocation. Resources now use the policy and audit pipeline. Approvals show saved summaries, bind decisions to their hash, execute with named approvers and leave a separate execution audit; Undo is the reviewer's act. Running audits commit before effects and recover from recorded outcomes. Standalone spend caps and unscoped Business daily limits are refused until their enforcement exists. The reference journey exercises self-escalation fixtures and real settings pairing.
|
|
38
|
+
|
|
39
|
+
- Add the server-side agent-door source entry `modules/agent-door/index.ts`, native-action adoption guidance, signed policy adoption on existing owner-claim trust, MCP and person routes, approvals, reviews, audit and retained events. Document request capacities and indefinitely retained idempotency outcomes; distinguish implemented conformance point registrations from edition-specific coverage. Policy behavior derives from platform commit `72aa71c03d943b53ed43dc73cac17d412c00d8fb`, `src/business/agent-policy/{catalogue,document,decide}.ts`; runtime copy pins and CLI versions remain independent.
|
|
40
|
+
|
|
41
|
+
- Re-exporting the maintained reference leaves its CLI inventory unchanged after generated copies are committed; its development version tracks the last exported source change.
|
|
42
|
+
|
|
43
|
+
- Contract conversion retains observed homepage table headers, escaped pipes, quoted prose and historical claim statuses, and refuses dropped or changed source claims. `record-base --from-api` records verified immutable Base copies through the GitHub API when a local checkout is unavailable.
|
|
44
|
+
|
|
45
|
+
- Convert handwritten homepage claims with reviewed alias maps bound to the original revision, file, line and claim text, preserving the original obligations and judgments.
|
|
46
|
+
|
|
47
|
+
- Keep reviewed license, launcher and hosted-demo facts in converted claims as explicit non-product rows, with their historical status separate from current unassessed status.
|
|
48
|
+
|
|
49
|
+
- Preserve an explicitly recorded negative-scope boundary without inventing a product clause, using the supported `boundary` basis and the original source record.
|
|
50
|
+
|
|
51
|
+
- Publication scans use each retained revision's repository context so local source paths beside repository prose do not become remote declarations; explicit repository references still receive the existing visibility checks.
|
|
52
|
+
|
|
53
|
+
- After computer choices change in Business, name `business next` as the next step and report which local apps received the Business name, including when none did.
|
|
54
|
+
|
|
55
|
+
- `rer refresh-base` accepts literal apostrophes in double-quoted workflow text while still refusing unclosed shell quotes before writing files.
|
|
56
|
+
|
|
57
|
+
- Editions can declare reviewed test-reader dependencies in `verification.json` so contract, source-lock and evidence-only changes can select the Verify light tier; unknown readers still require full coverage.
|
|
58
|
+
|
|
59
|
+
- `rer refresh-base` no longer prints the template-adoption notice when a preserved workflow already matches the incoming template, including acknowledged adaptations.
|
|
60
|
+
|
|
61
|
+
- Older v2 backups without `schemaObjects` now restore without acknowledgment when their recorded migrations prove the complete destination schema and archived tables. Unverifiable backups retain the explicit recovery option. Managed data ZIP intake also accepts old native staging-table leftovers, and its fixture preserves parent-before-child creation order for foreign keys.
|
|
62
|
+
|
|
63
|
+
- `rer import` now restores into an existing local D1 file with no product schema, including a file created by Wrangler after reset. Migrations run before restore as they do when no file exists; occupied destinations and unknown foreign tables remain refused.
|
|
64
|
+
|
|
65
|
+
- `rer refresh-base` refused sparse historical module copies when required dependency additions also resolved their old missing imports. Refresh now delivers and records those planned dependencies without a manual copy-record edit; ordinary unresolved imports without a planned dependency remain preserved.
|
|
66
|
+
|
|
67
|
+
- Verify labelled sponsor lists through native lifecycles, signed Business bindings and a cross-sponsor privacy/approval phase; single-sponsor journeys keep their existing phases and point counts.
|
|
68
|
+
|
|
69
|
+
- Provision native per-install webhook keys into isolated verification receivers through a contained, read-only state accessor; signed inbound probes verify both accepted effects and wrong-signature refusals.
|
|
70
|
+
|
|
71
|
+
- Add explicit `authority: 'none'` security tools for justified record changes, with closed schema validation, undeclared-argument refusal, normal policy/approval handling and audit classification.
|
|
72
|
+
|
|
73
|
+
- Recheck current agent-door admission before returning idempotent outcomes; refusals retain their own audit without exposing cached content.
|
|
74
|
+
|
|
75
|
+
- Agent-door verification can declare independent native reviewer lifecycles with bounded, recipient-scoped captured mail; invitations, confirmation and two-person decisions still pass through the seed's production handlers.
|
|
76
|
+
|
|
77
|
+
- Resolve seed-declared native targets into audit and hashed approval summaries; retain resolvable pause/unset classification; return resource refusal machine codes in JSON-RPC data; require sponsor-escalation fixtures only for applicable native surfaces.
|
|
78
|
+
|
|
79
|
+
- Expose frozen agent-door admission identity, granted scopes, operation id and idempotency key to native tools. Bind queued continuations to their retained admission, preserve named approvers and once-only replay, and recheck current grants and consent before effects.
|
|
80
|
+
|
|
81
|
+
- Add `rer business setup --origin URL --session-file FILE --confirm-demo` to provision the synthetic Run your business demo through the platform owner routes. Mirror managed/assisted/self_host hosting, resumable door proofs and read-only completed repeats; require an owned 0600 session file, keep its value out of output, and retain the platform JSON receipt. Exit 0 requires every required seed to be provisioned, token-issued, policy-confirmed, settings-delivered and door-proved; completed repeats return equal receipts.
|
|
82
|
+
|
|
83
|
+
- Prove publication-scan copy digests per file, so an adapted file in a directory copy no longer discards its unchanged siblings' proofs. Mismatched digests, adapted content and unlisted files remain fully scanned.
|
|
84
|
+
|
|
85
|
+
- Hosted demo redeploys now recognise secret-triggered versions that lost their ownership annotation when unchanged code, runtime and bindings match the retained rer deployment. Foreign or changed Workers remain refused before writes, with the actual ownership cause and recovery guidance in human and JSON output.
|
|
86
|
+
|
|
87
|
+
- `rer check` now fails `deploy.vars-secrets` when any Wrangler source or environment declares a plain variable that the deployment also declares as a secret, including empty placeholders. It lists every binding and both declaration locations, with the repair, before a build or demo deploy.
|
|
88
|
+
|
|
89
|
+
- Seeds can sync the canonical BASE-AGENT-001 through 013 requirements with `rer door clauses --write` or detect drift with `--check`. The command preserves seed judgments and specialist clauses, adds unjudged duties as missing, and regenerates and checks contract documents. The module copy and portable CLI inventory deliver the same canonical source.
|
|
90
|
+
|
|
91
|
+
### Known issues
|
|
92
|
+
|
|
93
|
+
- The two refresh recovery guidance issues documented in 0.2.82 still apply, with the same manual recoveries.
|
|
94
|
+
- The delivered Verify template's runner-temporary pnpm store, Chromium and apt cache lifecycle is not yet exercised end to end on a GitHub Ubuntu 24.04 runner; Base Verify covers only Base's own bootstrap.
|
|
95
|
+
|
|
96
|
+
## 0.2.85
|
|
97
|
+
|
|
98
|
+
- Two starters could both take over a stale local operation lock and both act as its owner. Takeover is now exclusive: the lock's inode stays pinned through takeover, and release checks the owner token.
|
|
99
|
+
- A local app listening on a different port than the CLI assigned left `rer dev`, `rer preview` and test runs waiting about 15 minutes. Shared local runtimes now bind before reporting their port, a mismatched listener fails within seconds, and application health readiness is bounded to 60 seconds.
|
|
100
|
+
- An import at the planner's accepted cap could fail part-way with `IMPORT_D1_REQUEST_LIMIT`. Each D1 batch call now counts as one paid-plan query, creation admission is shared with execution, existing erasure statement ceilings stay separate, and plan read pages are sized from their actual chunk bytes so the public door keeps room for its own queries. The canonical plan byte cap is unchanged.
|
|
101
|
+
- Portability export of a wide table (very many or very long column names) failed on D1: its row-size preflight query exceeded D1's 100,000-byte statement limit. The measurement is now split into bounded column queries and summed per row before the unchanged size limit applies, and internal row guards stay out of column removal so valid schema changes keep SQLite semantics. Local D1 stand-ins on the pinned Node 22 runtime now enforce D1's limits on SQL bytes, parameters, function arguments, pattern bytes, bound values and encoded rows (native demo SQLite bindings use the same helper), so tests can fail for queries production would reject. Expression depth 100 is observed, not documented, and is checked with an estimated parser-tree depth proved against workerd at 100 and 101.
|
|
102
|
+
- Run site deploy failures did not say which provider call failed or why. Human and JSON failures now name the failing provider step, sanitized endpoint, elapsed time, timeout limit and network cause or redacted HTTP refusal body, beside the existing deploy failure facts.
|
|
103
|
+
- Hosted demo bundling refused "Secret declared as an image variable" for an empty Wrangler placeholder of a declared runtime secret. Container and native demo bundles now drop empty placeholders for declared runtime secrets, keep the runtime secret declarations and still refuse non-empty secret image values.
|
|
104
|
+
- **Import the Platform data download natively.** The Managed data ZIP failed as a damaged archive. The reference adapter now opts into a bounded ZIP intake that stages the source in isolation, translates its Platform migration ledger and uses the existing empty-install restore; adapters opt in with `managedData: true` or wrap their native restore with `withManagedDataImport`. Malformed downloads, unknown source tables (even those row policy excludes) and occupied destinations are refused before destination data changes. Internal schema prefixes compare literally, indexes and triggers on excluded tables stay in archive accounting, trigger definitions import literally, retired schema objects reconcile against destination migrations, and dependent new-table backfills replay during native restore. The historical schema projection remains only for explicitly acknowledged v1 recovery.
|
|
105
|
+
- The separate install-then-start recipe needed a PATH step, and frozen-lockfile install failures showed raw pnpm codes. The recipe now runs the installed launcher by its absolute path, and frozen-lockfile refusals give one plain cause and a runnable repair command, keeping pnpm codes and captured output in JSON.
|
|
106
|
+
- A refused D1 import upload lost Cloudflare's HTTP status and body, so `rer deploy` could not explain it. D1 import init, upload, ingest and poll failures now keep redacted, bounded diagnostics (status, provider codes and messages, network cause) in human and JSON failures; the failure code and retry policy are unchanged.
|
|
107
|
+
- Refused dependency downloads, invalid ports and checkout archive paths printed error classes and stacks. They now give a plain cause and a runnable next command and keep useful detail facts (command, status, output tail, log path); JSON output is unchanged.
|
|
108
|
+
- After Business pairing the next step was unclear, and the owner's computer choices needed a reconnect. Business setup and local launch now lead with one plain next step, name `business next` after pairing, defer optional shell setup (`rer cli path`) until the app is ready, and show a shared cold-run budget with measured archive downloads and disk use; `business next` and `business run` apply the owner's latest choices without reconnecting.
|
|
109
|
+
- Local first-party apps did not know the paired Business. Connect, setup and dev now carry its name and display settings into the checkout, running apps refresh while Business runs, and disconnect removes the local carry.
|
|
110
|
+
- Contract `coverage check` counted the old Status summary table as lines to place, so a seed could not satisfy both it and the contract standard. Coverage now skips Status table lines except a clause row's non-empty Gap cell.
|
|
111
|
+
- Release verification reported one fixed reason for every GitHub CLI failure, hiding causes such as a rate-limit 403. Unavailable verification receipts now include the gh exit status and bounded, redacted stderr, keeping the authentication guidance when stderr is empty.
|
|
112
|
+
- `rer dev` and `rer demo` failed to load seed source folders named `exports`. Development now allows them while generated top-level export output and installation archives stay private.
|
|
113
|
+
- Local worker requests could fail with "fetch failed" or `UND_ERR_SOCKET` after a server closed an idle socket. Loopback harness connections now close after each response; readiness, owner claims and seed runtime journeys share this transport, with no retries.
|
|
114
|
+
- `rer deploy --dry-run` exited 3 without Cloudflare credentials although it is documented to validate locally. Dry runs now build and validate the local plan with no credentials or Cloudflare requests and print target, binding and migration names; remote readiness checks are left to a real deploy.
|
|
115
|
+
- Version 2 backups without a schema object inventory could not be restored. Explicit `--acknowledge-unverified-schema-objects` recovers them into an empty installation with destination migration replay and every existing restore fence; completed receipts record the acknowledged schema uncertainty, and current archives restore without acknowledgment.
|
|
116
|
+
- A fresh owner could not sign in to a local `rer preview`, and `rer demo` offered only its persona. Preview now prints a single-use native owner entry and demo adds one beside its persona, through the existing fragment gate and native owner grant; links expire within 15 minutes and are never saved.
|
|
117
|
+
- First runs needed a shell PATH detour, led with machine lines and an unlabelled site URL, showed a fixed owner address without explanation, and timed every phase from the launch. The installer now prints a quoted absolute launch command, ready output leads with one plain app link and labels the site, the owner form explains the local account, and each launch phase is timed separately; machine ready output is unchanged.
|
|
118
|
+
- The shared hosting guide listed its options in a different order from the Run chooser. It now follows the chooser: the one-line local run first, then Assisted, then Managed for a listing that offers it, then the do-it-yourself Cloudflare steps, with plan copy, sign-up state and links taken from the chooser.
|
|
119
|
+
- Automatic `rer dev` port selection could exhaust its 1,000 candidates when stopped checkouts kept saved setup records. A saved setup port now excludes a candidate only while that checkout's launch worker or server still runs with its recorded start identity; live servers, active claims and bound sockets still exclude their ports, and an exhausted search still names its range and candidate count.
|
|
120
|
+
- Publication scans rejected OpenAI noreply co-author trailers in commit messages. That provider's exact `noreply` address is now accepted in the final trailer paragraph, as the Anthropic and GitHub ones are; personal addresses, body text, other trailer keys, other or lookalike domains, files and annotated tags still fail.
|
|
121
|
+
- Refresh refused with "fetch full Base history" when a shallow Base checkout lacked the ancestry its migration comparison needs. Online refresh now fetches just the two immutable comparison tips, with no tags and a 60-second transport deadline, into a temporary bare repository and leaves the supplied checkout unchanged; failed or offline acquisition refuses before any write and names both revisions, the Base remote and an exact one-line repair command.
|
|
122
|
+
- Seed Verify ran the push shards in full for both a branch push and its pull request, ran every push shard again on each nightly schedule, and installed system browser libraries before trying Chromium. The delivered workflow now plans each run: it reuses the newest full push proof of an identical tree (the pull request's head push, the same commit on another branch, or a direct parent with the same tree), runs light coverage (the edition lock check, `pnpm run check`, the reviewed readers and the site build) when a branch push changes only contract documents, `sources.lock.json` or evidence on top of a push-verified parent, and otherwise runs in full. Schedules run only the nightly shards, on Monday and Thursday at a time rendered from the seed name; release tags still run every shard; and Chromium's system libraries are installed only after a failed launch probe.
|
|
123
|
+
|
|
124
|
+
### Known issues
|
|
125
|
+
|
|
126
|
+
- The two refresh recovery guidance issues documented in 0.2.82 still apply, with the same manual recoveries.
|
|
127
|
+
- The delivered Verify template's runner-temporary pnpm store, Chromium and apt cache lifecycle is not yet exercised end to end on a GitHub Ubuntu 24.04 runner; Base Verify covers only Base's own bootstrap.
|
|
128
|
+
|
|
3
129
|
## 0.2.84
|
|
4
130
|
|
|
5
131
|
- The publication scan accepts the upstream copyright notice of a Base-listed third-party licence text only under an exact licence file name with the listed Git blob ID (initially the vendored yaml 2.9.1 `LICENSE`) and reports each in `thirdPartyNotices`; seed configuration cannot extend the list, and scans of the unpacked rer tarball and of refreshed seeds pass without review records.
|
package/global/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# rer
|
|
2
2
|
|
|
3
|
+
<!-- BEGIN COLD RUN BUDGET -->
|
|
4
|
+
Allow roughly 500 MB–1 GB of downloads and 1–3 GB of disk space for a first run, including Node, rer, the app and its dependencies. The app and your computer can need more; later runs reuse downloads.
|
|
5
|
+
<!-- END COLD RUN BUDGET -->
|
|
6
|
+
|
|
3
7
|
`rer` is the Run Edit Run command. Install it once, then run `rer <verb>` in any
|
|
4
8
|
Run Edit Run checkout: every verb runs that checkout's own pinned copy, so a
|
|
5
9
|
checkout always gets the behaviour it was built and tested with.
|
|
@@ -15,19 +19,28 @@ Review source changes and run edition tests before committing. See the
|
|
|
15
19
|
[edition authoring guide](https://github.com/runeditrun/base/blob/main/export/EDITION-AUTHORING.md)
|
|
16
20
|
for adoption, refusal behavior, JSON fields and the original Base-checkout form.
|
|
17
21
|
|
|
22
|
+
`rer door clauses --write` syncs the shared agent requirements into a seed's
|
|
23
|
+
contract, preserving its judgments and its own specialist clauses, then runs
|
|
24
|
+
contract document generation and checking. `rer door clauses --check` reports
|
|
25
|
+
missing or stale requirements without writing; use `--cwd DIR` to select a seed.
|
|
26
|
+
The CLI can sync a contract before runtime adoption; regenerate the seed's source lock last.
|
|
27
|
+
See [agent door adoption](https://github.com/runeditrun/base/blob/main/modules/agent-door/ADOPTING.md#contract-clauses).
|
|
28
|
+
|
|
18
29
|
## Install
|
|
19
30
|
|
|
20
31
|
Start a seed from an empty folder, with or without Node:
|
|
21
32
|
|
|
22
33
|
```sh
|
|
23
34
|
curl -fsSL https://runeditrun.com/install.sh | sh
|
|
24
|
-
rer dev just-every/run-inkwell
|
|
35
|
+
"$HOME/.local/bin/rer" dev just-every/run-inkwell
|
|
25
36
|
```
|
|
26
37
|
|
|
27
38
|
The installer needs no Node: without Node 22 or later on PATH it installs a
|
|
28
|
-
private one for `rer` (see below). It edits no shell profile
|
|
29
|
-
|
|
30
|
-
|
|
39
|
+
private one for `rer` (see below). It edits no shell profile. The second step
|
|
40
|
+
uses the installed launcher directly, so it works in the same shell without
|
|
41
|
+
changing PATH: a child installer cannot change its parent shell’s PATH, and bare
|
|
42
|
+
`rer` needs `~/.local/bin` on PATH. After the app opens, an optional
|
|
43
|
+
`rer cli path` step explains how to make `rer` available in future terminals.
|
|
31
44
|
The same start also fits on one line:
|
|
32
45
|
|
|
33
46
|
```sh
|
|
@@ -66,24 +79,13 @@ With no Node 22 or later on PATH, the script installs Node 22.20.0 from
|
|
|
66
79
|
`nodejs.org` into `~/.local/share/rer/runtimes` (under `XDG_DATA_HOME` when set),
|
|
67
80
|
verifies the tarball against that release's published `SHASUMS256.txt`, and
|
|
68
81
|
prints its location. The launcher uses this private runtime on later runs.
|
|
69
|
-
System Node
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
PATH directory. It names any existing `rer` elsewhere on PATH and leaves it
|
|
77
|
-
unchanged. If `~/.local/bin` is absent from PATH, another command shadows it,
|
|
78
|
-
or no startup file of your shell adds it for new terminals, its last line is
|
|
79
|
-
one command to run: it appends `export PATH="$HOME/.local/bin:$PATH"` to that
|
|
80
|
-
startup file (`~/.zshrc` for zsh; `~/.bash_profile` for bash on macOS and
|
|
81
|
-
`~/.bashrc` elsewhere; `~/.profile` otherwise) and runs it in the current shell.
|
|
82
|
-
For fish it is `fish_add_path ~/.local/bin`. Without a private runtime, the
|
|
83
|
-
launcher uses `node` from PATH. A re-run with the same build changes
|
|
84
|
-
nothing; a different build is installed beside the current one, the previous one
|
|
85
|
-
is kept and older ones are removed. It refuses to replace a `~/.local/bin/rer`
|
|
86
|
-
that it did not write.
|
|
82
|
+
System Node is left alone. With no arguments, the installer prints an app-start
|
|
83
|
+
command using its absolute launcher. After a first launch, `rer cli path` shows
|
|
84
|
+
an optional shell-specific line to make `rer` available in future terminals.
|
|
85
|
+
Only running that line changes a shell startup file; `rer` never edits one.
|
|
86
|
+
A re-run with the same build changes nothing; a different build keeps the
|
|
87
|
+
previous version and removes older ones. It refuses to replace a launcher it
|
|
88
|
+
did not write.
|
|
87
89
|
|
|
88
90
|
`rer --version` prints this rer's version; inside a checkout a second line
|
|
89
91
|
names the version the checkout pins, or says that its vendored copy is
|
|
@@ -420,6 +422,38 @@ Sensitive-looking outbound names are dropped and counted in `withheld`.
|
|
|
420
422
|
Symlinks, generated outputs and dependency trees are skipped; unsupported
|
|
421
423
|
formats and syntax may yield no signals.
|
|
422
424
|
|
|
425
|
+
## Run your business demo
|
|
426
|
+
|
|
427
|
+
```sh
|
|
428
|
+
rer business setup --origin https://app.runeditrun.com --session-file /private/path/owner.session --confirm-demo
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
This provisions the synthetic Juniper Harbor Software demo through the platform's
|
|
432
|
+
Business routes using the signed-in person's session. The session file must be
|
|
433
|
+
an owned regular file with mode `0600`, containing only `rer_session=VALUE` or
|
|
434
|
+
`__Host-rer_session=VALUE`. Symbolic links are refused. The session is read in
|
|
435
|
+
process, sent only as the platform Cookie header, and never printed or placed
|
|
436
|
+
in argv, local Business state or a receipt. `--confirm-demo` is required.
|
|
437
|
+
|
|
438
|
+
Hosting defaults to `managed`; `--hosting assisted` and `--hosting self_host`
|
|
439
|
+
are also supported. There is no `hosted` alias. `--wait-seconds 0..240` bounds
|
|
440
|
+
provisioning polling (default: 240). Both normal output and `--json` print the
|
|
441
|
+
platform script's JSON receipt, including each seed's actual state and only
|
|
442
|
+
credential identifiers. Errors print a named `{code}` to stderr and exit 1.
|
|
443
|
+
|
|
444
|
+
Run the same command to resume. Completed seeds keep their token, consent and
|
|
445
|
+
policy identifiers and report equal receipts (`already provisioned`). The
|
|
446
|
+
receipt includes each seed's state and a top-level `complete` flag. Exit 0
|
|
447
|
+
requires `complete: true`: every required seed must be provisioned, token-issued,
|
|
448
|
+
policy-confirmed, settings-delivered and have its door proofs recorded.
|
|
449
|
+
Missing adoptions remain `not yet on the agent door` and exit nonzero.
|
|
450
|
+
|
|
451
|
+
The route order, policy, synthetic company profile and receipt are mirrored from
|
|
452
|
+
the RER platform at commit `0261033177e8e05284c037369ee9c3a85922a8aa`,
|
|
453
|
+
`scripts/business/demo.mjs` and `demo/company.json`. The platform owns the seed
|
|
454
|
+
catalogue, fixture data and door proofs. This command does not pair the computer
|
|
455
|
+
or use its stored device credential.
|
|
456
|
+
|
|
423
457
|
## Business device commands
|
|
424
458
|
|
|
425
459
|
`rer business connect --code ABCD-1234 [--origin https://app.runeditrun.com]`
|
|
@@ -454,12 +488,17 @@ The owner chooses three things on the computer's row in the browser: "Add rules
|
|
|
454
488
|
so Claude Code never reads your secret files" (Claude Code user Read deny
|
|
455
489
|
rules), "Keep this computer awake while it works" (export-scoped macOS wake
|
|
456
490
|
prevention) and "Install the background service" (a launchd or systemd user
|
|
457
|
-
service). Connect
|
|
491
|
+
service). Connect, run and next read them as `optIns` from device-authenticated
|
|
458
492
|
`GET /api/business/executors/self`, with keys `installPermissions`,
|
|
459
493
|
`awakeConsent` and `installService`; the CLI prints only the sentences. Only
|
|
460
494
|
`true` enables an option. Undecided (`null`) options are listed with a browser
|
|
461
495
|
link; an older server without this route (it answers 403 or 404) leaves all
|
|
462
|
-
options undecided.
|
|
496
|
+
options undecided. Connect never has to run again after the owner decides:
|
|
497
|
+
`rer business run` (at every check-in) and `rer business next` read the choices
|
|
498
|
+
again, apply each one that changed (a `false` removes what an earlier `true`
|
|
499
|
+
added) and print which choices they applied. A choice this session cannot apply,
|
|
500
|
+
such as Claude Code rules in `~/.claude` from inside an agent sandbox, is named
|
|
501
|
+
with its cause and tried again at the next check-in. The first
|
|
463
502
|
device-authenticated request happens after both the credential and local
|
|
464
503
|
pairing state are stored, so a storage failure cannot activate the computer.
|
|
465
504
|
A service installed with `RER_BUSINESS_STATE_DIR` set keeps that folder. Background
|
|
@@ -475,16 +514,35 @@ run outside the sandbox (in Codex, approve running that command outside the
|
|
|
475
514
|
sandbox when it asks); later commands
|
|
476
515
|
only read the credential and run inside the sandbox. Do not install a
|
|
477
516
|
background service or change user settings unless the owner enables those
|
|
478
|
-
options and the sandbox permits their locations.
|
|
517
|
+
options and the sandbox permits their locations. Inside that sandbox macOS also
|
|
518
|
+
refuses to remove the Keychain item (`security` exits 161 and leaves it), so
|
|
519
|
+
`disconnect` revokes on the server, exits 0, says "revoked on the server; the
|
|
520
|
+
local credential is still stored" and names the one command that removes it when
|
|
521
|
+
run outside the sandbox; until then `status` says revoked, never paired.
|
|
479
522
|
|
|
480
523
|
`rer business vendor-key add sentry` requires hidden credential entry in a
|
|
481
524
|
terminal, stores it in the OS keychain and prints only `sentry:read`.
|
|
482
525
|
`remove` deletes it. The same commands support `uptimerobot`, `pagerduty` and
|
|
483
|
-
`calendly`.
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
526
|
+
`calendly`. Sorry's export reads its public status page and needs no key. Never
|
|
527
|
+
put a key in command arguments, chat or a URL.
|
|
528
|
+
|
|
529
|
+
`rer business next` returns, within 60 seconds, one locally templated
|
|
530
|
+
classification, owner link or agent step, or says what `run` would start, and
|
|
531
|
+
says `Nothing yet` only when no agent step waits. Once an app is claimed and its
|
|
532
|
+
import door is on, its `export.vendor` task is the agent's step, and so are a
|
|
533
|
+
move's `catchup.vendor` (bringing over what changed in the old tool) and
|
|
534
|
+
`switchoff.archive` (the final archive before switch-off): next names the step,
|
|
535
|
+
the owner-typed `rer business vendor-key add <vendor>` (or says the key is
|
|
536
|
+
already stored, or that the vendor needs none) and `rer business run`. Run reads
|
|
537
|
+
the adapter's non-secret inputs from the leased task's `export_inputs` (Sentry's
|
|
538
|
+
organization and window, PagerDuty's window and `schedules: 'all'` (every rota
|
|
539
|
+
moves), Sorry's page host); a task that does not carry them yet is handed
|
|
540
|
+
back as paused until Business has them. A move's owner steps (`freeze.vendor`,
|
|
541
|
+
a `rollback.*` card, `switchoff.cancel`) are named as the owner's, with the
|
|
542
|
+
move's page (`/business/:id/moves/:toolId` when the summary names its
|
|
543
|
+
`tool_id`, else the switch-over board `/business/:id`), never as agent work. It
|
|
544
|
+
never reflects server instructions or raw evidence. Owner items cannot be
|
|
545
|
+
answered from this CLI.
|
|
488
546
|
`rer business answer ID VENDOR uses|sells|both|product-dependency [CONFIDENCE]`
|
|
489
547
|
submits a task-scoped classification through MCP. Choose a vendor ID from the
|
|
490
548
|
question's displayed answer schema, or `none`; the suggested vendor can be
|
|
@@ -501,7 +559,12 @@ device through device-authenticated `DELETE /api/business/executors/self` before
|
|
|
501
559
|
removing its service, device and vendor credentials, state and introduced Claude
|
|
502
560
|
rules, preserving preexisting settings and unrelated edits. It says "Device
|
|
503
561
|
revoked" only after the server confirms (`{"revoked":true}`, or 401 for a device
|
|
504
|
-
already revoked).
|
|
562
|
+
already revoked). If this session may not remove the credential, a key, the
|
|
563
|
+
service or the rules after the server revoked the computer, disconnect still
|
|
564
|
+
exits 0: it names what is left and the one command (with
|
|
565
|
+
`RER_BUSINESS_STATE_DIR` when set) that finishes outside the agent sandbox, and
|
|
566
|
+
keeps only that record, so `status` and every other command say revoked. A
|
|
567
|
+
server without that route (403 or 404) leaves the computer
|
|
505
568
|
connected: disconnect says so, names the browser page to revoke it in and keeps
|
|
506
569
|
everything for a later disconnect. Any other failure exits 1 and also keeps the
|
|
507
570
|
credential for a retry. With no stored device credential, nothing is sent and
|
|
@@ -513,25 +576,68 @@ completion checks. Only the browser consent's paths are scanned. Names-only
|
|
|
513
576
|
snapshots and page boundaries are saved privately so a killed supervisor can
|
|
514
577
|
resume from its server checkpoint without rescanning a changed tree. Snapshots
|
|
515
578
|
are removed after completion. A missing snapshot for an acknowledged page is
|
|
516
|
-
an explicit error. Revocation stops the supervisor on its next 401
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
The
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
579
|
+
an explicit error. Revocation stops the supervisor on its next 401; it then
|
|
580
|
+
removes the device credential if it may and `status` says revoked. While it
|
|
581
|
+
waits, `run` says what for: the owner's permission to scan the folder connect
|
|
582
|
+
ran in (with the Your tools link) until this computer's scan is done, then the
|
|
583
|
+
owner's next step. It removes `run.lock` on every exit, including Ctrl-C,
|
|
584
|
+
SIGTERM and a closed terminal (SIGHUP); a lock whose process is gone, or that
|
|
585
|
+
has not been refreshed for two minutes, is cleared on the next start.
|
|
586
|
+
|
|
587
|
+
`rer business run` also performs claimed `export.vendor` tasks into the app's
|
|
588
|
+
import door. The claim's grant names the door (`/api/rer/import/uploads` on the
|
|
589
|
+
app's HTTPS origin) and `import_grants`; every door request asks
|
|
590
|
+
`POST /api/business/tasks/:taskId/import-grants` for its own short-lived
|
|
591
|
+
RER-signed grant (`uploads` or `plan`; apply is the server's alone after the
|
|
592
|
+
owner's wave approval), and the first grant's namespace names the vendor. The
|
|
593
|
+
read-only vendor key is read from OS credential storage, never from arguments,
|
|
594
|
+
the environment or a file. The shipped adapter runs into a private 0600
|
|
595
|
+
`export-<id>.bundle` file in the state folder, each item checked by the outbound
|
|
596
|
+
detector; the bundle is sent in 64 KiB chunks, then planned, which leaves a
|
|
597
|
+
zero-write preview in the door. Run then completes the task with outputs
|
|
598
|
+
`{upload_id, plan_id, bundle_sha256}` (identifiers only); Business reads that
|
|
599
|
+
plan from the door with its own grants and completes the task only if it is the
|
|
600
|
+
plan of exactly that bundle. Run prints only counts and removes the bundle on
|
|
601
|
+
every exit. Without the key, run
|
|
602
|
+
releases the task as `paused` after an `owner_required` event and names the
|
|
603
|
+
owner's command; a running supervisor picks the export up once the key is
|
|
604
|
+
stored. A door that is not ready releases it as `paused` after a
|
|
605
|
+
`connected_runner_required` event, naming the reason. UptimeRobot needs no
|
|
606
|
+
other input. Sentry, PagerDuty and Sorry use the leased task's `export_inputs`;
|
|
607
|
+
when those inputs are missing they release as `paused` after a
|
|
608
|
+
`configuration_required` event. Calendly's folder of files has no single-bundle
|
|
609
|
+
door format yet and releases with the same event. While an agent step waits (an export, or a
|
|
610
|
+
question for `next`, or the lease an earlier run on this computer still holds),
|
|
611
|
+
run says what it waits for instead of `Nothing yet`; otherwise it names a move's
|
|
612
|
+
owner step with its link before `Nothing yet`.
|
|
613
|
+
|
|
614
|
+
`rer business run` performs claimed `catchup.vendor` and `switchoff.archive`
|
|
615
|
+
tasks the same way: the claim's grant names the door, the key comes from OS
|
|
616
|
+
credential storage, and the shipped adapter's bundle goes up in 64 KiB chunks,
|
|
617
|
+
each with its own grant, from a private 0600 file removed on every exit.
|
|
618
|
+
|
|
619
|
+
- A catch-up then plans the upload with `{uploadId, catchup: true}`. Business
|
|
620
|
+
mints its plan grant under the owner's standing catch-up approval when one
|
|
621
|
+
covers the tool, and says so with `catchup: "bounded"` on the grant. If the
|
|
622
|
+
door refuses that with `catchup_requires_proposal:<reason>` (gone, conflicting
|
|
623
|
+
or rejected records, or a change of 5% or more), run asks
|
|
624
|
+
`import-grants` for `{action: "plan", review: true}` and plans the same upload
|
|
625
|
+
again for the owner's review. Run completes with
|
|
626
|
+
`{upload_id, plan_id, bundle_sha256}`; Business applies a bounded plan under
|
|
627
|
+
the standing approval and any other only after the owner approves it.
|
|
628
|
+
- An archive calls the door's `archive` action with `{uploadId, tool, takenAt}`
|
|
629
|
+
(the tool is the vendor's namespace), then `restore-check` with the
|
|
630
|
+
`archiveId`, and requires both answers to carry the bundle's SHA-256 and size,
|
|
631
|
+
the key `business-archive/<tool>/<takenAt>` and the same counts. Run completes
|
|
632
|
+
with `{archive_id, bundle_sha256}`; Business runs its own `restore-check`
|
|
633
|
+
before the task is done. Archive grants are `uploads`, `archive` and
|
|
634
|
+
`restore-check`; catch-up grants are `uploads`, `plan` and `status`.
|
|
635
|
+
|
|
636
|
+
Run prints only counts and the archive key. When an owner summary is supplied,
|
|
637
|
+
the CLI displays its browser link and refuses to answer it.
|
|
638
|
+
|
|
639
|
+
The five deterministic adapter implementations and their native output formats
|
|
640
|
+
are described in [the adapter guide](https://github.com/runeditrun/base/blob/main/cli/business/vendors/README.md).
|
|
535
641
|
|
|
536
642
|
## Local engineering companion
|
|
537
643
|
|
package/global/cli/command.mjs
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
// rer cli status|install|uninstall
|
|
2
|
-
const usage = 'Usage: rer cli status [--json] | rer cli install | rer cli uninstall\n';
|
|
2
|
+
const usage = 'Usage: rer cli status [--json] | rer cli install | rer cli uninstall | rer cli path\n';
|
|
3
3
|
|
|
4
4
|
export async function cliCommand(args) {
|
|
5
5
|
const [action, ...flags] = args;
|
|
6
6
|
if (!action || ['--help', '-h'].includes(action)) { process.stdout.write(usage); return 0; }
|
|
7
7
|
const allowed = action === 'status' ? ['--json'] : [];
|
|
8
8
|
const unknown = flags.find(flag => !allowed.includes(flag));
|
|
9
|
-
if (!['status', 'install', 'uninstall'].includes(action) || unknown !== undefined) { process.stderr.write(`Unsupported: rer cli ${args.join(' ')}\n${usage}`); return 2; }
|
|
9
|
+
if (!['status', 'install', 'uninstall', 'path'].includes(action) || unknown !== undefined) { process.stderr.write(`Unsupported: rer cli ${args.join(' ')}\n${usage}`); return 2; }
|
|
10
10
|
if (action === 'status') return (await import('./status.mjs')).status({ json: flags.includes('--json') });
|
|
11
|
+
if (action === 'path') {
|
|
12
|
+
const { pathAdvice } = await import('./path-link.mjs');
|
|
13
|
+
const { layout } = await import('./layout.mjs');
|
|
14
|
+
process.stdout.write((await pathAdvice(layout()) || 'rer is available in this terminal and future terminals.') + '\n');
|
|
15
|
+
return 0;
|
|
16
|
+
}
|
|
11
17
|
if (action === 'install') return (await import('./install.mjs')).install();
|
|
12
18
|
return (await import('./uninstall.mjs')).uninstall();
|
|
13
19
|
}
|
package/global/cli/install.mjs
CHANGED
|
@@ -40,12 +40,11 @@ async function writeLauncher(paths) {
|
|
|
40
40
|
await rename(temporary, paths.launcher);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
// The
|
|
44
|
-
|
|
45
|
-
// Business connect also suppresses PATH advice: it uses the launcher directly.
|
|
43
|
+
// The absolute launcher works immediately, without editing shell files.
|
|
44
|
+
const shellQuote = value => "'" + value.replaceAll("'", "'\"'\"'") + "'";
|
|
46
45
|
async function closing(paths) {
|
|
47
|
-
const
|
|
48
|
-
return
|
|
46
|
+
const notices = await pathAdvice(paths, process.env, { includeShellStep: false });
|
|
47
|
+
return (notices ? notices + '\n' : '') + (process.env.RER_INSTALL_NO_NEXT ? '' : `Next, start an app: ${shellQuote(paths.launcher)} dev <owner>/<repo>\n`);
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
export async function install({ quiet = false } = {}) {
|
package/global/cli/path-link.mjs
CHANGED
|
@@ -44,7 +44,7 @@ async function persistent(files) {
|
|
|
44
44
|
|
|
45
45
|
// Empty when `rer` already runs this launcher in this terminal and new ones.
|
|
46
46
|
// Otherwise the advice ends with the exact line to run.
|
|
47
|
-
export async function pathAdvice(paths, env = process.env) {
|
|
47
|
+
export async function pathAdvice(paths, env = process.env, { includeShellStep = true } = {}) {
|
|
48
48
|
const entries = [...new Set((env.PATH ?? '').split(delimiter).filter(Boolean).map(entry => resolve(entry)))];
|
|
49
49
|
const bin = resolve(paths.bin), lines = [];
|
|
50
50
|
let firstCommand;
|
|
@@ -58,10 +58,11 @@ export async function pathAdvice(paths, env = process.env) {
|
|
|
58
58
|
lines.push(`Left existing rer at ${candidate} unchanged.`);
|
|
59
59
|
} catch (error) { if (!['ENOENT', 'EACCES', 'ENOTDIR'].includes(error.code)) throw error; }
|
|
60
60
|
}
|
|
61
|
+
if (!includeShellStep) return lines.join('\n');
|
|
61
62
|
const startup = await shellStartup(paths.home, env);
|
|
62
63
|
const first = entries.includes(bin) && firstCommand === paths.launcher;
|
|
63
64
|
if (first && await persistent(startup.files)) return lines.join('\n');
|
|
64
65
|
const why = first ? 'New terminals will not find rer yet.' : firstCommand ? `Another rer (${firstCommand}) comes first on your PATH.` : 'rer is not on your PATH yet.';
|
|
65
|
-
lines.push(
|
|
66
|
+
lines.push(`Optional: make rer available in future terminals. ${why} Running the following line adds ~/.local/bin to your shell's startup file and this terminal. rer changes no shell file itself:`, ` ${startup.line}`);
|
|
66
67
|
return lines.join('\n');
|
|
67
68
|
}
|
|
@@ -4,8 +4,7 @@ import { join } from 'node:path';
|
|
|
4
4
|
import { parse } from '../../cli/parse.mjs';
|
|
5
5
|
import { shellQuote } from '../../cli/node-runtime-cache.mjs';
|
|
6
6
|
import { install } from './install.mjs';
|
|
7
|
-
import {
|
|
8
|
-
import { pathAdvice } from './path-link.mjs';
|
|
7
|
+
import { showBudget } from '../../cli/run-transfers.mjs';
|
|
9
8
|
import { checkoutRepository, runCommand } from './repository.mjs';
|
|
10
9
|
import { ownRoot } from '../package-info.mjs';
|
|
11
10
|
import { prepare } from '../launch/prepare.mjs';
|
|
@@ -14,17 +13,14 @@ import { launchDirectory } from '../launch/state.mjs';
|
|
|
14
13
|
export async function repoCommand(request) {
|
|
15
14
|
const { verb, directory, args } = request;
|
|
16
15
|
parse([verb, ...args]); // Refuse invalid options before installation or cloning.
|
|
17
|
-
|
|
16
|
+
showBudget(args);
|
|
18
17
|
const installed = await install({ quiet: true });
|
|
19
18
|
if (installed !== 0) return installed;
|
|
20
19
|
await checkoutRepository(request);
|
|
21
20
|
const root = await realpath(request.root);
|
|
22
|
-
if (launcher.state === 'absent') {
|
|
23
|
-
const advice = await pathAdvice(paths);
|
|
24
|
-
if (advice) process.stderr.write(advice + '\n');
|
|
25
|
-
}
|
|
26
21
|
const next = command => `cd ${shellQuote(directory)} && rer ${command}`;
|
|
27
22
|
if (verb === 'setup') {
|
|
23
|
+
await (await import('../../cli/business/carry.mjs')).refreshCheckout(root);
|
|
28
24
|
const state = await launchDirectory(root), children = new Set(), controller = new AbortController();
|
|
29
25
|
const log = createWriteStream(join(state, 'launch.log'), { flags: 'a', mode: 0o600 });
|
|
30
26
|
const handlers = new Map(['SIGINT', 'SIGTERM'].map(signal => [signal, () => { controller.abort(); for (const child of children) child.kill(signal); }]));
|
package/global/door/command.mjs
CHANGED
|
@@ -19,6 +19,8 @@ The front door serves every registered checkout at http://NAME.localhost:PORT
|
|
|
19
19
|
from one process on one port. A checkout starts on its first visit in a browser
|
|
20
20
|
and stops when idle. It is opt-in for this computer.
|
|
21
21
|
|
|
22
|
+
rer door clauses (--write | --check) [--cwd DIR]
|
|
23
|
+
Sync Base agent requirements into a seed contract, preserving judgments.
|
|
22
24
|
rer door enable [--port N] [--server-limit N] [--idle-timeout S]
|
|
23
25
|
Opt this computer in, record the policy and start the door.
|
|
24
26
|
Defaults: port 8700, 10 servers, 43200 s (12 hours) idle.
|
|
@@ -247,7 +249,7 @@ export async function doorCommand(args, env = process.env) {
|
|
|
247
249
|
const [verb, ...rest] = args;
|
|
248
250
|
if (!verb || ['--help', '-h', 'help'].includes(verb) || rest.includes('--help')) { process.stdout.write(doorHelp); return 0; }
|
|
249
251
|
const verbs = { enable, disable, add, remove, status, start: (_, e) => start(e), stop: (_, e) => stop(e), restart: (_, e) => restart(e) };
|
|
250
|
-
if (!verbs
|
|
252
|
+
if (!Object.hasOwn(verbs, verb)) { err(`Unknown rer door command: ${verb}. Run rer door --help.`); return 2; }
|
|
251
253
|
if (['start', 'stop', 'restart'].includes(verb) && rest.length) { err(`rer door ${verb} takes no arguments.`); return 2; }
|
|
252
254
|
try { return await verbs[verb](rest, env); }
|
|
253
255
|
catch (error) { if (error instanceof DoorFailure || error.exitCode) { err(error.message); return error.exitCode ?? 1; } throw error; }
|
package/global/launch/dev.mjs
CHANGED
|
@@ -17,6 +17,11 @@ import { LaunchFailure } from './failure.mjs';
|
|
|
17
17
|
import { describeCheckout } from './facts.mjs';
|
|
18
18
|
import { prepare } from './prepare.mjs';
|
|
19
19
|
import { printer } from './render.mjs';
|
|
20
|
+
import { access } from 'node:fs/promises';
|
|
21
|
+
import { layout } from '../cli/layout.mjs';
|
|
22
|
+
import { pathAdvice } from '../cli/path-link.mjs';
|
|
23
|
+
import { shellQuote } from '../../cli/node-runtime-cache.mjs';
|
|
24
|
+
import { showBudget } from '../../cli/run-transfers.mjs';
|
|
20
25
|
import { stopLaunch } from './stop.mjs';
|
|
21
26
|
import { launchDirectory, liveWorker } from './state.mjs';
|
|
22
27
|
|
|
@@ -41,8 +46,13 @@ export async function launchDev(target) {
|
|
|
41
46
|
try { return await stopLaunch(target, devArgs, { checkout, directory }); }
|
|
42
47
|
catch (failure) { if (!(failure instanceof LaunchFailure)) throw failure; process.stderr.write(failure.message + '\n'); return failure.exitCode; }
|
|
43
48
|
}
|
|
49
|
+
showBudget(devArgs);
|
|
50
|
+
// The launch never asks for shell edits. Offer the optional step only at ready.
|
|
51
|
+
delete process.env.RER_LAUNCH_PATH_STEP;
|
|
52
|
+
const paths = layout();
|
|
53
|
+
if (await access(paths.launcher).then(() => true, () => false) && await pathAdvice(paths)) process.env.RER_LAUNCH_PATH_STEP = `Optional, after opening your app: make rer available in future terminals. Run ${shellQuote(paths.launcher)} cli path to see the shell step; it changes no shell file itself.`;
|
|
44
54
|
const here = await realpath(process.cwd()).catch(() => undefined);
|
|
45
|
-
const out = printer({ json: devArgs.includes('--json'), stopHint: `rer dev --stop${here === checkout ? '' : ` --cwd ${JSON.stringify(checkout)}`}`, keyless: doorStart });
|
|
55
|
+
const out = printer({ root: checkout, json: devArgs.includes('--json'), stopHint: `rer dev --stop${here === checkout ? '' : ` --cwd ${JSON.stringify(checkout)}`}`, keyless: doorStart });
|
|
46
56
|
const detach = args.includes('--detach') || (!args.includes('--foreground') && !process.stdout.isTTY);
|
|
47
57
|
return detach ? detached(target, devArgs, directory, out, doorStart) : foreground(target, devArgs, directory, out, doorStart);
|
|
48
58
|
}
|
|
@@ -116,7 +126,7 @@ async function follow(directory, token, out, { worker, quiet = false }) {
|
|
|
116
126
|
const event = JSON.parse(line);
|
|
117
127
|
if (event.event === 'phase') out.phase(event);
|
|
118
128
|
else if (event.event === 'redirect') return event.token ? follow(directory, event.token, out, { quiet }) : missing(directory);
|
|
119
|
-
else if (event.event === 'ready') { if (!quiet) out.ready(event.ready, event); return 0; }
|
|
129
|
+
else if (event.event === 'ready') { if (!quiet) await out.ready(event.ready, event); return 0; }
|
|
120
130
|
else if (event.event === 'failed') { out.failure(new LaunchFailure(event.exitCode, event.message, event.error)); return event.exitCode; }
|
|
121
131
|
}
|
|
122
132
|
continue;
|
package/global/launch/facts.mjs
CHANGED
|
@@ -76,8 +76,8 @@ export async function portTaken(port) {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
// The first port from 8787 (RER_DEV_PORT_FROM moves the start), among the next
|
|
79
|
-
// `searchCandidates` ports, that is not `held`
|
|
80
|
-
//
|
|
79
|
+
// `searchCandidates` ports, that is not `held` by a live server or launch
|
|
80
|
+
// owner, nothing listens on, binds on both
|
|
81
81
|
// 127.0.0.1 and ::1 (a browser that tries ::1 first never reaches another
|
|
82
82
|
// server) and that `claim` secures against another launch choosing it at the
|
|
83
83
|
// same time. The search is bounded by that count, never by time or load.
|