knowledge: 7 insights — lock owner id inherited by a spawned session (1 new page, 6 project-specific plan-gap drops) - #212
Open
choiyounggi wants to merge 1 commit into
Open
choiyounggi wants to merge 1 commit into
choiyounggi wants to merge 1 commit into
Conversation
…pawned session (1 new page); 6 project-specific plan-gap drops
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 — 7 insight(s) claimed: 1 ingested, 6 dropped
Run id (inherited from
hooks/auto-flush.sh):20260917-224552-43083. Claimed ids:dbedb1f0f153ea80,a0f287cdc70eac92,4b3490c5bb95a48a,62e2909c3f9f7f5e,e5b99a9fc624776f,bf8a6eee857f7808,5306e2de6142b95e.Verified best-practice
1.
dbedb1f0f153ea80— inherited lock owner id in a spawned session → ingested,confidence: verifiedClaim. When a session is spawned by a hook/parent that already holds a
run-id-keyed single-flight lock, acquire under the id exported in the
environment rather than a freshly generated one; when an acquire reports
heldseconds after session start, compare the holder id with the inherited env before
concluding a foreign run is live.
Sources checked (fetched 2026-09-18):
lock()"will return immediately if the current thread already owns the lock" — re-entrancy is defined by identity equality with the recorded owner.--jobserver-auth=; "Only the last instance is relevant" — a documented case of a parent handing a coordination token to children through the environment.Reproduction (this session, 2026-09-17 22:46 KST):
flush-lock.sh acquireunder a freshly generated
RUNID=flush-20260917-224603-43624→held 20260917-224552-43083 11s, exit 3.env | grep DEV_LOOPshowedDEV_LOOP_FLUSH_RUN_ID=20260917-224552-43083exported byauto-flush.sh(lines 77–79: acquire,
export DEV_LOOP_FLUSH_RUN_ID, spawn). Re-runningacquire under the inherited id →
already-owned 20260917-224552-43083, exit 0.flush-lock.shlines 76–86 implement the re-entrant branch by comparing theowner-file id to
$DEV_LOOP_FLUSH_RUN_ID. Matches the candidate's own evidencefrom the 17:16 run (
held 20260917-171642-20541 19s→already-owned).Both the official semantics (ownership = identity match; inheritance via env /
open file description) and a two-way local reproduction (known-bad: fresh id →
held; known-good: inherited id → already-owned) confirm the directive →
verified.2–7. Plan-gap rows from
dev-loop-cockle→ dropped (project-specific)a0f287cdc70eac92(t7-usage README tree line + log.md entry)dev-loop4b3490c5bb95a48a(t9 fail-open sentence identical in three skills)62e2909c3f9f7f5e(t9 wiki-ingest dedupe viawiki_search)e5b99a9fc624776f(t9neardupsubparser spec)git ls-tree origin/mainfinds noscripts/wiki-index.py, and the cockle worktree'sscripts/has none either; the generic kernel (dot product on L2-normalised vectors = cosine) is textbook, and the threshold sources say "calibrate", which yields no page-grade directivebf8a6eee857f7808(t9 README subsection)5306e2de6142b95e(t9 combined log.md line)Existing-layer check
Pages read: backend-common-concurrency-distributed-locks, infrastructure-agent-orchestration-shared-run-state, backend-common-jobs-scheduled-job-overlap, testing-data-test-data-and-isolation, databases-selection-vector-search-engine-selection
Also read:
INDEX.md,wiki/infrastructure/index.md(agent-orchestration section, rows 15–26),AGENTS.mdlines 90–116,templates/page.md.Search evidence (whole
wiki/, untruncated):grep -rniE 're-?entran|inherited (run|owner|id|env)|RUN_ID|owner id|holder id|already-owned|lock owner|lockfile|lock file|flock'→ 46 lines, all in: dependency lockfiles (supply-chain, image-builds, uv),flock -nfor cron overlap (scheduled-job-overlap, background-services),ReentrantLockvssynchronized(java threads-and-memory), and theLO_RUN_IDenv-leak test incident (test-data-and-isolation). None covers a spawned session inheriting a lock owner id.grep -rliE 'cosine|embedding|near-?dup'→ 5 files, all datastore selection — no near-dup page (moot after the drop).distributed-locks(owner token, atomic release-if-mine) is the parent concept and is linked, not merged into — its trigger is multi-instance services, not a spawned child session; adding a re-entrancy section there would violate one-case-per-page.shared-run-statecovers "a repo that may already have a run" (foreign-run detection) — the new page is the complement: the holder that is not foreign.scheduled-job-overlapdocumentsflock -n— the new page's flock edge case links back.test-data-and-isolationholds theLO_RUN_IDenv-inheritance incident — same mechanism, opposite direction (env leaking into tests vs. env intentionally carrying the owner id).wiki/infrastructure/agent-orchestration/inherited-lock-ownership-in-a-spawned-session.md(69 body lines).node scripts/wiki-lint-prohibitions.js→directives: 75, compliant: 75, violations: 0(the 1 info item is pre-existing in keys-ahead-of-their-consumer). Vague-qualifier grep on the new page → none. All 4related:ids resolve to exactly oneid:line each.Open-PR check
gh pr list --repo choiyounggi/dev-loop --state open --search "head:knowledge/"→ 17 open heads: #210 (…-171731), #209 (…-160110), #208 (…-150057), #207 (…-135945), #205 (…-100145), #191, #190, #189, #188, #187, #186, #185, #183, #182, #181, #180, #179.Every head fetched;
git diff origin/main origin/<head> -- wiki/grepped for added lines matchingre-?entran|inherited (run|owner|id|env)|RUN_ID|owner id|holder id|already-owned|foreign holder|near-?dup|cosine|embedding: 16 heads → 0 hits; #209 → 3 hits, all "embedding store" ininput-manifest-freshness-with-skipped-inputs(derived-index freshness — unrelated). Page names across all heads matchinglock|env|inherit|spawn|parent|child|dedup|similar|vector|hookwere also inspected: #189'stesting-quality-proving-a-critical-section-is-lock-protected(testing a mutex-guarded increment — unrelated) and #208'senvironment-config.mdchange (arelated:link only).dbedb1f0f153ea80inherited lock owner ida0f287…,4b3490…,62e290…,e5b99a…,bf8a6e…,5306e2…Routing decision
dbedb1f0f153ea80infrastructure/agent-orchestration/inherited-lock-ownership-in-a-spawned-session(new page)agent-orchestrationcategory already holds the sibling cases (shared-run-state,session-completion-gates,worktree-isolated-workers).backend/common/concurrencywas rejected because its pages are about service instances contending for a resource, not a parent/child pair sharing one identity. No new category needed.INDEX.mdinfrastructure route line andwiki/infrastructure/index.mdupdated;log.mdentry appended.dev-loop-cockle