Repository navigation
Description
Lane
babysit (safe tier, /loop 15m /source-control:babysit-prs)
Triggering example
PR #469 (fix/420-retro-resolve-memory-dir): worker fixed a Codex P2 in plugins/session-flow/skills/retro/context/session.md — a hand-rolled sed-extract-then-strip-whitespace snippet for reading memory_dir out of .claude/topic-docs.yaml was collapsing interior whitespace in quoted values (".agent work" → .agentwork), not just trimming. Fixed with a trailing-only trim.
The fix immediately re-triggered a Codex re-review that found a second, same-class bug in the identical snippet: a # inside a quoted value is also mishandled (the hand-rolled parser has no comment-vs-value disambiguation). The worker correctly declined to patch this in place — because the exact same hand-rolled sed/bash parsing shape is copy-pasted, not shared, across at minimum:
plugins/session-flow/skills/retro/context/session.md(this PR)plugins/claude-memory/skills/audit/scripts/orphan-rule-check.sh(sibling PR fix(claude-memory): resolve memory_dir from topic-docs seam in orphan-rule-check #470)plugins/docs-hygiene/skills/audit-noise/scripts/lib/noise-shapes.sh(cited in claude-memory: orphan-rule-check hardcodes .work/ exclusion instead of resolving memory_dir from topic-docs seam #419 as the "fleet precedent" others should copy)- a session-flow handoff
structure.mdsnippet
Fixing the whitespace bug in one copy does not fix it in the other three; each will independently surface the same class of Codex finding (whitespace-in-value, hash-in-value, and likely YAML escape sequences) on its own PR, one at a time.
Observed vs expected
- Observed:
#419and#420(already filed, both open) treat this as "some consumers hardcode.work/instead of resolvingmemory_dir" and point atnoise-shapes.shas the correct fleet precedent to copy. That framing undersells the actual gap: even the cited "correct" precedent is itself a hand-rolled, not-fully-robust scalar parser (doesn't yet handle#-in-value; likely doesn't handle YAML escapes either), and it is copy-pasted rather than shared, so any robustness fix made in response to one PR's Codex review never reaches the sibling copies. - Expected: a single shared helper (bash function or small script) that resolves a
.claude/topic-docs.yamlkey robustly — handling quoted/unquoted values, interior whitespace,#inside quotes, and YAML escapes — sourced or invoked identically everywhere memory_dir/contract_dir is read, so a robustness fix lands once and propagates.#419/#420are the right first step (stop hardcoding.work/); this issue is the follow-on it doesn't yet cover (stop copy-pasting the parser itself).
Category
improvement
Note
Related to but distinct from #419 and #420 — those are "hardcoded default vs resolved value" bugs; this is "the resolution snippet itself is duplicated and insufficiently robust." Not filing as a duplicate; commenting cross-reference isn't appropriate since neither existing issue's acceptance criteria would cover extracting a shared helper.
Activity
kyle-sexton commentedon Jul 19, 2026
Triage → needs-human (cross-plugin design). This is the SSOT-promotion trigger that the #419 plan explicitly deferred to ("if a third consumer needs the same resolution → promote a shared
topic-docsmemory_dirresolver"). It's genuinely distinct from #419/#420 (those are "hardcoded.work/vs resolved value"; this is "the resolver snippet itself is duplicated and insufficiently robust").The load-bearing design question is a cache-isolation constraint: each plugin is installed into its own isolated cache dir, so a plugin cannot simply
sourcea sibling plugin's helper file — a "single shared helper sourced everywhere" acrossclaude-memory/session-flow/docs-hygieneis not trivially feasible as stated. Options a human must weigh: (a) each plugin vendors an identical robust helper kept in sync via the marketplace sync path, (b) a tiny robust parser is inlined but generated from one source, (c) accept per-copy divergence. Plus the robustness scope (quoted/unquoted values, interior whitespace,#-in-value, YAML escape sequences — Codex is finding these one class at a time, PR by PR).Note the interaction: the #419 plan currently inlines the sed-extract mirroring
noise-shapes.sh— but this issue observes that precedent itself mishandles#-in-value. If the shared-helper direction is chosen, #419's inline approach should adopt the robust helper rather than copy the flawed precedent. Priority: medium (cross-cutting refactor; spans non-north-star plugins, though session-flow is affected).kyle-sexton commentedon Jul 19, 2026
Gap-hunt input (control tower 7/19): recommend WIDENING this issue rather than filing a sibling — signal mining found the seam-resolution duplication class extends beyond memory_dir/contract_dir parsing to tracker-seam resolution and fallback logic (#482 #470 #469 #432 #365 #369 share the root). One shared seam-resolver helper in lib/ with fixture tests covers the class; per-file parsing fixes leave the generator in place.
kyle-sexton commentedon Jul 19, 2026
This was generated by AI (needs-human decision-brief pass).
Decision brief (2-minute read)
Problem. The
memory_dir/contract_dirresolution snippet (sed-extract + strip of.claude/topic-docs.yaml) is hand-rolled and copy-pasted across ≥4 files rather than shared, so each robustness fix (interior-whitespace,#-in-quoted-value, YAML escapes) lands in one copy while the siblings keep surfacing the same class of Codex finding one PR at a time.Today. The duplication is real and the design question is already half-answered. #482 (OPEN,
status: ready,priority: high) ratifies extracting a singleparse-concern-valuehelper for the two hotmemory_dirsites (retroHANDOFF_DIR+ audit orphan-rule-check), homed upstream in the shared-contract distribution and sync-materialized into each plugin binding — which directly answers this issue's cache-isolation constraint (plugins cannotsourcea sibling's helper; vendor-via-sync instead of hand-copy, per the point-don't-copy discipline). What #482 does not cover: the other consumers this issue names (docs-hygienenoise-shapes.sh, the session-flow handoffstructure.mdsnippet), and the gap-hunt comment's proposed widening to the whole tracker-seam-resolution class (#470 #469 #432 #365 #369).Options.
memory_dir/contract_dirconsumers. claude-memory + session-flow: memory_dir seam parsing residuals — '#' truncation in quoted values, absent-config save-point fallback #482 lands the helper for the two hot sites first; this issue tracks pointingdocs-hygiene/ session-flow-handoff at the same synced helper so no copy keeps its own strip. Bounded, additive, reversible; the mechanism is already ratified, so this is extension, not new design. Leaves the broad tracker-seam-resolution refactor explicitly out.docs-hygiene/ session-flow copies free to re-fork the flaw.Cross-links. #482 (ready — the first materialization of the shared helper; its mechanism answers this issue's cache-isolation constraint). #419 / #420 (source issues — hardcoded
.workvs resolved value, the narrower predecessor).Decision asked: Bounded-widen (extend #482's synced helper to the remaining memory_dir consumers), full-class-widen (one seam-resolver for the whole class), or close as subsumed by #482?
kyle-sexton commentedon Jul 19, 2026
Operator decision (2026-07-19, decision-session final batch; relayed).
ACCEPTED — the brief's RECOMMENDED bounded widen: fold the remaining verified hand-rolled copies (docs-hygiene, session-flow) into #482's ratified
parse-concern-valuehelper adoption; the wider tracker-seam parsing class stays a separate audit task (its five cited files were not independently re-verified — the audit verifies before it sweeps).Re-intake: removing
needs-human, addingpriority: needs-triagefor routing.kyle-sexton commentedon Jul 20, 2026
This was generated by AI during triage.
Routing
status: readyper ratified decision. Operator ACCEPTED the bounded-widen: fold the remaining verified hand-rolled copies (docs-hygiene, session-flow handoffstructure.md) into #482's already-ratifiedparse-concern-valuehelper adoption (upstream-owned, sync-materialized into each plugin binding). The broader tracker-seam-resolution class (#470 #469 #432 #365 #369) stays a separate, independently-verified audit task — not folded here.kyle-sexton commentedon Jul 20, 2026
This was generated by AI during implementation intake.
Parked — dependency block on #482 (needs operator decision on PR packaging)
Picked this up to implement. The ratified scope is "fold the remaining verified hand-rolled copies (docs-hygiene, session-flow-handoff) into #482's
parse-concern-valuehelper adoption" — but #482 is unstarted: no branch, no PR, and grep confirms no shared helper exists in the tree yet. There is nothing to wire consumers to. This is a dependency block, not an unresolved-contract block — the contract is fully specified (repo-root SSOT + sync-materialized copy per thelib/hook-utils.sh/scripts/sync-hook-utils.shprecedent; plugins are cache-isolated and cannotsourcea sibling, so vendor-via-sync is the established mechanism).What the investigation found (sharpens the decision)
plugins/claude-memory/skills/audit/scripts/orphan-rule-check.sh(L62-68) — claude-memory + session-flow: memory_dir seam parsing residuals — '#' truncation in quoted values, absent-config save-point fallback #482's site (#-in-quoted-value truncation)plugins/session-flow/skills/retro/context/session.md(L51-57) — claude-memory + session-flow: memory_dir seam parsing residuals — '#' truncation in quoted values, absent-config save-point fallback #482's site (same#bug)plugins/docs-hygiene/skills/audit-noise/scripts/lib/noise-shapes.sh(L22-32) — the only copy unique to claude-memory/session-flow/docs-hygiene: memory_dir/contract_dir config-value parsing is hand-rolled and copy-pasted across ≥4 files, not a shared helper #474; worst of the three:val="${val//[[:space:]]/}"collapses interior whitespace,${val%%#*}truncates on#, and no quote-stripping at all.plugins/session-flow/skills/handoff/context/structure.md(L116) is a placeholder, not a parser copy:MEMORY_ROOT=.work # the concern file's memory_dir when set — resolve it first. It points at the documented "Where handoffs live" procedure; likely a one-line doc note, not a rewire.So #474's unique actionable surface once the helper exists is tiny (
noise-shapes.sh+ a doc note). No open PR currently touches claude-memory / session-flow / docs-hygiene.Decision asked — PR packaging (does not change the ratified bounded-widen scope)
blocked-byclaude-memory + session-flow: memory_dir seam parsing residuals — '#' truncation in quoted values, absent-config save-point fallback #482. claude-memory/session-flow/docs-hygiene: memory_dir/contract_dir config-value parsing is hand-rolled and copy-pasted across ≥4 files, not a shared helper #474 then becomes a ~2-file rewire once the synced helper lands. Pick this if you want claude-memory + session-flow: memory_dir seam parsing residuals — '#' truncation in quoted values, absent-config save-point fallback #482's hot#-truncation fix landing independently/faster.noise-shapes.sh+ the doc note don't warrant a tracked follow-on.Discriminator: does landing #482's hot fix on its own (→ 2) outweigh a single atomic contract review (→ 1)?
I'm positioned to execute either #482 or the collapsed PR immediately this session (sites + sync mechanism already mapped) if redirected — not starting unprompted. No code WIP; nothing pushed.
fix(claude-memory,session-flow): quote-aware topic-docs seam parser v…
kyle-sexton commentedon Jul 21, 2026
Tower decision (overnight delegation 2026-07-21, veto window open): the parked PR-packaging question is resolved by events — #482 already landed via merged PR #756, so the "collapse into one atomic PR" option is moot; the split path is the only coherent one. Applying the operator's ratified bounded-widen ruling (2026-07-19T23:26Z): remaining scope is exactly (1) wire
plugins/docs-hygiene/skills/audit-noise/scripts/lib/noise-shapes.sh(L24-26, last hand-rolled copy) to the landedparse-concern-value.shhelper via the ratified upstream-SSOT/sync pattern, and (2) replace thestructure.mdL116 placeholder note with a pointer to the helper. The tracker-seam class (#470/#469/#432/#365/#369) stays OUT per the operator's explicit exclusion. Flipping tostatus: ready; tower worker claiming next.This was generated by AI (control tower, session 6).
kyle-sexton commentedon Jul 21, 2026
Claimed by tower overnight worker
fix(docs-hygiene,session-flow): wire remaining memory_dir consumers t…