feat(doc): add document management (model, schema v4, renderers, CLI)#22
Open
erikreinert wants to merge 7 commits into
Open
feat(doc): add document management (model, schema v4, renderers, CLI)#22erikreinert wants to merge 7 commits into
erikreinert wants to merge 7 commits into
Conversation
Introduces the doc primitive (docs, doc_revisions, doc_comments, doc_issue_links, proposal_docs) behind a v4 migration with the defensive rewind guard. Also extends ClearAllData to include doc tables plus the previously-omitted proposals/votes/proposal_issues so `import --replace` no longer silently leaves rows behind, and tolerates missing tables for older schemas.
Add model.DocRef {id,type,title,status} and Issue.Docs (serialized in
issueJSON); db.HydrateDocs batch hydrator (no N+1) mirroring HydrateFiles;
a 'Linked Docs' section in issue show (styled + plain, omitted when empty)
and docs[] in issue show --json; docs hydration in next --json with the
human table unchanged. Reverses the one-way doc<->issue link so an agent
reading an issue discovers its design docs without a second lookup.
Includes incidental gofmt normalization of a few unrelated files.
Closes DKT-14, DKT-15.
- doc show: linked issues as rich IssueRef {id,kind,title,status} (DKT-21)
- issue show: reverse-lookup linked proposals + rich section (DKT-10)
- plan --json / issue list --json: surface per-issue files+docs (DKT-16, DKT-17)
- fix redundant HydrateFiles double-hydration in plan (DKT-16)
Refs DKT-10, DKT-16, DKT-17, DKT-21
Surface reverse-link proposal/doc references so the relationship is parseable from both ends (DKT-19 / DOC-2): - issue show --json now emits linked_proposals (id-list, proposal_id ASC, empty -> []), byte-identical to doc show (DKT-22) - vote show now emits linked_docs in JSON and a "Linked Docs" render section in both styled and plain output (DKT-23) Also includes a ListIssues sort adjustment in internal/db/issues.go.
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
Adds first-class document support to docket — a new
docentity alongside issues, with its own model, persistence, renderers, and a full set of CLI subcommands.What's included
007cc8b): newdocmodel and a v4 schema migration adding documents, doc comments, and doc links tables.6577cb0): document renderers (internal/render/doc.go) and thedoccommand scaffold.f112f53):doc create,edit,delete,list,show,comment(add/list), andlink.Changes
internal/model/—docmodel + testsinternal/db/— docs, doc comments, doc links persistence + v4 schema migration + testsinternal/render/— document renderers + testsinternal/cli/—doccommand group and subcommands24 files changed, ~4.6k insertions.
Test plan
go test ./...passes (new tests cover model, db, and render layers)docket doc create/list/show/edit/deleteround-tripdocket doc comment add/comment listdocket doc link add