Repository navigation
chore: remove dead code, fix dream archive status, and update docs - #181
Closed
parlakisik wants to merge 3 commits into
Closed
parlakisik wants to merge 3 commits into
parlakisik wants to merge 3 commits into
Conversation
Remove functions that the shipped ctx and ctxctl binaries never reach (deadcode, intersected across darwin/linux/windows), after validating each candidate against specs, open tasks, and test-seam usage. Removed: - internal/cli/initialize/core/vscode and internal/write/vscode: never wired into ctx init; .vscode/mcp.json ships via setup copilot/cline. - dream: SourceStatusKnown, DecisionKnown, errDream.ReadSource and the vocabulary constants only they used. - pad: blob.Contains, parse.FormatEntries (superseded by FormatEntriesWithIDs), store.EnsureGitignore (superseded by project.EnsureGitignoreEntries). - rc.ArchiveAfterDays getter; the .ctxrc field stays for compatibility and is now documented as inert. - journal/parser find/registeredTools and hooks/messages helpers moved into test files. Kept on purpose: hub cluster-mode scaffold (tasks H-02/H-13/H-14), disclosure invariant checks, closeout Write, dream.Backup, ParseFile, the kb writer stack, and test seams. Docs updated: package doc.go files, docs/ configuration and CLI reference, regenerated site pages, ctxrc schema, .context notes. Signed-off-by: Murat Parlakisik <parlakisik@gmail.com>
gosec G703 (golangci-lint 2.14) flags paths built from os.Getenv as tainted. Add withTempProjectAndHome, which returns the temporary $CODEX_HOME it sets, and seed fixtures from that t.TempDir path instead of reading the environment back. Signed-off-by: Murat Parlakisik <parlakisik@gmail.com>
specs/ctx-dream.md requires per-source status to track dispositions (active | archived | promoted | merged), but nothing ever wrote anything except "active". Accepting or amending to an archive action moved the idea into ideas/done/ while its state.json record stayed "active". After the ledger append, mark the archived source's record as SourceArchived. Sources with no saved record are left untouched. Signed-off-by: Murat Parlakisik <parlakisik@gmail.com>
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
A dead-code sweep over the root module and
tools/ctxctl, plus two fixes it surfaced.How candidates were found:
golang.org/x/tools/cmd/deadcodeover./... ./tools/ctxctl/..., with and without-test, intersected across GOOS darwin/linux/windows. 49 functions came up that the shipped binaries never reach (the kb writer stack was excluded on purpose). Each candidate was checked againstspecs/,.context/TASKS.md, git history, and whether it serves as a test seam. Anything uncertain was kept.1.
chore: remove dead code and update docsinternal/cli/initialize/core/vscodeandinternal/write/vscode.ctx initnever called them;.vscode/mcp.jsonships throughctx setup copilotand cline. The text keys andconfig/vscodeconstants only they used are also gone.SourceStatusKnown,DecisionKnown,errDream.ReadSource, and the constants only they used.blob.Contains;parse.FormatEntries, replaced earlier byFormatEntriesWithIDs; andstore.EnsureGitignore, replaced byproject.EnsureGitignoreEntries.rc.ArchiveAfterDays()getter. The.ctxrcfield stays so existing configs still parse, and it is now documented as inert (docs, schema,.ctxrc.dev)._test.go:parser.find,parser.registeredTools, and the hooks registry helpers.Write(kb pipeline spec)dream.Backup(backup-before-mutate in the spec)ParseFilerc.Reset,SetSink,SetDirForTest,testctx.Declare, and similar)doc.gofiles,docs/configuration and CLI reference,.contextnotes. The threesite/pages were regenerated with the pinned zensical 0.0.51; unrelated generator churn was reverted.2.
test(codex): stop deriving paths from env in deploy testsgolangci-lint 2.14's gosec G703 flags
os.Getenv-derived paths indeploy_test.go; this already fails onmainwith 2.14.withTempProjectAndHomenow returns the temp$CODEX_HOME, so fixtures use at.TempDirpath.3.
fix(dream): record archived status in state.json on archivespecs/ctx-dream.mdrequires per-sourcestatusto track dispositions, but onlyactivewas ever written. An archive moved the idea intoideas/done/whilestate.jsonstill saidactive. The archived source's record now becomesarchived. Covered by the new testTestAcceptArchiveMarksSourceArchived.Test plan
go build/go veton./... ./tools/ctxctl/...(Go 1.27.1)go test ./... ./tools/ctxctl/...: all packages pass, includingTestNoDeadExports