Decodie — Flag Stale Mode
Fast, CI-friendly counterpart to verify mode. For every entry with a verified_sha, check whether any of its source files have changed since that SHA, and flip stale: true on entries that have. Does not read source files or recompute anchor hashes — only diffs filenames against git history.
This mode modifies .decodie/index.json only.
Activation
Takes no arguments. Always operates on the full index.
Setup
- Confirm
.decodie/exists. If not: "No.decodie/directory found — nothing to check." Stop. - Confirm git repository:
If not: "Not a git repository —git rev-parse --git-dirflag-stalerequires git history. Run verify mode instead." Stop. - Read
.decodie/index.json. If empty: "No entries to check." Stop.
Detection Process
For each entry:
- Skip entries with no
verified_sha. Report asunverified. - Skip entries with no
sources(and noreferences[].filefallback). Report asno-sources. - Compute changed files:
If the SHA is unknown to git (history rewritten), treat as stale.git diff --name-only <verified_sha>..HEAD - Compare changed files against entry's source files. If any match, the entry is stale.
- Update:
- Newly stale → set
stale: true. Leaveverified_shaunchanged. - Already stale → no change (still counted).
- No source files in diff → leave
staleas-is. Do not flip stale back to fresh — only verify mode can do that.
- Newly stale → set
Write updates back to index.json.
Reporting
Decodie flag-stale
Newly stale: N entries
Already stale: M entries
Fresh: F entries
Unverified: U entries (no verified_sha -- run verify mode)
No sources: K entries
If newly stale, list them:
Newly stale:
- entry-1711540000-a1b2 -- src/lib/foo.ts
- entry-1711540123-c3d4 -- src/lib/bar.ts, src/lib/baz.ts
Important Notes
- One-way flag. Only flips
staletotrue. Clearing requires verify mode. - No source file reads. Based purely on
git diff --name-only. This is what makes it fast enough for CI. - No exit-code policy. Whether stale entries block a PR is a per-repo decision.
- No git history rewriting. Only read-only git commands.