instar 1.3.820 → 1.3.822
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/dist/config/ConfigDefaults.js +1 -1
- package/dist/config/ConfigDefaults.js.map +1 -1
- package/dist/core/CartographerSweepEngine.d.ts +3 -3
- package/dist/core/CartographerSweepEngine.d.ts.map +1 -1
- package/dist/core/CartographerSweepEngine.js +38 -5
- package/dist/core/CartographerSweepEngine.js.map +1 -1
- package/dist/core/SafeGitExecutor.d.ts +6 -0
- package/dist/core/SafeGitExecutor.d.ts.map +1 -1
- package/dist/core/SafeGitExecutor.js +33 -0
- package/dist/core/SafeGitExecutor.js.map +1 -1
- package/dist/core/cartographerDetect.d.ts +21 -2
- package/dist/core/cartographerDetect.d.ts.map +1 -1
- package/dist/core/cartographerDetect.js +86 -23
- package/dist/core/cartographerDetect.js.map +1 -1
- package/dist/core/cartographerDetect.worker.js +19 -6
- package/dist/core/cartographerDetect.worker.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +2 -2
- package/upgrades/1.3.821.md +22 -0
- package/upgrades/1.3.822.md +24 -0
- package/upgrades/eli16/cartographer-streaming-ls-tree.md +7 -0
- package/upgrades/side-effects/cartographer-streaming-ls-tree.md +80 -0
- package/upgrades/side-effects/two-node-harness-increment2-entry-gate.md +64 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Side-Effects Review — Cartographer streaming ls-tree
|
|
2
|
+
|
|
3
|
+
**Version / slug:** `cartographer-streaming-ls-tree`
|
|
4
|
+
**Date:** `2026-07-11`
|
|
5
|
+
**Author:** `instar-codey`
|
|
6
|
+
**Second-pass reviewer:** `framework_guard_review`
|
|
7
|
+
|
|
8
|
+
## Summary
|
|
9
|
+
|
|
10
|
+
The cartographer detect module replaces its buffered `git ls-tree` read with a guarded streaming child process and incremental NUL parser. `runDetect` is now asynchronous so both the default worker and the in-process rollback can await subprocess completion. No scaffold writer, index storage, heap ordering, writer ownership, or rollout setting changes.
|
|
11
|
+
|
|
12
|
+
## Decision-point inventory
|
|
13
|
+
|
|
14
|
+
- Git completion — modify — the map is accepted only on clean exit with a fully terminated NUL stream.
|
|
15
|
+
- Git failure — pass-through — every failure shape still becomes `detect-git-error` and feeds the existing breaker.
|
|
16
|
+
- `gitMaxBuffer` — pass-through — accepted and plumbed for config compatibility, intentionally ignored by the streaming reader.
|
|
17
|
+
|
|
18
|
+
## Over-block / under-block
|
|
19
|
+
|
|
20
|
+
Malformed output with an unterminated last record now refuses rather than accepting an ambiguous tail. Valid empty-tree output remains successful. The parser's carry can grow to one Git path record; the unavoidable output map remains O(tree entries) because downstream status comparison requires it, but there is no second whole-output string or split array.
|
|
21
|
+
|
|
22
|
+
## Level of abstraction
|
|
23
|
+
|
|
24
|
+
`SafeGitExecutor.readStream` extends the existing guarded Git funnel so classification, source-tree protection, environment scrubbing, and audit behavior are preserved. Incremental record parsing remains in `cartographerDetect`, the owner of ls-tree semantics. The worker boundary remains unchanged and default-on.
|
|
25
|
+
|
|
26
|
+
## Signal vs authority
|
|
27
|
+
|
|
28
|
+
No new authority is introduced. Git failure remains a named refusal signal consumed by the existing sweep breaker; partial data never reaches candidate selection.
|
|
29
|
+
|
|
30
|
+
## Judgment-point check
|
|
31
|
+
|
|
32
|
+
No new static heuristic at a competing-signals decision point. Child-process success is an enumerable protocol invariant: clean zero exit, no signal, and complete NUL framing.
|
|
33
|
+
|
|
34
|
+
## Interactions
|
|
35
|
+
|
|
36
|
+
- Ordering and shape: real-fixture parity freezes the same insertion order and OIDs as the former buffered parser.
|
|
37
|
+
- Backpressure/memory: every stdout chunk is synchronously reduced into complete records; only the current record carry remains between chunks. Stderr capture is capped at 8 KiB.
|
|
38
|
+
- Failure atomicity: the local map is returned only after `close` reports exit code zero and no signal. Mid-stream SIGKILL, non-zero exit, spawn error, and malformed tail reject it.
|
|
39
|
+
- Lifetime: the read-only stream retains the former 30-second subprocess bound and kills on expiry. On worker timeout, the parent requests cooperative child teardown, retains the reported child PID as a fallback, and force-terminates after a 250 ms grace bound.
|
|
40
|
+
- Configuration: `gitMaxBuffer` remains accepted at `ConfigDefaults`, server plumbing, engine config, and `DetectInput`; removing it would be a needless compatibility break.
|
|
41
|
+
- Scope: #1073 items 1 (scaffold writer) and 2 (SQLite/sharding) are untouched and remain open.
|
|
42
|
+
|
|
43
|
+
## External surfaces
|
|
44
|
+
|
|
45
|
+
The exported `runDetect` helper now returns a Promise; all repository call sites are updated. Runtime output, snapshot schema, candidate ordering, and persistent state are unchanged. No operator action or external API is added. Timing improves for large Git trees because stdout is reduced as it arrives.
|
|
46
|
+
|
|
47
|
+
## Operator-surface quality
|
|
48
|
+
|
|
49
|
+
No operator surface — not applicable.
|
|
50
|
+
|
|
51
|
+
## Multi-machine posture
|
|
52
|
+
|
|
53
|
+
Machine-local by design: each machine compares its own checked-out Git tree inside its own detect worker. It emits no user-facing notice, holds no new durable state, strands no topic state, and generates no URL. Existing snapshot behavior is unchanged.
|
|
54
|
+
|
|
55
|
+
## Rollback
|
|
56
|
+
|
|
57
|
+
Pure code rollback. No persistent schema or state migration is involved. Reverting restores the explicit 64 MiB buffered floor and its refusal-on-overflow behavior.
|
|
58
|
+
|
|
59
|
+
## Conclusion
|
|
60
|
+
|
|
61
|
+
The transport upgrade is contained to #1073 item 3 and preserves the existing authority, writer, worker, ordering, and configuration contracts. Independent review found the first draft had lost the buffered executor's subprocess timeout and could orphan Git when a worker was terminated; the shared timeout and explicit two-level reap protocol now close that gap.
|
|
62
|
+
|
|
63
|
+
## Second-pass review
|
|
64
|
+
|
|
65
|
+
**Reviewer:** `framework_guard_review`
|
|
66
|
+
**Independent read:** concur. The revised stream retains bounded subprocess lifetime in both in-process and worker modes; the real-worker reap proof and funnel/stream suites are green.
|
|
67
|
+
|
|
68
|
+
## Class-Closure Declaration
|
|
69
|
+
|
|
70
|
+
`defectClass: unbounded-self-action`, `closure: n/a` — one bounded kill attempt is tied to a single detect-worker timeout; this adds no autonomous retry, respawn, notification, or recurring control loop.
|
|
71
|
+
|
|
72
|
+
## Evidence
|
|
73
|
+
|
|
74
|
+
- CI correction: the no-silent-fallbacks heuristic initially counted four
|
|
75
|
+
intentional error-propagation/terminal-state catches. Each is now explicitly
|
|
76
|
+
annotated in place; the baseline remains 492 and the exact ratchet is green.
|
|
77
|
+
- Unit: chunk-edge NUL, a Unicode record split across four chunks, real-tree parity, empty tree, output beyond a one-byte legacy setting, mid-stream SIGKILL refusal, and hung-stream timeout.
|
|
78
|
+
- Funnel: read-only streaming succeeds; destructive use is rejected before spawn.
|
|
79
|
+
- Dist worker: forced timeout against a fake hung Git process proves the pass refuses and the reported OS PID is no longer alive.
|
|
80
|
+
- Existing detect refusal, bounded heap, routes, config, and dist-worker suites remain green.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Side-Effects Review — Two-Node Replication Harness (Increment-2 Entry Gate)
|
|
2
|
+
|
|
3
|
+
**Version / slug:** `two-node-harness-increment2-entry-gate`
|
|
4
|
+
**Date:** `2026-07-11`
|
|
5
|
+
**Author:** `echo (instar-dev agent)`
|
|
6
|
+
**Second-pass reviewer:** `not required (tests + test-support only; no decision point, no runtime surface)`
|
|
7
|
+
|
|
8
|
+
## Summary of the change
|
|
9
|
+
|
|
10
|
+
Implements the Increment-2 entry-gate deliverable of `docs/specs/ownership-gated-spawn-and-judgment-within-floors.md` (§4 line 242: "Entry gate: the two-node replication harness (§5) green in CI"; §5 line 261: the L7 evidence contract). Two new test files only: `tests/support/twoNodeOwnershipHarness.ts` (the reusable two-node factory — durable ownership substrate, un-stubbed signed journal-sync replication, real AgentServer per node) and `tests/e2e/duplicate-reconciliation-two-node.test.ts` (the entry-gate lifecycle + the §5 delayed-replay and partition-formed cases + three spec-anchored `it.todo` scenarios). Plus this artifact, the ELI16 companion, and an internal-only release fragment. **Zero `src/**` changes.**
|
|
11
|
+
|
|
12
|
+
## Decision-point inventory
|
|
13
|
+
|
|
14
|
+
*(none — no runtime decision point is added or modified; the harness exercises existing ones)*
|
|
15
|
+
|
|
16
|
+
## 1. Over-block
|
|
17
|
+
|
|
18
|
+
Nothing at runtime (no runtime surface). In CI: the new E2E becomes a required-passing test — a future change that breaks the two-machine heal fails CI. That is the deliverable, not a side effect: the spec makes this test THE Increment-2 entry gate.
|
|
19
|
+
|
|
20
|
+
## 2. Under-block
|
|
21
|
+
|
|
22
|
+
- The harness runs two nodes IN ONE PROCESS over loopback — partitions are modeled as WITHHELD replication (the §5 partition-formed and delayed-replay cases), not as packet loss/timeout dynamics; clock skew and cross-host filesystem differences are not modeled. The spec's §3.0 consistency contract owns those honesty bounds.
|
|
23
|
+
- The 2b custody-transfer scenario and the terminate-time-probe scenario are `it.todo` — their mechanics are deliberately NOT built in Increment 1/this PR (Increment 2b's own build); the todos carry the spec anchors so they cannot be silently forgotten.
|
|
24
|
+
- The closeout leg asserts the ARMING predicate (the peer's own view says owner-elsewhere) and simulates the close; the full sweeper-close leg lands with the `duplicate-reconciled` reap-reason extension (Increment 2).
|
|
25
|
+
|
|
26
|
+
## 3. Level-of-abstraction fit
|
|
27
|
+
|
|
28
|
+
Reuses the three existing proven patterns (journal-sync-roundtrip's replication hop, mesh-failover's two-server shape, the alive-test's real-AgentServer boot) rather than inventing a parallel harness idiom. The node factory lives in `tests/support/` alongside the existing fixture module.
|
|
29
|
+
|
|
30
|
+
## 4. Signal vs authority compliance
|
|
31
|
+
|
|
32
|
+
**Required reference:** docs/signal-vs-authority.md — Not applicable at runtime (no new detector or authority). In-CI authority (a failing test blocks merges) is the standard test-suite contract.
|
|
33
|
+
|
|
34
|
+
## 5. Interactions
|
|
35
|
+
|
|
36
|
+
- The E2E rides the existing `e2e` CI job (vitest include already covers `tests/e2e/**`) — no workflow changes, no new CI lanes.
|
|
37
|
+
- The harness binds ephemeral loopback ports (port 0) and tmpdir state — no interaction with the host agent's server, state, or config.
|
|
38
|
+
- Discovered interaction (already resolved upstream): building this harness surfaced the record-already-correct FSM refusal (claim-out-of-sequence → escalate-instead-of-heal) — fixed on the Increment-1 PR as the `record-already-converged` skip and unit-tested there; this E2E now proves that fix end-to-end.
|
|
39
|
+
|
|
40
|
+
## 6. External surfaces
|
|
41
|
+
|
|
42
|
+
None. No egress (loopback only), no persistent state outside vitest tmpdirs (SafeFsExecutor teardown), no operator surface, no agent-visible capability (hence the internal-only release-note lane).
|
|
43
|
+
|
|
44
|
+
## 6b. Operator-surface quality
|
|
45
|
+
|
|
46
|
+
No operator surface — not applicable.
|
|
47
|
+
|
|
48
|
+
## 7. Multi-machine posture (Cross-Machine Coherence)
|
|
49
|
+
|
|
50
|
+
The change IS the multi-machine test substrate. It runs no agent, replicates no store of its own, and creates no cross-machine surface; it simulates two machines inside one test process to verify the production replication contract (journal → signed envelope → applier → materialized peer view).
|
|
51
|
+
|
|
52
|
+
## 8. Rollback cost
|
|
53
|
+
|
|
54
|
+
Delete the two test files (plus docs). Nothing depends on them at runtime. The only cost of rollback is losing the Increment-2 entry gate's objective checkability.
|
|
55
|
+
|
|
56
|
+
## Rollout-ladder compliance (§4 hard prohibitions)
|
|
57
|
+
|
|
58
|
+
- NO flag flips: `ownershipGatedSpawn` / `duplicateReconciler` / `judgmentArbiters` / `commitmentCustodyTransfer` untouched; `inboundQueue` / `holdForStability` / stale-owner-release untouched (their own features' graduation decisions, per §4 "inherit-and-stall").
|
|
59
|
+
- NO `provenance.deterministicSampling` change (that is an Increment-2-ENTRY action, riding the actual enforce-flip PR).
|
|
60
|
+
- In-test enforce-mode construction of the reconciler is test construction inside a sandbox, not a rollout-ladder flip (the Increment-1 burst-invariant E2E precedent).
|
|
61
|
+
|
|
62
|
+
## Conclusion
|
|
63
|
+
|
|
64
|
+
Tests + test-support only; the risk surface is CI-time, which is the point. Clear to ship as its own PR once Increment 1 merges (it depends on the Increment-1 modules).
|