Skip to content

fix: read the repository-docs index by header name, not by column count - #46

Merged
hkwuks merged 1 commit into
mainfrom
fix/repository-docs-reader
Sep 21, 2026
Merged

hkwuks merged 1 commit into
mainfrom
fix/repository-docs-reader

Conversation

@hkwuks

@hkwuks hkwuks commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Summary

Fix the SessionStart:resume failure repository-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:

Shape Origin
4 columns, no Status, unquoted path an earlier shape, still live in a sibling repository
7 columns with a Last checked date TaskFlow 1.0.8 and earlier, and this repository until 2026-09-21
5 columns current

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: 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 LICENSE is 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-path and mark TF-20260920-9f3c07 done. Its plan and PRD were already completed and its PR (#45) merged, but the task was never archived, so the Todo entry still read Complete PRD / Spec / Plan and request approval.

TaskFlow traceability

  • Task: TaskFlowDocs/achieved/2026-09-20-windows-git-path/ (archived here); the reader fix is tracked by TF-20260921-4d8ae2, whose entry records the root cause and the workaround
  • Scope: hooks/repository-docs-context, hooks/smoke-test, TaskFlowDocs/todo.md, and the archive move
  • Base branch: main
  • Target repository: hkwuks/TaskFlow (origin)

Verification

  • bash hooks/smoke-test — ALL SMOKE PASSED
  • git diff --check — clean
  • Relevant Skill/plugin validation — bash -n clean 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 applicable
  • Results recorded in the TaskFlow Plan — the archive is recorded by hooks/task complete

Beyond the suite: all four repositories on this machine (Mimir, cc-switch, Survival, TaskFlow) read their index.md successfully.

Review boundaries

  • No secrets or opaque remote payloads included
  • No unrelated task or user files changed
  • Remote/base assumptions are stated — pushed to origin (hkwuks/TaskFlow), targeting main
  • Known limitations and follow-ups are documented below

Known limitations

  • Only the shapes actually found in the wild are covered. A shape nobody has written yet would still fail — the reader is tolerant, not omniscient, and the smoke assertions pin the shapes known today.
  • The row is still read positionally when the header is absent. That path stays strict deliberately, but it is a guess, and a headerless index with an unusual column set could be rejected.
  • TF-20260921-4d8ae2 stays open in inbox; this PR implements its fix but does not promote or close it.

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
hkwuks merged commit 2f6ae43 into main Sep 21, 2026
6 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant