Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 106 additions & 43 deletions .dev-loop/INGEST_REPORT.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,116 @@
# Knowledge consolidation15 open PRs (#17–#40) → one reconciled state
# Knowledge flush11 insight(s)

The 15 open `knowledge/*` PRs (created 2026-08-04 → 2026-08-05, before the
harvest processed-store dedupe fix in #41) contained 123 file-versions of ~75
unique pages, with the same insight landing at up to 3 different paths across
up to 8 PRs. Per-PR review would re-import those duplicates, so — as with the
#6–#13 consolidation — this branch carries the reconciled end-state and the 15
PRs are closed in its favor.
Drained 9 queue files (11 candidate rows) from `~/.dev-loop/queue/`. 5 candidates
were exact duplicates of knowledge already ingested by the #42–#46 consolidation
and were retired without edits; 6 were merged into existing pages (merge-before-create
— no new pages, no new categories). Open-PR dedup check: `gh pr list --label
dev-loop:knowledge --state open` returned zero open PRs, so nothing here overlaps
an in-flight review.

## Verified best-practice

Every adopted page's sources were carried from its originating PR's flush, where
they were live-verified at flush time; no new URLs were introduced during
consolidation (checked mechanically: every `http(s)` URL in every merged page
appears in a source PR's diff; every added body line in amended pages traces to
a source PR hunk — orphan-line verification). Confidence fields were kept as the
originating flushes set them, except client-side-rate-limiting where the union
of provider-doc citations (Okta, Auth0, GitHub, OpenAI, RFC 6585) supports
`verified` for the load-bearing claims. One subagent's fabricated content (12
files matching neither main nor any PR, with invented source URLs) was detected
by the same verification and replaced with true PR content.
**1. Bats assertions as `[[ ]]` mid-test are decoration on bash 3.2 → `verified`.**
Claim: under bats on macOS system bash (3.2.57), a false `[[ ]]` that is not the
test's last command does not fail the test; `[ ]` and `grep -qF` pipelines fail at
any position. Verified this session by fresh local reproduction (Bats 1.14.0, GNU
bash 3.2.57, arm64): 4-test probe file gave `ok` for mid-test false `[[ ]]`,
`not ok` for mid-test `[ ]`, mid-test grep, and last-line `[[ ]]`. Mechanism
isolated outside bats: `bash -ec '[[ … ]]; echo survived'` exits 0 while the `[ ]`
form aborts — a pre-4.0 errexit semantic, not a bats defect. Sources:
https://tiswww.case.edu/php/chet/bash/COMPAT (bash-4.0 changed `set -e` to exit on
compound-command failure), https://bats-core.readthedocs.io/en/stable/gotchas.html
and https://www.shellcheck.net/wiki/SC2314 (the documented same-shape gotcha for
negated `!` commands: they "can never fail when used in the middle of a test").

