fix: read the repository-docs index by header name, not by column count - #46
Merged
Merged
Conversation
SessionStart failed with `repository-document index contains an invalid row` on an index this hook had written itself. The reader required 6-8 cells and a backticked path cell, so any index written by an earlier version of this hook was unreadable, and a session that cannot read the index loses its routing context. Reproduced against a live sibling repository: its index has four columns (no Status) and unquoted paths, and it failed outright. The reader now locates columns by the header names (Class, Source, Phases, Exists, Status) instead of by position, so every shape this repository has written parses: four columns without a status, seven with a check date (TaskFlow 1.0.8 and earlier), and the current five. A path cell may or may not be backticked, and a status may be capitalized or contain a space. Two things stay enforced. A row whose status cell holds a date is still rejected, because that means the row shifted and carrying the date over is how a malformed index would be laundered into the rendered one. With no header to read the shape from, the positional fallback still rejects a date-shaped path. The path cell is no longer shape-checked as a status once the header has named the columns: a one-word path such as `LICENSE` is indistinguishable from a status by shape, and rejecting it would drop a real document. hooks/smoke-test gains seven assertions over the shapes above, and the suite was mutated once (old strict rules restored) to confirm they fail. Also archives 2026-09-20-windows-git-path and marks TF-20260920-9f3c07 done: its plan and PRD were already completed and its PR merged, but the task was never archived, so the Todo entry still described outstanding work. Verified: bash hooks/smoke-test ALL SMOKE PASSED; git diff --check clean; all four repositories on this machine (Mimir, cc-switch, Survival, TaskFlow) read their index successfully.
hkwuks
added a commit
that referenced
this pull request
Sep 22, 2026
PR #48 merged: complete + archive TF-20260921-337ab8 into achieved/. Close three unpromoted entries whose work already landed elsewhere: - TF-20260921-4d8ae2 — repository-docs reader fix merged in PR #46 - TF-20260919-76e7fb — release-flow exception merged in PR #42 - TF-20260919-2877ca — same delivery as 76e7fb task remove records each ID in ## Removed with the reason. Todo metadata only; no hook or skill changes.
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.
Summary
Fix the
SessionStart:resumefailurerepository-document index contains an invalid row— reported on resume, and reproduced against this hook's own output.The reader required 6–8 cells and a backticked path cell, so any index written by an earlier TaskFlow version was unreadable. That is the compatibility problem: the writer and the reader disagreed about a file the writer itself produces, and the failure lands in SessionStart, where it silently costs the session its entire repository routing context (the hook error is non-blocking, so it shows one line and lets you keep working).
Reproduced from a live sibling repository on this machine: its index has four columns (no
Status) and unquoted paths, and it failed outright.Changes
hooks/repository-docs-context— locate columns by the header names (Class,Source/Source path,Phases,Exists,Status) instead of by position. Every shape this repository has written now parses:Status, unquoted pathLast checkeddateA path cell may or may not be backticked, and a status may be capitalized or contain a space.
Two things stay enforced. A row whose status cell holds a date is still rejected: that means the row shifted, and carrying the date over is how a malformed index would be laundered into the rendered one. With no header to read the shape from, the positional fallback still rejects a date-shaped path.
One judgement call worth flagging for review: once the header has named the columns, the path cell is no longer shape-checked as a status. A one-word path such as
LICENSEis indistinguishable from a status by shape, and the first version of this patch rejected it — dropping a real repository document. The header is what makes the cell's meaning known, so the heuristic is not needed there.hooks/smoke-test— seven assertions over the shapes above (four readable shapes, optional backticks, a tolerant status, and a shifted row still rejected). Mutated once — the old strict rules restored — to confirm they fail.Archive
2026-09-20-windows-git-pathand markTF-20260920-9f3c07done. Its plan and PRD were alreadycompletedand its PR (#45) merged, but the task was never archived, so the Todo entry still readComplete PRD / Spec / Plan and request approval.TaskFlow traceability
TaskFlowDocs/achieved/2026-09-20-windows-git-path/(archived here); the reader fix is tracked byTF-20260921-4d8ae2, whose entry records the root cause and the workaroundhooks/repository-docs-context,hooks/smoke-test,TaskFlowDocs/todo.md, and the archive movemainhkwuks/TaskFlow(origin)Verification
bash hooks/smoke-test— ALL SMOKE PASSEDgit diff --check— cleanbash -nclean on both changed hooks; the affected hook is fully covered by the smoke suite; no skill or manifest file is touched, so no Skill validation is applicablehooks/task completeBeyond the suite: all four repositories on this machine (
Mimir,cc-switch,Survival,TaskFlow) read theirindex.mdsuccessfully.Review boundaries
origin(hkwuks/TaskFlow), targetingmainKnown limitations
TF-20260921-4d8ae2stays open ininbox; this PR implements its fix but does not promote or close it.