Skip to content

fix(KEN-3993): prepare collection replacements in one core owner - #4985

Merged
vanillagreen-fleet-lanes[bot] merged 3 commits into
mainfrom
ken-3993
Oct 14, 2026
Merged

vanillagreen-fleet-lanes[bot] merged 3 commits into
mainfrom
ken-3993

Conversation

@vanillagreen-fleet-lanes

@vanillagreen-fleet-lanes vanillagreen-fleet-lanes Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Prepare every collection member in one core owner before checking catalog minimum revisions.
  • Use the prepared manifest, installation record and reading options for one collection plan and one installation transaction.
  • Make the CLI consume that plan. Remove its separate preparation and later pin writes.
  • Use the existing core subscription announcement owner to name every subscription in the shared manifest write.
  • Pin only explicit collection members at the snapshot. Automatic skills keep their existing revision choices.

Completed issues

  • Closes KEN-3993: Collection replacement works in either repository order.

Requirements and proof

  • Compatible replacement in both orders: crates/core/tests/collections.rs installs each order through the core collection operation. crates/core/src/engine/ops/add.rs and crates/core/src/source_ops/collection.rs own the prepared inputs.
  • Retained incompatible reading refuses before writes: the same core test checks that manifest and installation-record bytes stay unchanged. Collection preparation checks all retained readings before planning.
  • CLI consumption: crates/cli/src/commands/add_collection.rs consumes the core collection plan. The core export changes expose that operation.
  • docs/architecture/sources.md records the whole-collection check. The changelog records the consumer fix.

Test plan

  • Core collection suite: 11 tests passed after the snapshot hold fix.
  • CLI collection unit suite: 2 tests passed.
  • Subscription suite: 14 tests passed after the review fix.
  • Preflight, document limits and commit guards passed.
  • The disposable base control compiled. Its driver used the base's real per-repository add operations. The first compatible-order installation failed with CatalogNeedsEngine.
  • The snapshot hold regression test also compiled on its base without driver adaptation. It failed because an automatic skill received the snapshot revision.
  • The configured validation receipt uses CI mode. Required CI passed on the restacked head. The merge queue owns its group checks.
  • Correctness review, test review, external review and correctness QA passed. The focused snapshot hold fix passed correctness, external and test review. Both compiled mutations were killed. Each clean stability run passed 10/10 at 8 threads.

Review dispositions

  • Fixed stale CLI comments, the shared subscription description and the automatic-skill snapshot hold regression.

  • Declined the request to pin human-readable preview wording in tests. The core annotation owner joins the full subscription set and keeps each note. No program parses that wording. The repository test rules forbid those wording assertions.

  • Declined the shared CLI apply-count claim. The base first step used the same post-write error path and zero-count assignment. No newly armed producer or observed review-born symptom was found.

Restack validation

  • The guarded restack resolved only docs/architecture/sources.md. It keeps main's all-scope record-settlement rule and this branch's complete-collection preparation rule.
  • The range comparison preserves every code patch. The subscription and snapshot hold patches are identical.
  • The document conflict check passed. The standing overseer ruling reuses the reviewed range receipts with that check.
  • Copilot approved the published head 3c616684c037c9edd401952219b710fe6ca47a0a. Exact-head required CI passed.

Merge decision

Exit: 75

Expected head: 3c616684c037c9edd401952219b710fe6ca47a0a

merge-route: queue cause=queue-occupied

GitHub queued the restacked head. The lane owns the queue wait. The overseer parks the lane during that wait and resumes it for close-out after merge.

@linear-code

linear-code Bot commented Oct 13, 2026

Copy link
Copy Markdown

KEN-3993

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Blocking findings affect revision ownership and reporting or registration after post-write failures.

2 open findings
What changed in this PR

Moves collection preparation and compatibility checks into core, allowing atomic, order-independent collection replacement planning.

Changes:

  • Adds a shared prepared collection plan and compatibility validation.
  • Simplifies CLI collection installation to one plan and transaction.
  • Updates subscription announcements, tests, architecture documentation, and changelog.
File Description
crates/​core/​src/​engine/​ops/​add.rs Introduces reusable prepared-addition planning.
crates/​core/​src/​engine/​ops.rs Exposes prepared additions internally.
crates/​core/​src/​source_ops/​collection.rs Prepares and plans whole collections.
crates/​core/​src/​source_ops/​subscribe.rs Supports multi-subscription announcements.
crates/​core/​src/​source_ops.rs Exports the collection preparation API.
crates/​core/​tests/​collections.rs Tests replacement order and refusal atomicity.
crates/​cli/​src/​commands/​add_collection.rs Consumes one core collection plan.
docs/​architecture/​sources.md Documents collection compatibility guarantees.
changelog.d/​fixed/​collection-replacements.md Records the consumer-facing fix.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread crates/cli/src/commands/add_collection.rs
Comment thread crates/core/src/source_ops/collection.rs Outdated
Copilot AI previously approved these changes Oct 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approved

The centralized plan preserves revision semantics and validates retained readings before any installation writes.

0 open findings

🧠 Review effort: Balanced

@vanillagreen-fleet-lanes

Copy link
Copy Markdown
Contributor Author

