docs(core): mark the three archived STATE literals as deliberate - #2887
docs(core): mark the three archived STATE literals as deliberate#2887gsxdsm wants to merge 1 commit into
Conversation
Three of the eleven `'archived'` SQL literals from #2839 are correct as literals and must NOT be widened to the resolved archived columns. Recording that at the sites, because I re-investigated this question three times across as many turns and each pass started from scratch. workflow-definitions.ts migrateActiveArchivedTasksToArchiveDbImpl (archive-DB migration) workflow-definitions.ts agent-log pruning (inactive-task log cleanup) async-maintenance.ts orphan sweep (deleted-or-archived rows) All three search the LIVE table for rows Fusion's own archive path stamped — archive-lifecycle-2.ts and serialization.ts both hardcode `column: "archived"`. A workflow may ALSO declare an archived-trait lane under any id (`resolveLifecycleColumns` resolves it, and a card can be moved there, both verified), but such a card was never archived by Fusion: it has no archive-store row, it is live work, and resolving the set here would migrate it out of the board, sweep it as an orphan, or delete its agent logs. That is the opposite conclusion from the eight live-VIEW exclusions sharing the same literal, where the resolved set is probably right — which is exactly why the question kept reading as unanswerable while treated as one decision. Comments only; no behaviour change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 28 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryAdds FNXC comments documenting why three archive-maintenance queries intentionally use the literal Confidence Score: 5/5The PR appears safe to merge because it changes comments only, and the documented archive-state distinction agrees with the relevant lifecycle behavior. The added comments accurately explain that Fusion’s archive paths stamp the literal
|
| Filename | Overview |
|---|---|
| packages/core/src/task-store/async-maintenance.ts | Documents why the asynchronous orphan/log-file sweep must select Fusion-archived rows by the literal state marker. |
| packages/core/src/task-store/workflow-definitions.ts | Documents the same invariant for archived-row migration and synchronous agent-log pruning. |
Reviews (1): Last reviewed commit: "docs(core): mark the three archived STAT..." | Re-trigger Greptile
|
Superseded by #2942 ( Your commits were cherry-picked in original order with authorship preserved and applied clean — nothing was rewritten or dropped. The batch is five commits across five files, comment and markdown only, verified with scoped checks ( Closing here so the queue drops; the content ships in #2942. |
…one (#2942) ## Family batch — replaces #2926, #2892, #2887 Per the consolidation directive: the u9/e2e **docs family**, folded into one branch and one CI run. Three PRs, five commits, **five files, comment and markdown only**. | folded PR | commits | |---|---| | #2892 `docs/union-vs-per-task` | the project union and the per-task answer are not ranked; date correction | | #2926 `docs/date-my-measured-claims` | date the measured claims (one was wrong); date the grep-vs-AST measurement in the SQL gate header | | #2887 `docs/archived-state-literals` | mark the three archived STATE literals as deliberate | Cherry-picked in original order with authorship preserved; all five applied clean, no conflicts. ## Scope is provably comment-only ``` docs/solutions/workflow-learnings/lifecycle-conversions-that-score-as-wins.md docs/solutions/workflow-learnings/project-union-versus-per-task-lanes.md packages/core/src/task-store/async-maintenance.ts ← FNXC DELIBERATE-LITERAL annotation packages/core/src/task-store/workflow-definitions.ts ← FNXC DELIBERATE-LITERAL annotation scripts/check-sql-column-literals.mjs ← header prose only ``` Every added line in `packages/` and `scripts/` is inside a comment — checked by filtering the diff for declarations, conditionals and returns, which returns nothing. The two core files gain `DELIBERATE-LITERAL` markers explaining that `'archived'` is a **state** marker there, not a lane: the sweep collects rows Fusion itself archived or soft-deleted, so widening to the resolved archived set would pull live cards into a cleanup pass. ## Verification (scoped, per the directive — not the full suite) - `pnpm lint` — clean - `check-sql-column-literals` — exit 0 (the file it annotates) - `check:lifecycle-columns` — exit 0 (the markers it adds are census-visible) - `sync-workflow-ir-callsite-allowlist.test.ts` — 3/3 ## A correction worth recording Mid-fold I saw a changeset, `self-healing.ts` and a test file in `git diff origin/main..HEAD` and nearly reported the batch as impure. They were **main's own commits** — `origin/main` advanced between branch creation and the diff, so the comparison was against a stale base. Rebasing onto current `main` reduced it to the five files above. Worth flagging for anyone else folding a family today: with `main` moving this fast, diff the branch **after** rebasing or the file list will lie to you. ## Closing the originals #2926, #2892 and #2887 are superseded by this and are being closed. I hold no PRs of my own in this family — all mine merged — so this fold is on behalf of the family rather than a rollup of my own work. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comments only, no behaviour change. Records a conclusion I re-derived three times across as many turns, each pass starting from scratch — which is the actual cost this fixes.
The three sites
workflow-definitions.ts—migrateActiveArchivedTasksToArchiveDbImplworkflow-definitions.ts— agent-log pruningasync-maintenance.ts— orphan sweepAll three search the live table for rows Fusion's own archive path stamped —
archive-lifecycle-2.tsandserialization.tsboth hardcodecolumn: "archived".Why the literal is correct here
A workflow may also declare an archived-trait lane under any id. Both halves of that are verified, not assumed:
resolveLifecycleColumns(ir).archivedresolves to the custom id, andmoveTaskinto such a lane succeeds (probes on #2839).But a card sitting there was never archived by Fusion. It has no archive-store row and it is live work. Resolving the set at these three sites would migrate it out of the board, sweep it as an orphan, or delete its agent logs — so the "conversion" would be data loss, not a fix.
Why this kept looking unanswerable
The other eight
'archived'literals are live-VIEW exclusions where the resolved set is probably right. Treated as one decision, every answer was wrong for half the sites. Split by intent, three are settled and eight have a clear, narrower question — see #2839.I have deliberately not touched the eight:
reads.ts:522sits behind anincludeArchivedflag andliveParentFiltergates lineage checks on destructive archive operations, so widening those changes what counts as live for deletion-adjacent logic. That failure mode is data loss rather than a wrong number, and it wants an owner's eye.Verification
tsc -p packages/core0 · lint 0. (The SQL gate is red onmainpending #2878, unrelated to this change and unaffected by it — comments are not AST nodes.)🤖 Generated with Claude Code