Skip to content

feat: new read modalities - #106

Merged
andy-esch merged 4 commits into
mainfrom
feat/various-read-modalities
Jul 16, 2026
Merged

feat: new read modalities#106
andy-esch merged 4 commits into
mainfrom
feat/various-read-modalities

Conversation

@andy-esch

@andy-esch andy-esch commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

A family of body-aware read/write commands across task/epic/audit, plus a lint
guard for acceptance-criteria misconfiguration. Driven by two rounds of agent
dogfooding feedback; the unifying theme is teaching the CLI that a document's
structure — sections, acceptance criteria, progress — is first-class, not an
opaque blob you can only append to.

What's in it

Metadata reads (token-cheap, no body)

  • task info / audit info (+--json) — path + triage fields + a tally
    (ac:{checked,total} for tasks; findings:{total,open,in_progress,done,dropped}
    for audits)
  • task path / epic path / audit path — just the absolute file path,
    parse-free so it still works on a file with broken frontmatter (exactly when
    you need the path to go fix it)

Section-scoped reads

  • task/epic/audit show --section <name> and --frontmatter-only — narrow a
    body to one section, or drop it, via a shared fence-aware section slicer

Acceptance-criteria writes

  • task ac — numbered --list; --check <n> / --uncheck <n> flip one criterion
    by index. Surgical (a check→uncheck round-trip restores the file byte-for-byte),
    atomic (through EditBody), idempotent (a no-op write is skipped), fence-aware

Lint guard (make misconfiguration loud, not a silent false positive)

  • lint now flags malformed acceptance checkboxes ([], [ x], …) and duplicate
    acceptance sections, so a wrong ac: tally can't be silently trusted.
    Deliberately conservative — citations [1], markers [-], and [text](url)
    links are not flagged — via a new one-pass ListTasksWithBodies scan (no
    O(N²) re-resolve)

Foundations

  • internal/domain/body.go — a pure, fence-aware body-structure model (CommonMark-ish
    fence tracking that honors fence char+length; CRLF-tolerant): Section, the
    acceptance enumerator/flip, and the lint guard
  • Shared helpers: render.fieldPrinter, narrowBody / addBodyScopeFlags
  • Wire: new task_info / audit_info / path / acceptance envelopes;
    SchemaVersion 1.26 → 1.29

Contract & tests

  • --json on every new surface with a schema_version; new envelopes validate
    against the reflected JSON Schema and are pinned in the golden machine-contract
    suite (path-bearing goldens redacted so they're portable across machines/CI)
  • Unit + integration coverage across domain / store / core / cli / render
  • just build · test · lint · docs-check · tidy-check all green

Review

Went through three rounds of external adversarial review. Fixes made along the way:
CRLF-blind heading parsing, CommonMark nested-fence tracking (a naive toggle leaked
nested content), a TTY path-truncation regression from the shared field renderer, a
golden-portability gap on Windows, and a self-inflicted lint false positive (a
"## Progress … acceptance" heading miscounted as a second acceptance section) — all
regression-tested.

Planning

Self-hosted under planning/: closes
structure-aware-body-mutation-and-metadata-reads (epic 20). Its one blocked item,
task log (append a dated progress entry), is spun off to its own task because
it needs a canonical-progress-shape decision first — not in this branch.

🤖 Generated with Claude Code

@andy-esch
andy-esch merged commit 74ee2b5 into main Jul 16, 2026
1 check passed
@andy-esch
andy-esch deleted the feat/various-read-modalities branch July 16, 2026 12:14
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