Completed issues

  • Closes KEN-3993: compatible collection replacement succeeds in either repository order. A retained incompatible reading refuses before collection planning or writes.

QA metrics

  • Core collection suite: 11 tests passed.
  • CLI collection suite: 2 tests passed. Subscription suite: 14 tests passed.
  • The base control compiled and refused the compatible collection with CatalogNeedsEngine.
  • The snapshot hold control compiled and failed the automatic-skill revision assertion.
  • Both mutation runs killed their compiled control. Each clean stability run passed 10/10 at 8 threads.
  • Correctness review, test review, external review and correctness QA passed.
  • Copilot approved 9074003f0f5959240fa6a0c42fe6a254f1c477e9. No unresolved review threads remain.
  • Required CI is pending. The lane owns its wait and the merge.

Recommendations processed

Fixed in PR

  • External review: corrected stale CLI comments and named all subscriptions in the shared manifest write. Commit: 9dd4c61a56b2d5028cefe9b6391ba494a0df8b5e.
  • Copilot: limited collection snapshot holds to explicit members. Automatic skills retain their revision choices. Commit: 9074003f0f5959240fa6a0c42fe6a254f1c477e9.

Skipped

  • External review: preview wording assertions conflict with the repository test rules. No program parses the wording.
  • Copilot: the shared CLI apply-count failure exists in the base. Review found no newly armed producer or observed symptom for a separate issue.

Fix rounds: 2. All accepted fixes passed review.

@vanillagreen-fleet-lanes
vanillagreen-fleet-lanes Bot added this pull request to the merge queue Oct 13, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 13, 2026
A collection checks and installs one prepared core manifest, installation record and reading selection. Its compatible replacements no longer retain historical minimum refusals while another repository plans first.

Control: a disposable copy of base 135af66 compiled the new fixture with its driver adapted only to the shipped per-step core add calls. The compatible first-order install failed at CatalogNeedsEngine. The lane test passes both orders and proves byte-identical manifest and installation record on retained-reading refusal.

Removed a_failed_step_still_names_what_it_wrote because the collection now applies one transactional plan. Its premise of an earlier collection step committing before a later step fails no longer exists.
Address PR review

The subscription announcement owner accepts the complete subscription set, describes a shared manifest write once and retains a note for each subscription. Every single-subscription caller uses the same owner. Collection comments describe one prepared plan and one transactional apply.

The change affects comments and human-readable preview text. Test assertions remain unchanged; no human wording is pinned. The subscription and CLI collection suites passed with preflight and document limits. Required merge-group CI remains pending in the bound validation receipt.
Address PR comments

Collection snapshot reading stays in the existing core preparation owner. Snapshot holds apply only to explicitly requested members; automatic skills retain their following or held revisions. Direct add --hold still holds its complete expansion.

Control: the regression test compiled against disposable base 9dd4c61 without driver adaptation. Its first collection row wrote Some(snapshot) for a following automatic skill and failed the typed assertion expecting None. The control built under its own root/tmp directory and the root was removed. The final collection suite passed, including old non-member holds, explicit skill membership and direct add --hold.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approved

The centralized preparation path is consistent with the documented behavior and has focused regression coverage.

0 open findings

🧠 Review effort: Balanced

@vanillagreen-fleet-lanes
vanillagreen-fleet-lanes Bot added this pull request to the merge queue Oct 13, 2026
Merged via the queue into main with commit 74b5234 Oct 14, 2026
38 checks passed
@vanillagreen-fleet-lanes
vanillagreen-fleet-lanes Bot deleted the ken-3993 branch October 14, 2026 00:32
@vanillagreen-fleet-lanes

Copy link
Copy Markdown
Contributor Author

Completed issues

Done when evidence

  • Box 1: the core collection test installs compatible replacements in both repository orders. The compiled base control refused with CatalogNeedsEngine.
  • Box 2: the retained incompatible-reading test refuses before collection writes. Manifest and installation-record bytes remain identical.
  • Core collection suite: 11 tests passed. CLI collection suite: 2 tests passed. Subscription suite: 14 tests passed.
  • Both compiled mutation controls failed as required. Each clean stability run passed 10/10 at 8 threads.
  • Copilot approved the published head 3c61668 in review 5510023281. Exact-head required CI passed.
  • The document-only restack kept both rules. Its conflict check and range comparison passed under the standing validation ruling.
  • No post-merge box remains. The completion command ticks boxes 1 and 2.

Recommendations processed

  • Fixed stale CLI comments and the shared subscription description in 853fc25.
  • Fixed automatic-skill snapshot holds in 3c61668. Only explicit collection members receive snapshot holds.
  • Declined preview wording assertions under the repository test rules.
  • Declined the shared CLI apply-count claim because the base already contains that error path. No new observed symptom justified a separate issue.
  • Fix rounds: 2. Correctness review, test review, external review and correctness QA passed.

Downstream handoff

  • The live issue has no blocked downstream issues. No downstream handoff comment is due under the workflow's handoff rule.

Close-out evidence

  • Main contains the merge and equals origin/main at 74b5234. The base checkout is clean.
  • Refresh outputs remain with the repository's lock-record Actions workflow. The lane uses the command-only post-merge route.
  • The named current-handoff file was absent. The preserved park request and lane status supplied the resume steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant