knowledge: 9 verified insights — new agent-orchestration category, shell/CLI gate mechanics, write-path assertions - #31
Open
choiyounggi wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Knowledge flush — 9 insight(s)
Drained
~/.dev-loop/queue/(5 session files, 9 pending rows) on 2026-08-05.Result: 9 new pages, 1 new category (
infrastructure/agent-orchestration),7 existing pages updated with reciprocal links, 1 candidate claim refuted by
measurement and corrected before ingest.
Verified best-practice
Every claim was re-tested rather than taken from the session that emitted it.
Six were reproduced locally on this machine; three rest on cited primary sources
plus a field incident.
1. A wrapped tool reports warnings on stderr and exits 0 →
verifiedClaim: a gate keyed on exit status misses warnings; capture stderr with
OUT=$(tool "$f" 2>&1 >/dev/null)and branch on emptiness — redirection orderdecides which stream you get.
Checked: POSIX XCU 2.7 ("If more than one redirection operator is specified
with a command, the order of evaluation is from beginning to end");
GCC warning options;
Claude Code hooks —
PostToolUseexitcode 2 "Shows stderr to Claude; the tool already ran".
Reproduced 2026-08-05 (Apple clang, macOS): unused-variable source → exit 0
with
warning:on stderr; clean source → exit 0, empty stderr; undeclaredidentifier → exit 1. Same run:
2>&1 >/dev/nullcapturedSTDERR-DIAG,2>/dev/null >&1capturedSTDOUT-PAYLOAD— the reversed form feeds the buildartifact back as if it were a diagnostic.
2. A
capture-panediff is not delivery evidence →verifiedClaim: check the target TUI's busy/queued indicator first; the pane changes
for a queued keystroke because the tty echoes it.
Checked: termios(3)
ECHO— "Echo input characters", independent of when the program callsread(); tmux(1).Reproduced 2026-08-05 (tmux 3.7b, macOS): sent
echo SECOND_PROMPT_MARKERto a pane running
sleep 6. Pane diff = YES, marker present once as echoedtext, command's own output line count = 0. After the sleep drained, the
command ran and the output line appeared. A pane-diff test placed first reports
"delivered" for exactly the queued case it was written to detect.
3.
--before an interpolated operand →verifiedChecked: POSIX XBD 12.2 Guideline 10 — "The first
--argument that is notan option-argument should be accepted as a delimiter indicating the end of
options. Any following arguments should be treated as operands, even if they
begin with the '-' character."
Reproduced 2026-08-05 (tmux 3.7b):
tmux send-keys -t S -l "-n hello"→command send-keys: unknown flag -n, exit 1; with-- "-n hello"→ exit 0.Generalized past tmux: this is option parsing in the callee, not shell quoting.
4. A Stop-gate's terminal set must include instructed pauses →
verifiedChecked: Claude Code hooks —
stop_hook_activeis a documented Stop-hook input; hooks exit early when it istrue, and Claude Code overrides a Stop hook after eight consecutive blocks
(
CLAUDE_CODE_STOP_HOOK_BLOCK_CAP).Reproduced in-repo at
95cf947:hooks/loop-gate.sh:55listsdone|approved|merged|failed|""as terminal, whileskills/orchestrate/templates/session-prompt.md:20instructs a plan-phaseworker to record
plan_readyand "wait for an approval message. Do NOT writeimplementation code yet."
scripts/status-update.sh:6confirmsplan_readyisa first-class phase. The gate therefore fires on a worker that obeyed its own
prompt;
loop-gate.sh:30'sstop_hook_activereturn is what bounds it.5. Worktree-isolated worker briefs →
verified, with the candidate's stated mechanism refutedCandidate claimed: the
worktree_escapeguardrail blocks reads (ls,cat) of the main checkout as well as writes.Measured 2026-08-05 against groundwork guardrails 1.0.0
hooks/bash-guard.sh(built a real repo + linked worktree and ran the hook):cat <main_root>/fls <main_root>/.orchestrationgrep -n x <main_root>/fcp ./a <main_root>/becho z > <main_root>/fThe rule (
bash-guard.sh:217-250) matches an absolute main-root mentiontogether with a write verb (
rm|mv|cp|tee|mkdir|touch|install|dd) or a redirectto an absolute path. Reads pass. The directive survives (worktree-relative
output paths; orchestrator collects) — the reason given for it did not, so the
page documents the verified write-only asymmetry and adds reads as the
sanctioned way to consume shared input. Logged as
contradictioninlog.md.6. httpx repeated form fields →
verified(source-level)Checked:
httpx/_content.py.encode_request:if data is not None and not isinstance(data, Mapping): warnings.warn("Use 'content=<...>' to upload raw bytes/text content.", DeprecationWarning); return encode_content(data)— a list of tuples is sent asraw body, with no
application/x-www-form-urlencodedheader, so the serverparses an empty form and still returns its success status.
encode_urlencoded_dataexpands alist/tuplevalue into repeated(key, item)pairs — confirmingdata={"k": ["a","b"]}is the correct form.Also httpx quickstart. httpx is not
installed on this machine, so this one is source-verified rather than re-run.
7. Client-side throttle bypassed by auth refresh →
field-testedChecked: the candidate asserted flatly that "token requests count toward the
rate limit". That is provider-specific —
Okta and
GitHub
document separate budgets for token/OAuth endpoints. The directive was therefore
narrowed: put the throttle where every outbound request passes, and read the
provider's docs for which bucket the token endpoint is in (with a documented
default when it is unstated). An Auth0 citation was dropped after fetching the
page and finding it does not support the claim.
Field evidence:
auto-trading-botcommit82a077e(
src/broker/kis_client.py) —_headers()ran_throttle()then called_get_token(), so on newly-issued-token days the token POST and the API GETlanded in the same second and the provider rejected the call; logs show
POST …:00.354→ issued…:00.495→ rejected…:00.543, and cached-token dayspassed on identical code. Confidence held at
field-tested— the mechanism isproduction-observed, not doc-derived.
8. Enumerate call sites by callee, not by parameter name →
field-testedChecked: Python tutorial 4.9.2
— a function may be called positionally or with
kwarg=value, which is exactlywhy a keyword-name grep cannot see positional callers;
Fowler, test impact analysis
for deriving reach from the change.
refactoring.com's Change FunctionDeclaration entry was fetched but returned no body text, so it is not cited.
Field evidence: a migration scoped by
grep -rn "repo_rows"returned 13hits, all keyword-style, and was reported "7 of 13"; the full suite then gave
Ran 472 tests / FAILED (failures=11), all in one file passing the value as thecallee's 4th positional argument, plus a
rows_for()helper still supplying theremoved shape to 5 more call sites.
9.
${VAR:-default}swallows an empty value →verifiedChecked: POSIX XCU 2.6.2 — "use of the in the format shall result in
a test for a parameter that is unset or null; omission of the shall
result in a test for a parameter that is only unset."
Reproduced 2026-08-05: with
V="",${V:-def}→def,${V-def}→ empty;with
Vunset, both →def. Origin case (WATCH_TMUX=failing to disable aliveness check reading
${WATCH_TMUX:-tmux}, andWATCH_TMUX=/nonexistent…working) is consistent with the spec.
Existing-layer check
Pages read in full before writing anything:
INDEX.md,AGENTS.md,templates/page.md, the domain indexes for infrastructure / testing / platforms/ backend / debugging / qa, and — as the overlap candidates —
platforms/shells/portable-shell-scripts,platforms/processes/non-interactive-cli-invocation,testing/quality/tests-that-cannot-fail,testing/quality/checks-that-cannot-pass,backend/common/reliability/timeouts-and-retries,infrastructure/config/environment-config,qa/process/regression-scope,backend/python/index.md.Merge-vs-create outcomes:
testing/quality/checks-that-cannot-pass--separatorplatforms/shells/portable-shell-scripts§5 "build argument lists safely"${VAR:-}vs${VAR-}portable-shell-scripts(edge case"${OPT:-}"),infrastructure/config/environment-config§5environment-configowns service config schemas and required-keys-get-no-default; this owns a caller trying to switch a script off. Linked both waystesting/quality/tests-that-cannot-failtests-that-cannot-fail— "HTTP test of a write endpoint asserting only the response status" — pointing at the new pagebackend/common/reliability/timeouts-and-retriesqa/process/regression-scoperegression-scopealready has the adjacent edge case "code with no test coverage and unclear callers → trace callers before scoping"; the new page is the how. Linked both waysplatforms/processes/non-interactive-cli-invocationis the nearest neighbour (invoking a prompt-capable CLI unattended) and is now linked from the pane pageConflicts flagged: one — the
worktree_escapereads-vs-writes claim (§5above), logged in
log.mdas acontradictionentry rather than silentlywritten as fact.
Reciprocal links added:
portable-shell-scripts→ all three new shellspages;
checks-that-cannot-pass→exit-status-vs-diagnostics;tests-that-cannot-fail→write-path-assertions;regression-scope→call-site-enumeration;timeouts-and-retries→client-side-rate-limiting;environment-config→env-var-off-switches;non-interactive-cli-invocation→pane-delivery-confirmation.Routing decision
platforms/shells/exit-status-vs-diagnostics.mdinfrastructure/agent-orchestration/pane-delivery-confirmation.md--before interpolated operandsplatforms/shells/option-like-argument-values.mdinfrastructure/agent-orchestration/session-completion-gates.mdinfrastructure/agent-orchestration/worktree-isolated-workers.mdtesting/quality/write-path-assertions.mdbackend/common/reliability/client-side-rate-limiting.mdqa/process/call-site-enumeration.mdplatforms/shells/env-var-off-switches.mdNew category —
infrastructure/agent-orchestration(3 pages). Justifiedbecause no existing category covers it:
ci-cdis pipeline structure,config/deploy/observabilityare service lifecycle,containersis imagesand limits, and
platforms/processesowns invoking a CLI unattended, notcoordinating a fleet of worker sessions. All three insights hinted
infrastructure, and the domain's route line +INDEX.mdwere updated so thecategory is reachable rather than orphaned. Three pages seed it at once, so it
does not land as a one-page category.
Routing calls worth a reviewer's attention:
qa, nottestingorbackend. The queue hintedtesting, but thetrigger is a signature migration, not writing tests.
qaowns regressionscoping and the Integration ring ("the contract changed — then test every
consumer of that contract, not a sample"); a function signature is a contract
and its call sites are the consumers.
backend/commonwas rejected becauseits categories are all runtime concerns and the lesson is language-agnostic
code-change methodology. Alternative home if you disagree: a new
testing/qualitypage — say so and it moves.testing/quality, notbackend/python. The artifact is test code;backend/pythonis server-side application code. The httpx mechanics ridealong as the concrete cause.
platforms/shellsrather than the new orchestration category.Both mechanisms (redirection order, POSIX option parsing) are reusable well
beyond agent harnesses, and both were reproduced with non-agent tools.
platforms/shells). Each has a distincttrigger per the one-case-per-page rule; none is a variant of another.
Verification of the wiki's own invariants
Ran a mechanical check over all 148 pages after the edits: every
related:idand inline
[page-id]reference resolves, no page exceeds 120 body lines, allnine new pages appear in their domain index with a "load when" line, all carry
When this applies/Do this/Sources, and the banned vague qualifiers areabsent (three initial hits were rewritten).
log.mdhasingest,revise, andcontradictionentries for this flush.