**2. Widened scan surface turning old tests red → triage as first true positive → `field-tested`.**
Claim: when a leak/masking detector gains a previously unscanned output channel and
an existing test reddens, diff what the new surface saw against what the fixture
declares, and fix the fixture's smuggled data rather than the detector. Evidence is
the session reproduction (linkly #43: `result.bindings` widening reddened
`test_when_guard_removed_diverges`; fixture carried an undeclared `password` key;
narrowing to declared fields → 1218 green). No independent external source claims
this exact triage order, so it stays field-tested; it is consistent with the page's
existing sourced principle (change-detector tests / "the guard reddens on a genuine
S-and-C artifact means the guard is working").

**3. Worker usage-limit pause looks alive → check pane tail for the limit marker → `field-tested`.**
Claim: simultaneous quiet workers with green liveness are a usage-limit pause;
find the `You've hit your session limit · resets HH:MM` marker, then after reset
send a resume prompt ordering state-recheck → remaining DoD → completion signal.
Evidence: 2026-08-06 run, three workers paused on one reset with identical markers;
the structured resume prompt recovered all three at their exact interruption point.
Vendor docs do not document the marker string, so no external citation is possible —
kept field-tested with the context described on the page.

**4. Dispatch after `worker_done` needs a substrate-idle wait; a failed dispatch consumes the task → `field-tested`.**
Evidence: reproduced twice in the 2026-08-06 run (immediate dispatch →
`runtime_unavailable` + task consumed; dispatch after `orca terminal wait --for
tui-idle` succeeded first try). Orca is an internal tool; no external source exists.

**5. Guardrail `worktree_escape` can escalate on read-only cross-worktree access → `field-tested`.**
Evidence: two read-only commands (`awk`/`grep` over an upstream FINDINGS file,
`git status`) each raised `ask` and stopped the watch with exit 5; both approved
after review. This **conflicts** with the existing page's 1.0.0 reproduction where
reads passed — handled as a condition-dependent (rule-version) edge case, not an
overwrite (see below).

**6. `sh "$SCRIPT"` stub seam under EDR — second reproduction → enriches existing `field-tested` row.**
Directive already on the page from the #42–#43 reconciliation; this flush adds the
independent second reproduction (8 stall-handler stubs injected without any
`chmod`, bats suite 331/331 green under SentinelOne).

**Dropped as exact duplicates (no edit, retired from queue):** gate quoting-form
parsing (already `command-text-inspected-before-execution` step 8 + Instead-of row
+ field context citing the same bats tests 12–13), stderr-warnings-with-exit-0
capture incl. redirection order (already the whole of
`tool-diagnostics-without-a-failing-exit-code`), Homebrew clang `-isysroot
$(xcrun --show-sdk-path)` (already the whole of `compiler-sysroot-on-macos`, incl.
the same 69-failure repro), temp-artifact prefix counting + AST-rule enforcement +
RED-first guard (already `artifact-leakage-from-a-suite` steps 1/4/5), and
vacuously-green pre-implementation usage-error test proven by guard mutation
(already a `checks-that-cannot-pass` edge row describing the identical
unknown-subcommand/exit-1 case).

## Existing-layer check

- Merged-main near-dup scan before consolidation: pairwise Jaccard over
title + "When this applies" across all 141 merged pages → **0 flagged pairs**;
previously merged content carries no duplication.
- Cross-PR dedup during consolidation: 10 duplicate clusters collapsed to one
canonical page each (rate limiting 8→1, call-site enumeration 7→folded into
the canonical merged in #20, stderr/exit-0 diagnostics 4→1, sysroot 2→1,
env-off-switch 2→1, completion predicates 2→1, robots.txt 2→1,
harness-mediated results 2→1, leaked artifacts 2→1, orchestration category
naming unified). Three near-pairs kept distinct after trigger comparison,
with mutual `related:` links (differential setup vs interpretation; expansion
semantics vs off-switch design; import-time tactics vs level choice).
- 24 existing pages received union-merged amendments; additions already present
in main (from #16/#20) were skipped, and all non-canonical `related:` ids
were remapped to canonical page ids (post-merge broken-link scan: 0).
Read before deciding: root `INDEX.md`; domain indexes for testing, platforms,
infrastructure; and the nine candidate-overlapping pages
(`command-text-inspected-before-execution`,
`tool-diagnostics-without-a-failing-exit-code`, `compiler-sysroot-on-macos`,
`artifact-leakage-from-a-suite`, `worktree-isolated-workers`,
`tests-that-cannot-fail`, `checks-that-cannot-pass`, `guard-shape-vs-consequence`,
`control-signals-vs-primary-artifacts`, `permissions-and-exec-bits`,
`destructive-operations-on-shared-daemons`).

- **Merged, not created:** all 6 surviving insights landed as edge-case/table rows
and evidence on existing pages. No new page, no new category.
- **Conflict flagged and resolved as condition-dependent:**
`worktree-isolated-workers` states reads pass the guardrail (1.0.0 repro); the
new observation shows a rule version escalating on reads. Added as an edge row
("guardrail rules differ by version — probe one read before fanning out") and
noted in the log entry; the Do-this table was not overwritten.
- **Duplicates:** the 5 dropped candidates matched existing pages
trigger-for-trigger and directive-for-directive (the #42–#46 reconciliation had
already ingested earlier harvests of the same sessions' insights).
- **Related-links:** no new cross-links needed — every edited page already links
the pages the new rows reference (e.g. `tests-that-cannot-fail` ↔
`checks-that-cannot-pass`, `control-signals` ↔ `worktree-isolated-workers` via
the agent-orchestration index).

## Routing decision

- New categories: `infrastructure/agent-orchestration` (5 pages; unified the
competing `orchestration`/`agent-orchestration` names), `databases/data-survey`
(1), `qa/deliverables` (1). All other pages route into existing categories.
- Canonical-path decisions: rate limiting → `backend/common/reliability/`
(sits beside timeouts-and-retries; 6 of 8 variants chose it); stderr
diagnostics → `platforms/processes/` (concern spans beyond shells); leaked
artifacts → `testing/data/artifact-leakage-from-a-suite`; call-site
enumeration → the existing `backend/common/change-impact/` page.
- All 38 new pages listed in their domain indexes (nearest-index rule; backend
routes via its python sub-index for bytecode-cache-staleness); INDEX.md domain
summaries updated for infrastructure/qa/databases. Full-wiki lint: frontmatter,
ids, related-links, index coverage, size, qualifiers, staleness → 0 findings.
| Insight | Target (existing page) | Why this page |
|---------|------------------------|---------------|
| bats/bash-3.2 mid-test `[[ ]]` | `testing/quality/tests-that-cannot-fail` — new never-fails-pattern row + sources | The page owns "assertions that cannot detect a defect"; this is a shell-level instance of that exact class |
| widened-scan-surface red | `testing/quality/guard-shape-vs-consequence` — When-this-applies clause + edge row + field evidence | The page owns guard-red triage; existing edge row already covered "guard reddens on genuine S-and-C"; this adds the widened-surface trigger and fixture-diff triage |
| usage-limit worker stall | `infrastructure/agent-orchestration/control-signals-vs-primary-artifacts` — edge row + field evidence | The page owns done/alive/stalled/dead verdicts; this is a new stalled-state cause with recovery protocol |
| dispatch-after-done timing | same page — edge row | "Done signal ≠ substrate release" is precisely the page's signal-vs-artifact distinction |
| read-only guardrail escalation | `infrastructure/agent-orchestration/worktree-isolated-workers` — edge row (condition-dependent conflict) | The page owns the guardrail's read/write asymmetry; the conflicting observation must sit next to the claim it qualifies |
| EDR stub second repro | `platforms/filesystems/permissions-and-exec-bits` — evidence sentence | Directive already lives there; only evidence strengthened |

Domain hints from the queue were respected except where a page already owned the
case: the "testing"-hinted EDR-stub insight routes to platforms (the page that owns
exec-bit/EDR invocation style), and the "platforms"-hinted orchestration insights
route to infrastructure/agent-orchestration (dedicated category), consistent with
prior flushes. Index "load when" lines updated for the four pages whose routing
surface grew.
1 change: 1 addition & 0 deletions log.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ Append-only. Format: `## [YYYY-MM-DD] <ingest|revise|lint|gap|contradiction|drif
## [2026-08-06] revise | Union-merged amendments from the same 15 PRs into 24 existing pages (largest: tests-that-cannot-fail — 7 PRs: per-assertion mutation granularity, restore-mechanism-by-commit-state, suite-total-drop detection; portable-shell-scripts — 8 PRs: POSIX inline set-- reordering, ${VAR:-} vs ${VAR-} colon semantics, quote-by-what-the-text-is; test-data-and-isolation — 6 PRs: env-derived write paths, absent-variable cases, exec-bit fixtures, leak attribution; change-impact/call-site-enumeration — 8 unique additions from 7 path-variants: rename-in-place, same-type reorder, *args forwarding, two-searches-agree fallacy, codemod, coverage completion check). All non-canonical cross-page ids remapped to canonical pages; every added line traced to its source PR hunk (fabricated worker output was detected by orphan-line verification and replaced with true PR content).
## [2026-08-06] dedup | Cross-PR duplicate clusters collapsed: client-side rate limiting (8 PR versions at 3 paths → 1), call-site enumeration (7 versions at 7 paths → additions folded into the already-merged canonical page), stderr/exit-0 diagnostics (4 versions at 4 paths → 1), macOS sysroot (2→1), env-var off switch (2→1), completion predicates (2→1), robots.txt (2→1), harness-mediated results (2→1), leaked test artifacts (2→1), orchestration category naming (orchestration vs agent-orchestration → agent-orchestration). Kept distinct after trigger comparison: differential-testing vs differential-run-agreement (setup vs interpretation), unset-versus-empty-parameters vs env-var-off-switches (semantics vs design, cross-linked), import-time-side-effects vs test-level-choice edge (tactics vs level choice, cross-linked). Merged-main near-dup scan (Jaccard over title+trigger, 141 pages): 0 pairs — no duplication among previously merged content.
## [2026-08-06] ingest | Reconciled post-consolidation flush PRs #42–#43 (created against pre-#44 main). Folded unique content: platforms/filesystems/permissions-and-exec-bits (+`sh "$SCRIPT"` interpreter-invocation rows — stubs need no exec bit, avoids EDR chmod+x heuristics), platforms/shells/command-text-inspected-before-execution (+gate-AUTHOR step 8: parse all three POSIX quoting forms, expand only ~/$HOME/${HOME}; red-then-green bats evidence), testing/quality/checks-that-cannot-pass (+vacuously-green pre-implementation test row), platforms/processes/tool-diagnostics-without-a-failing-exit-code (+repeat-suppression edge, +clang reproduction source), infrastructure/ci-cd/secrets-handling (+independent credential channels row: gh token vs git SSH vs API token, git push --dry-run / author:@me probes), testing/mocking/what-to-mock (+ESM read-only-bindings DI rows, +PATH-emptied tripwire negative-proof). Dropped as duplicates of the #44 state: #42's rate-limit row (already in timeouts-and-retries + client-side-rate-limiting), #42's warning-only-diagnostics page (same trigger as tool-diagnostics-without-a-failing-exit-code), #42's leak-attribution row (already in test-data-and-isolation).
## [2026-08-06] ingest | knowledge-flush of 11 queued insights (9 queue files). Dropped 5 as exact duplicates already folded by the #42–#46 state: gate quoting-form parsing (command-text-inspected-before-execution step 8), stderr-with-exit-0 diagnostics (tool-diagnostics-without-a-failing-exit-code), macOS keg-only clang sysroot (compiler-sysroot-on-macos), artifact-prefix leak attribution + AST-rule enforcement (artifact-leakage-from-a-suite), vacuously-green pre-implementation test + mutation proof (checks-that-cannot-pass edge row). Merged 6 into existing pages, no new pages: testing/quality/tests-that-cannot-fail (+bash-3.2 mid-test `[[ ]]` never-fails row — locally reproduced this session on Bats 1.14.0/bash 3.2.57 and mechanism-isolated to pre-4.0 errexit via bash COMPAT; verified), testing/quality/guard-shape-vs-consequence (+widened-scan-surface first-true-positive edge, linkly #43 result.bindings fixture repro; field-tested), infrastructure/agent-orchestration/control-signals-vs-primary-artifacts (+usage-limit-pause stall edge with resume-prompt protocol, +dispatch-after-done tui-idle/consumed-task edge; field-tested 2026-08-06 Orca run), infrastructure/agent-orchestration/worktree-isolated-workers (+read-only-escalation guardrail-variant edge — condition-dependent conflict with the 1.0.0 read-pass reproduction, resolved as an edge row per version-dependence rather than overwriting the Do-this table; field-tested), platforms/filesystems/permissions-and-exec-bits (+second `sh "$SCRIPT"` stub reproduction, bats 331/331 without chmod). Index load-when lines updated for the four edited routed pages.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sources:
- https://man.openbsd.org/tmux
- https://code.claude.com/docs/en/hooks
- https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html
last_verified: 2026-08-05
last_verified: 2026-08-06
related: [infrastructure-agent-orchestration-shared-run-state, infrastructure-agent-orchestration-pane-delivery-confirmation, infrastructure-agent-orchestration-session-completion-gates, platforms-shells-command-text-inspected-before-execution, platforms-tools-harness-mediated-tool-results, debugging-methodology-hypothesis-testing]
---

Expand Down Expand Up @@ -67,6 +67,8 @@ progress by running a script that writes outside its worktree.
| An editor/Write tool succeeds where Bash was refused for the same path | The guardrail inspects Bash command text only, so the two channels disagree by design. Do not use the working channel to route around the rule — report it |
| Heartbeat is fresh but no commits in N intervals | Fresh heartbeat plus unchanged primary artifact is the stalled state, distinct from alive-and-progressing and from dead; handle it as its own case |
| The monitor is the only thing that can see the worker | Add the primary-artifact check to the monitor rather than trusting its verdict; a monitor with no artifact check cannot produce evidence |
| Several workers go quiet almost simultaneously: liveness checks pass, heartbeats stay fresh, diffs stop growing | Before restarting anything, search each worker's pane/terminal tail for the CLI's usage-limit marker (e.g. `You've hit your session limit · resets HH:MM`) — a usage-limit pause is idle waiting, not a crash, so every liveness probe passes. After the stated reset time, send a resume prompt that orders: re-verify state (`git status`, rerun the tests) → remaining definition-of-done → completion signal. A bare "continue" sent before the reset is consumed by the same limit message, and a resume without the state re-check makes the worker guess where it stopped |
| The next task is dispatched to the same terminal immediately after the worker's done signal and fails runtime-unavailable | The done message is the worker's report time, not the substrate's release time — the CLI is still tearing down its stop-hook chain and the previous dispatch still occupies the terminal. Wait for the substrate's own idle signal (e.g. `orca terminal wait --for tui-idle`) before dispatching; and when the failed dispatch consumed the task, create a new task from the same spec — the consumed one cannot be retried |

## Instead of

Expand All @@ -82,3 +84,4 @@ progress by running a script that writes outside its worktree.
- https://man.openbsd.org/tmux — `has-session`, `display-message` behavior and session naming
- https://code.claude.com/docs/en/hooks — hook architecture and path guardrails
- https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html — exit codes and output redirection
- Field evidence 2026-08-06 (Claude CLI workers under tmux/Orca orchestration): three workers paused simultaneously on one usage-limit reset — identical `You've hit your session limit · resets 01:10` marker in each terminal tail while every liveness check passed; a state-recheck resume prompt sent after the reset resumed all three exactly at their interrupted step (test re-run). Same run: two dispatches issued immediately after `worker_done` both failed `runtime_unavailable` and consumed their tasks; dispatches issued after a `tui-idle` wait succeeded first try
Loading
Loading