Repository navigation
Make one governance check decide whether an archived node participates anywhere - #3473
Conversation
|
Review Type: Initial Review Code Review SummaryThe design is right and the PR is a clear net improvement: one module owns the rule, the default flipped to "exclude", the opt-in is a single flag, and the push check keeps new surfaces from drifting. The SQL edits I traced are correct, What stands between this and merge is a short list of verified holes in two acceptance criteria ("plays neither read nor write Method: read-only review of Requirements Check
Code Review Findings 1. 🔴 Critical: an action binding still reads the lifecycle📁
2. 🟡 Important:
|
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: REQUEST CHANGES (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Review addressedCommits Addressed
Documented, not changed
Skipped
VerificationWith the governance rule neutralised, 24 of the 30 participation tests fail (the other six test validation and the type rule). Re-Review DecisionDecision: RE-REVIEW NEEDED Rationale: A critical finding was fixed with new code in the action path, and the fixes add behaviour (resolver filtering, the upsert guard, a wire field). |
|
Review Type: Re-Review Code Review SummaryBoth blocking findings from the initial review are fixed, and I found no new critical or important defect in the fixes. The binding read is closed at both ends (validation and the value itself), all four relationship executors now apply one rule, and the vector index is protected at the write. The merge of What remains is a short list of optional items: one consequence of the resolver filter for the shipped spec-driven gates that deserves a sentence in the docs, one sibling list surface (outgoing mentions), and missing tests for two of the fixes. Method: read-only review of Previous Review Summary
Requirements Check (issue #3443)
Code Review Findings Status of the previous findings
Nits: the skipped-action log level and stuck-turn recovery are fixed. The three skipped nits (bulk stale-marker guard, CLI literals, diagnostics counts) have sound reasons. The CLI really has no The merge of
|
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review (re-review): APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Re-review addressedAddressed
Also in this push: a merge of current Skipped
Verification
Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: The re-review approved. The changes since are one small filter in a service method with a test, a test assertion, a checker pattern tightening with tests, a one-sentence docs addition, and a clean merge of |
|
Merge queue: #3473 was taken out of the queue — it conflicts with main in: packages/core/src/db/sqlite_store/relationships.rs. Rebase onto origin/main, push, and re-run |
1 similar comment
|
Merge queue: #3473 was taken out of the queue — it conflicts with main in: packages/core/src/db/sqlite_store/relationships.rs. Rebase onto origin/main, push, and re-run |
57c40d1 to
5daada6
Compare
…s anywhere (closes #3443) Implements ADR-087 §1, §2, §4 and §6. The governance module (packages/core/src/governance.rs) is the only code that reads lifecycle_status: a Rust predicate for decisions in memory and a SQL fragment for queries, with include_archived as the only opt-in. - Queries, counts, saved queries, keyword and semantic search, the root list, collection lists and counts, backlinks, related-node lists, the @ picker, workspace context, seeds and the play engine all ask it. - Archiving a node deletes its vectors in the same transaction, on every write path; unarchiving re-queues it. An archived child leaves its root's aggregate, and an archived node is never queued or embedded. - Plays neither read nor write the lifecycle: it is gone from conditions, bindings and the update_node action, and a play naming it fails validation. No rule fires on an archived node and no action touches one. - The importer archives through the generic write and stores no lifecycle_status property. - scripts/check-lifecycle-reads.ts fails the push check, the merge gate and test:scripts on a read of the field outside the governance module. - nodespace playbook list --include-archived finds a disabled play. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
5daada6 to
06c9c77
Compare
Closes #3443.
Implements ADR-087 §1, §2, §4 and §6: an archived node participates in nothing, and one governance check decides it for every surface.
What changed
The governance module (
packages/core/src/governance.rs) is now the only code that readslifecycle_status:participates(&node)/is_visible(&node, include_archived)for decisions in memory.participates_sql(alias)/default_query_conditions(alias, include_archived)for queries, so the database applies the rule.mentionable_sql(the@picker) andin_default_queries_sql, both followingextends.Every surface asks it.
include_archived(default off) is the only opt-in:NodeQuery/NodeFiltergaininclude_archived; applied in the store's shared condition builderQueryService(no opt-in)search_ops,bm25_search_titles; the post-search filter is now a database filterCollectionServicementioned_by, mentioning containers,rel_ops@pickermentionablerule + participationquery_nodes_by_type(type, include_archived)replaces theOption<&str>status filterThe vector index. Every store statement that archives a node deletes its embeddings in the same transaction (single update, version-checked update, in-tx variants, bulk update, merge). Unarchiving re-queues the node. An archived child is left out of its root's aggregate and the root is re-queued. An archived root is never queued or embedded.
Plays neither read nor write
lifecycle_status(§5). It is gone from the CEL node map,is_core_key, the graph resolver's core fields and workflow-state evaluation.update_nodeno longer takes it. A play naming it in a condition or anupdate_nodeparam fails validation with the newLifecycleReferenceerror.The importer no longer writes a stray
properties.lifecycle_status; an archived document is created or updated archived through the generic write.SqliteStore::update_lifecycle_statusis deleted.Enforcement.
scripts/check-lifecycle-reads.tsruns in the push check, the merge gate andbun run test:scripts. Interpreting the field (comparison,match, SQL filter, lookup by name) is banned everywhere but the governance module. A plain read is allowed only in the envelope/persistence files it lists.Decisions worth a look
nodespace playbook disablenow also hides the play. It archives, as before, and an archived play is in no list, soplaybook listno longer shows it. That is the consequence ADR-087 calls out; the playenabledswitch that separates "off" from "archived" is the follow-up issue.include_archivedon the wire except search, which already had it. The opt-in exists in core for the future unarchive surface.Tests
packages/core/tests/it/participation_test.rs: 24 tests, one group per surface (absent by default, present withinclude_archived), the vector index, and the play engine's event and action paths. With the governance rule neutralised, 21 of them fail.governanceunit tests, a cron scan test, a seeding regression test, an importer test, andscripts/check-lifecycle-reads.test.ts(50 cases).bun run test:changed: every tier passed.bun run quality:fix: clean.Docs
components/participation.mdandcomponents/node-types.md§1.7 in nodespace-docs (commit460833e).Node type sequence: no type, field or relationship changed. The change is to participation rules only: the registry gains
CoreNodeType::excluded_from_default_queries(); no core type sets that rule yet.🤖 Generated with Claude Code