Skip to content

fix(specs): PR-F-1 supervisor inert-bundle skip + PR-E-1 Cargo cycle (post-#360 corrections)#361

Merged
AdaWorldAPI merged 2 commits into
mainfrom
claude/sprint-3-spec-defect-fixes-v2
May 12, 2026
Merged

fix(specs): PR-F-1 supervisor inert-bundle skip + PR-E-1 Cargo cycle (post-#360 corrections)#361
AdaWorldAPI merged 2 commits into
mainfrom
claude/sprint-3-spec-defect-fixes-v2

Conversation

@AdaWorldAPI
Copy link
Copy Markdown
Owner

Summary

Two architectural defects in sprint-3's PR-F-1 and PR-E-1 specs (PR #360 merged) flagged during review but corrections didn't land in the merge window. This PR re-applies the corrections.

Defect 1 — PR-F-1 supervisor inert-bundle handling

The original pre_start loop iterates registry.active_g_list() and unwraps bundle.consumer_pointer. Per the W11 smoke test spec, DOLCE (G=0) and FMA (G=5) are inert bundles with consumer_pointer = None by design. The original loop either panics on unwrap() or aborts pre_start with ActorProcessingErr before any consumer actor spawns.

Fix (append-only correction section at end of pr-f-1-ractor-supervisor.md):

  • Explicit match bundle.consumer_pointer.as_ref() { None => continue, Some(p) => spawn } filter
  • Two equivalent options documented (Option A inline filter recommended; Option B narrow iterator's contract)
  • New test supervisor_skips_inert_bundles_and_spawns_consumers for the W11 smoke-test expectation

Defect 2 — PR-E-1 Cargo dependency cycle

The build script in lance-graph-contract was specified to emit Rust referencing medcare_rs::MedCareActor (and similar for each compiled-in consumer). But every consumer crate depends on lance-graph-contract per Single-Binary Topology I-1 invariant. The build-script reference creates a Cargo dependency cycle (contract → medcare-rs → contract) that won't compile under --features module-medcare.

Fix (append-only correction section at end of pr-e-1-manifest-modules.md):

  • Build script in contract emits ONLY data (OGIT::* u32 constants + MANIFEST_METADATA phf::Map of strings/values, no Rust refs to consumer crates)
  • Actor registration moves to consumer-side via 3 documented options:
    • Option A (recommended): inventory crate self-registration in each consumer crate
    • Option B: separate umbrella-binary crate that depends on all consumers
    • Option C: callback registry at supervisor init via with_consumers(...)
  • Post-fix dependency graph diagram showing no cycles
  • Updated PR-E-1 acceptance criteria

What this PR does NOT change

  • Pure spec corrections (no code touched)
  • Append-only — both correction sections appended at end of respective specs; original PR-F-1 and PR-E-1 content preserved verbatim
  • W8 consumer template, W10 sequencing, W11 smoke test, W1 master plan stay valid (corrections internal to PR-F-1 and PR-E-1)

Why a separate PR

PR #360 merged at 21:55 just before my correction pushes landed on the sprint-3 branch (same race as PR #358/#359 sequence in sprint-2). The corrections are append-only, so a follow-up PR is the cleanest path.

Test plan

Notes

Both defects would have manifested at engineer-pickup time in sprint-4. Catching them at spec stage saves a re-spin loop.

🤖 Generated by Claude Code

@AdaWorldAPI AdaWorldAPI merged commit 1ef65d8 into main May 12, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 38653281e1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


`lance-graph-callcenter::supervisor::CallcenterSupervisor::with_consumers(...)` takes an explicit list of consumer types passed by the binary's `main()`. Each consumer registers itself by spec-value (no compile-time enumeration). Most explicit; no macro magic; least automation.

**Recommendation:** Option A (inventory crate) — best ergonomics, zero per-consumer wiring beyond the `inventory::submit!` macro, no umbrella-binary requirement. Used by `tracing` subscriber registry and many other Rust ecosystems for exactly this pattern.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Link inventory submitters into the final binary

With Option A, inventory::submit! records are only available from crates that are actually linked into the executable; making medcare-rs a workspace member or having it depend on lance-graph-callcenter does not cause lance-graph-callcenter/the binary to link medcare-rs. Since this correction removes the contract→consumer edge and explicitly says there is no umbrella-binary requirement, deployments that do not otherwise depend on each consumer crate will see an empty inventory::iter::<ConsumerRegistration>() and spawn no active consumers. The spec needs an explicit binary dependency/static import/features mechanism, or Option B/C should be the recommended path.

Useful? React with 👍 / 👎.

- [x] Build script in `lance-graph-contract` emits OGIT::* + MANIFEST_METADATA (data only)
- [x] Build script does NOT reference consumer crates (no `use medcare_rs::*`)
- [x] Add `inventory = "0.3"` and `phf = { version = "0.11", features = ["macros"] }` as new external deps in lance-graph-contract
- [x] Document inventory pattern in W8 consumer template (see W8 spec — corrections also needed there)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update W8 before marking inventory documented

This marks the W8 consumer-template correction as complete, but .claude/specs/consumer-crate-template.md still omits an inventory dependency in its Cargo.toml example and its actor example only implements Consumer/ConsumerPointer::from_manifest without any inventory::submit! registration. A consumer author following W8 will therefore build a crate that never registers with the new Option A supervisor path, so the acceptance checklist should not be checked until that template is corrected.

Useful? React with 👍 / 👎.

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