Repository navigation
Closed
Labels
Description
Overview
Implement ADR-087's single participation rule: an archived node takes part in nothing, and every surface asks one governance check instead of comparing lifecycle_status itself.
Problem Statement
lifecycle_status is compared ad hoc in many places, with different results per surface:
- the store and service layers:
packages/core/src/db/sqlite_store/nodes.rs,packages/core/src/services/node_service/mod.rsandcrud.rs; - the play engine:
packages/core/src/playbook/engine.rs,cron_runner.rs,actions.rs,graph_resolver.rs; - the daemon and the CLI.
The surfaces disagree:
- Semantic search filters archived results after searching (
packages/core/src/ops/search_ops.rs), but archived nodes keep their vectors. - The
@picker doesn't filter them (Keep archived nodes out of the @ mention picker #3428 is the interim fix). - Cron scans and action queries skip archived targets; event-triggered rules haven't been audited.
- The
@picker's type exclusions are a literal list (collection,schema,ai-chat) that misses subtypes.
Proposed Solution
- A governance module in core that owns participation:
- a Rust predicate for in-memory decisions;
- one SQL fragment for queries;
include_archivedas the only opt-in, for reads by id and a future unarchive surface.
- Replace every
lifecycle_statuscomparison with the predicate or the fragment. This covers semantic and keyword search, default queries and counts, lists (sidebar, type views, collection members, query nodes), the@picker, workspace context, agent tool reads, and the play engine, both for plays and for triggers and targets. - Per-type participation rules recorded in the registry: embedded, mentionable, excluded from default queries. They follow the
extendschain and replace the@picker's literal list. - Archiving removes a node's vectors; unarchiving re-embeds it.
- A test fails if code outside the governance module reads
lifecycle_status(allow-list the module and the envelope/serialization code).
Architecture Impact
Implements decisions/087-lifecycle-status-is-governance-and-one-participation-rule.md §1, §2, §4 and §6 (nodespace-docs). The play-specific part (enabled, suspension) is a separate issue that calls this check.
Acceptance Criteria
- One participation predicate and SQL fragment exist; every surface listed above uses them (tests per surface: an archived node is absent; with
include_archivedit is present) - A test fails on any
lifecycle_statusread outside the governance module - Archiving a node deletes its embeddings; unarchiving re-embeds it (test)
- The
@picker and default queries use the registry's mentionable / default-query rules, which followextends(test with a subtype) - An archived play doesn't run, and no rule fires on or acts on an archived node, for event, scheduled and action paths (tests)
- Follows
development/node-type-sequence.md;node-types.mdparticipation section updated in the same PR -
bun run test:changedpasses;bun run quality:fixclean - The importer (
packages/daemon/src/services/import_service.rs, which setsroot_props["lifecycle_status"]/properties["lifecycle_status"]next to its real lifecycle update) no longer writes a strayproperties.lifecycle_statuskey; lifecycle is only ever the envelope field (test) - Plays neither read nor write
lifecycle_status(ADR-087 §5;components/participation.md):- It is removed from the fields CEL conditions can read: the core-field list in
packages/core/src/playbook/cel.rsand the context it builds,get_node_propertyinpackages/core/src/playbook/graph_resolver.rs, and the workflow-state evaluation. - The
update_nodeaction no longer accepts alifecycle_statusparam. Both write sites inpackages/core/src/playbook/actions.rsgo, and validation rejects the param. - The action queries'
lifecycle_status == "active"filters inactions.rsare replaced by the participation check. - Tests: a condition naming
lifecycle_statusfails validation; anupdate_nodeaction carrying it is rejected; archived targets are still skipped, through the check.
- It is removed from the fields CEL conditions can read: the core-field list in
- Skill and CLI guidance no longer teach
lifecycle_statusin play conditions or actions; the generatedSKILL.mddrift check passes
Technical Specifications
Reference Files
packages/core/src/db/sqlite_store/nodes.rs,packages/core/src/db/sqlite_store/search.rs,packages/core/src/db/sqlite_store/mod.rspackages/core/src/services/node_service/mod.rs,crud.rs,bulk.rs,schema.rspackages/core/src/ops/search_ops.rs,packages/core/src/ops/query_ops.rs,packages/core/src/ops/context_ops.rspackages/core/src/services/embedding_service.rspackages/core/src/playbook/engine.rs,cron_runner.rs,actions.rs,graph_resolver.rspackages/daemon/src/services/node_service.rs
Dependencies
- Add the core node type registry, shared envelope, closed schemas and extends-aware rules #3439 (registry slots for participation rules)
Related Issues
- Keep archived nodes out of the @ mention picker #3428 (interim
@picker fix)
Non-Goals
- Play
enabledand suspension (separate issue) - Any unarchive UI
Activity
Address review: correct the mention picker comment in BaseNode
Address review: correct the mention picker comment in BaseNode
Keep archived nodes out of the @ mention picker (#3459)
malibio commentedon Oct 1, 2026
Baseline on main @ 2760354 (includes #3439): Frontend: 301 test files passed, 5558 tests passed
Address review: close the binding read, govern the remaining surfaces…
Address re-review: a node's mentions leave out archived targets; the …
Make one governance check decide whether an archived node participate…
Make one governance check decide whether an archived node participate…