Skip to content

simplify(diagnostics): publish compiler status through the project owner - #4545

Open
ScriptedAlchemy wants to merge 11 commits into
masterfrom
simplify/diagnostics-project-compiler-status
Open

ScriptedAlchemy wants to merge 11 commits into
masterfrom
simplify/diagnostics-project-compiler-status

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Fixes #4433. Parent link: none (stack S5 link 1, base master).

Problem

diagnostics_producer.rs copied each producer run into a process-global LAST_RUNS: Mutex<BTreeMap<PathBuf, ..>> with no removal path; availability reads joined it by pathname, so a successor owner at the same path would report its predecessor's run.

Fix

  • New TypeScriptProducerStatusV1 + TypeScriptProducerStatusHandleV1 (immutable Arc snapshot behind a lock). One handle is created per project owner at open, passed to the producer (via TypeScriptProducerStateV1::new) and to the owner's OwnedPrimitiveRuntime (via ProductionPrimitiveOpenRequestV1).
  • typescript_diagnostics_availability and the two diagnostics-absence problem builders read from the owner's handle.
  • Deleted LAST_RUNS, last_runs, last_record, last_producer_run, record_producer_run. Teardown retires the status with the owner; a superseded producer can only publish into its own handle.
  • Reset-required routes (no producer) get a fresh empty handle, i.e. "not run".
  • Per-tsconfig checked/failed/no-compiler/NoTsconfig distinctions are unchanged; findings still come from generation-bound publication only.
  • Not added: an attempted-generation field (Published already carries the generation; nothing reads another).

Verification

  • bazel test //crates/tracedecay-application:unit_test --test_arg=diagnostics_producer: 5 passed, incl. new a_successor_owner_does_not_inherit_the_predecessors_status and a_status_handle_publishes_to_its_owner_only; existing primitives::runtime diagnostics tests pass.
  • bazel build --config=clippy //crates/tracedecay-application/... //crates/tracedecay:all succeeds.

🤖 Generated with Claude Code

Retained Work configuration follow-up

The retained Work configuration repair from #4546 applies to the same five source/test files here, which were byte-identical before the repair. This follow-up carries those exact reviewed file versions into this branch; it does not claim a separate observed CI failure on #4545.

When a route is reopened after a sibling commits new configuration, Work registration now refreshes policy, topology, routing, and evidence admission under a captured-incumbent and canonical current-configuration fence. Exact store, actor, grant, scope, and Work authority remain required. The retained fan-out recovery view receives the admission update while preserving its owners and signal.

The real route-eviction/compiler journey keeps its existing assertions and budgets and additionally checks stable grant identity, current registration, stale and sibling refusal, and retained current authority after refusal. Pinned formatting, whitespace checks, normal pre-commit/commit-msg hooks, and independent source review passed. The transplanted blobs exactly match the reviewed Work repair. Complete native execution remains a hosted CI requirement because local disk and memory limits prevent the full build.

Configuration publication race follow-up

A changed retained Work runtime now verifies and publishes its configuration under the configuration store's existing canonical writer lane. The store reads durable current state through a registered immediate transaction, revalidates its retained authority, and invokes a synchronous registry transition before releasing the lane. The captured-incumbent comparison remains in place to prevent a delayed registrar from replacing a newer installed runtime.

The registry transition only reconciles an existing component; missing, reserved, closed, or fenced slots are refused. It performs no new owner build or asynchronous wait. Complete routing and recovery admission are refreshed together. The read-only transaction is dropped synchronously after the callback, using the existing rollback-before-writer-release contract, with no post-publication await.

Initial and unchanged retained pins preserve their existing lifetime. Work settings retain their daemon-restart semantics: a durable commit after successful publication is allowed, while a superseded candidate cannot claim to be current at publication.

The existing real route-eviction/compiler-status journey now pauses candidate B, commits C through the actual configuration surface, resumes B and requires its typed refusal with installed A unchanged, then installs and verifies C. Existing assertions and budgets remain intact. Pinned formatting, whitespace checks, normal commit hooks, and independent source/authority/lock-order review passed. The complete native journey was not executed locally and must pass hosted CI.

The TypeScript producer recorded each run into a process-global,
path-keyed LAST_RUNS map that nothing ever removed, and availability
reads joined it by pathname. A successor owner at the same path could
therefore report its predecessor's run as its own.

Each project owner now creates one TypeScriptProducerStatusHandleV1 at
open. The producer publishes into it and the owner's primitive runtime
reads from it; the global map, last_record, last_producer_run and the
path-only status API are deleted. Teardown retires the status with the
owner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 22182a8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

devin-ai-integration[bot]

This comment was marked as resolved.

ScriptedAlchemy added a commit that referenced this pull request Oct 26, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

ScriptedAlchemy added a commit that referenced this pull request Oct 27, 2026
Rebuild configuration-bound primitive ports when a retained route reopens
against a changed configuration, while preserving its producer status
and operation capacity. Compare the installed dispatch with the captured
one before replacement so late preparations cannot overwrite a successor.

Exercise unchanged and changed configuration reopen through real daemon
route eviction, a leased sibling, the configuration surface and pinned tsc.
@ScriptedAlchemy
ScriptedAlchemy enabled auto-merge (squash) October 27, 2026 02:50
Route eviction can retain a project's Work runtime while a sibling commits
new configuration. Reopening the route previously refused that same store
authority before the compiler producer could register.

Refresh the policy, topology, routing and evidence admission together under
the captured runtime and canonical current-configuration fence. Keep exact
store, actor, scope, grant and Work authority checks. Refresh the retained
fan-out recovery view without replacing recovery owners or their signal.

Extend the real compiler route journey to verify stable grant identity,
current Work authority, stale and sibling rejection, and retained authority
after refusals. Preserve all existing assertions and budgets.

Validation: pinned rustfmt and diff checks passed; independently reviewed.
Native tests were not run locally because of disk and memory constraints.
Hosted CI must verify the repaired route journey.
devin-ai-integration[bot]

This comment was marked as resolved.

Hold the canonical configuration writer lane while validating and
publishing a changed retained Work runtime. Refuse stale candidates
without replacing the incumbent or waiting for a new owner.

Exercise the real route journey with a newer durable configuration
committed while refresh is paused, then admit the current revision.

This branch has not been deployed

No deployments
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.

simplify(diagnostics): replace the global last-run map with project-owned compiler status

1 participant