knowledge: non-interactive CLI hangs, gates that read command text, editing a gated document (4 insights → 3 pages) - #11
Open
dch0202-rsquare wants to merge 2 commits into
Conversation
- platforms/processes/non-interactive-cli-invocation (new): a non-interactive flag is not a closed stdin — pair it with </dev/null, a fail-fast switch and a timeout; split a zero-output hang by whether the far side logged the request. - platforms/shells/command-text-inspected-before-execution (new): a gate reads the command as pre-expansion text, so a quoted argument defeats its extractor while an unexpanded $VAR resolves to a nonexistent path — two distinct refusals; write literal paths and create gate-read files in a prior command. - qa/document-verification/editing-a-gated-document (new category page): the author-side counterpart to spec-document gates — inventory anchors before editing, describe upstream as observed shape, scope a check outside the region quoting it, record scoped conditions instead of global counts. Sources live-verified (nohup, ssh(1)/ssh_config(5), timeout(1), pgrep(1), Claude Code hooks, POSIX 2.6, Vale scopes/existence, markdownlint MD013); regex failure modes reproduced against hooks/pre-flush-pr-gate.sh.
Required by the RTB decision-log PR gate: intent, rejected alternatives, and reviewer focus points (including the qa/index.md conflict with PR choiyounggi#10).
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 — 4 insight(s)
4 queued candidates → 3 pages (2 new platforms pages, 1 new qa page in a new
category). Two qa candidates were merged into a single page because they are the same
case seen twice; nothing was dropped.
Cross-Check: primary-source verification of every directive (man pages, official tool
docs) plus local reproduction of the two mechanism claims against this repo's own hook
source. No independent adversarial agent review was run for this flush — the
verification is documentary and reproducible, not a second opinion.
Verified best-practice
1. A non-interactive flag is not a closed stdin →
confidence: verifiedClaim. When invoking a prompt-capable CLI unattended, pass the tool's
non-interactive switch and redirect stdin from
/dev/null; a hang with zero outputis evidence about the client until the far side's log shows the request arrived.
-n"Redirects stdin from /dev/null (actually, prevents reading from stdin). This must be used when ssh is run in the background"BatchMode=yesdisables "password prompts and host key confirmation requests", "useful in scripts and other batch jobs where no user is present"Two established tools implement both halves (close stdin and a fail-fast
interaction switch) as separate mechanisms, which is exactly the candidate's directive.
The client/server split step is field-derived (a gateway access log showed zero
requests from the host during two hangs;
</dev/nullfixed it immediately) and islabelled as such in the page's Field context rather than presented as documented.
2. Command-inspecting gates read pre-expansion text →
confidence: verifiedClaim. Write values literally in an argument a gate inspects; create files a gate
reads in a prior command.
PreToolUseruns"Before a tool call executes. Can block it"; the hook's stdin JSON carries
tool_input.command, the unexecuted command string. Exit 2 blocks and "stderr textis fed back to Claude as an error message."
— word expansion is performed by the shell as it processes the line, so an external
reader of the command text sees none of it applied.
Reproduced locally against this repo's own extraction pattern
(
--body-file[= ]+[^ '"`]+,hooks/pre-flush-pr-gate.sh:56), 2026-07-30:--body-file "$REPO/…"--body-filefound"--body-file $REPO/…$REPO/…--body-file "/abs/…"--body-filefound"--body-file /abs/…/abs/…--body-file=/abs/…/abs/…This corrects the candidate, which attributed the failure to quoting alone. The run
shows two distinct failure modes with two different error messages — quotes defeat
extraction, an unexpanded variable defeats resolution — and that a quoted
literal path fails too. The page states both; the sharper form is what makes the
error message diagnostic.
3+4. Editing a document that text gates check →
confidence: field-testedClaim. Inventory a file's gate anchors before editing; describe an upstream
contract as an observed shape rather than with definition verbs; scope a check outside
the region that quotes it; record scoped conditions, not global counts.
The hazards are documented; the directives are field-derived, hence
field-testedrather than
verified:existence~is negated" and scopes chain — keeping checks off regions such as code examples is first-classcode_blocks/tables/headingsbooleans (defaulttrue) so quoted code can be excluded from a prose ruleField evidence retained in the page: a vague-word audit that matched its own quoted
pattern (1 global hit → 3 after quoting the fix, 0 under an
awk-scoped run; the sameself-reference observed 3× across two documents), and a vocabulary gate
(
(arena|pool)…(재정의|정의한다|규정한다)) that failed a true descriptive sentenceuntil it was rewritten as an observation, restoring the suite 60 → 61.
Existing-layer check
Read in full:
INDEX.md,AGENTS.md,templates/page.md,wiki/platforms/index.md,wiki/qa/index.md,wiki/platforms/processes/background-services.md,wiki/platforms/shells/portable-shell-scripts.md,log.md, plus the two in-flightpages
wiki/qa/document-verification/spec-document-gates.md(PR #10) andwiki/testing/docs-as-spec/document-conformance-checks.md(PR #9), fetched from thefork. Repo-wide greps for
grep|self-referen|lexical|doc-as-spec,stdin|/dev/null|non-interactive|tty, andPreToolUse|pre-commit|hook.Queue dedup: all 4 candidate hashes absent from
.processed.jsonl.Open-PR dedup was decisive here. PRs #6–#10 are open and unmerged, and
#7/#8/#9/#10 all sit in the doc-gate theme, so
mainalone understates coverage.Overlap verdicts:
qa-document-verification-spec-document-gates(PR #10, open)testing-docs-as-spec-document-conformance-checks(PR #9, open)testing-quality-tests-that-cannot-failqa-process-regression-scopeplatforms-processes-background-servicesnohup … & disownfor lifetime. It does not cover stdin as a blocking input or the client/server split. Kept separate (its "load when" is persistence), linked both waysplatforms-shells-portable-shell-scriptsplatforms-environment-path-resolutionConflicts flagged: one soft directive tension (quote-everything vs. write-this-one-
argument-literally), resolved inside the new page rather than by editing the old one. No
factual contradiction found.
Reciprocal
related:links added tobackground-services.mdandportable-shell-scripts.md(frontmatter only;last_verifieddeliberately not bumped,since nothing on those pages was re-verified).
Merge conflict to expect (please read before merging)
This branch and PR #10 both introduce the
## document-verificationsection inwiki/qa/index.mdat the same insertion point, each with its own page row. Whichevermerges second will conflict there. Resolution: keep one heading and both rows. To
keep the conflict to that single hunk, this branch deliberately does not touch
INDEX.md— PR #10's qa route line ("automated verification of document deliverables(spec/RFC gates)") already covers this new page. If #10 is rejected instead, the qa
route line in
wiki/qa/index.mdshould gain a document-verification clause in afollow-up. No
related:id in this branch points at #10's page, so nothing here breaksunder either outcome; once both are merged the two pages are worth cross-linking.
Routing decision
platforms/processes/non-interactive-cli-invocation.md(new page)processesalready owns process/session lifetimeplatforms/shells/command-text-inspected-before-execution.md(new page)shells, justified belowqa/document-verification/editing-a-gated-document.md(new page)document-verification, the same category PR #10 introducesInsight 1 → platforms, not debugging. Half the insight is diagnostic, but the
artifact the reader changes is the invocation command, and
AGENTS.mdroutes by ownedartifact.
debugging-methodology-reproduce-firstis linked for the isolation half.Merging into
background-serviceswas rejected: that page's case is persistence, andadding a blocking-stdin case would drift its "load when".
Insight 2 →
shells, not a new category and nottools. The mechanism is expansiontiming — when the shell rewrites the line relative to other readers of it — which is
shell semantics, so
shellsholds two coherent pages (portability; expansion timing vs.external inspectors).
toolsis BSD-vs-GNU userland differences, which this is not. Adedicated category (e.g.
policy-gates) was considered and rejected as a one-pagecategory with no second member in sight.
Insights 3+4 → one page, not two. Both are the document author's side of the
doc-gate loop: 3 is "the gate matched the pattern I quoted", 4 is "the gate matched the
verb I used / the anchor I moved".
AGENTS.mdrequires one case per page, and the sharedcase is "writing prose inside a document that lexical gates run over" — the directives
interleave (scope the check, phrase as observation, record a scoped condition, re-run the
suite), so splitting would have produced two pages that each need the other. New
category justified: the existing qa categories are
process(human release process),environments,bug-reports,exploratory— none covers automated checks over awritten deliverable. PR #10 reached the same conclusion independently, which is
corroboration rather than duplication.
Invariants checked on this branch
Body lines 83 / 82 / 93 (limit 120) · all four required sections present on each page ·
every
related:id and inline[page-id]resolves (13 checks, 0 misses) · each new pagelisted in its domain index with a multi-use-case "load when" · every index relative link
resolves · no banned vague qualifiers ·
log.mdentry appended.Decision Log
의도
"게이트가 걸린 문서를 편집하는 쪽"이라는 한 케이스라서 1페이지로 합쳤다
(
AGENTS.md"one case per page" + 지시문이 서로를 필요로 함).--body-file차단 원인은"따옴표 때문"이 아니라 따옴표=추출 실패 / 미확장 변수=경로 부재의 두 모드이고
따옴표 친 리터럴 경로도 실패한다(본문 표에 5변형 실측).
main만 보면 커버리지를 과소평가해#10과 같은 페이지를 또 만들 위험이 있었다.
INDEX.md는 의도적으로 건드리지 않았다 — #10이 이미 qa 라우트 라인을 갱신하므로충돌면을
wiki/qa/index.md한 훅으로 줄였다.배제한 대안
background-services에 병합 → 기각. 그 페이지의 케이스는 지속성이고,블로킹 stdin을 넣으면 "load when"이 흐려진다(양방향 링크로 대체).
portable-shell-scripts에 병합 → 기각. 그 페이지 규칙은 "모든 확장을따옴표로 감싸라"인데 이 건은 한 인자를 리터럴로 쓰라는 것 — 트리거도 다르고 규칙이
충돌해 보인다. 새 페이지에 "이 페이지는 인자 하나만 좁히며 다른 곳의 무따옴표 확장을
허용하지 않는다"를 명시.
policy-gates) → 기각. 두 번째 멤버가 안 보이는 1페이지카테고리. 메커니즘이 확장 타이밍이라
shells가 맞다.debugging으로 → 기각. 바꾸는 산출물이 호출 명령이므로 소유 도메인 우선규칙에 따라 platforms(진단 절반은
debugging-methodology-reproduce-first로 링크).해소법(헤딩 1개 + 행 2개)을 위에 명시했다.
--base main을 요구하고, 리뷰 diff에knowledge: spec-document gates (4 axes + controls) and non-ASCII grep matching #10 변경이 섞인다.
리뷰어가 볼 곳
wiki/qa/index.md— #10과 충돌 예정 지점. 헤딩 1개 유지 + 행 2개로 해소.wiki/qa/document-verification/editing-a-gated-document.md— #10의 페이지와중복이 아닌지(저자 측 vs 게이트 저자 측 분담)가 이 PR의 핵심 판단.
command-text-inspected-before-execution.md의 Field context 5변형 표 —hooks/pre-flush-pr-gate.sh:56패턴으로 재현 가능.verified(공식 문서+재현), 3+4는field-tested(위험은 문서화되어 있으나 지시문은 현장 유래). 1번 페이지의 클라이언트/서버 분리
단계는 문서 근거가 아니라 현장 유래라서 Field context로 분리해 표기했다.
platforms/shells에 2페이지(이식성 + 확장 타이밍)가 앞으로도 응집적으로남을 것이라는 판단은 추정이다 — 유사 사례가 더 쌓이면 별도 카테고리가 나을 수 있다.