Skip to content

fix(config): retain source updates with unchanged runtime values - #173334

Merged
vincentkoc merged 2 commits into
mainfrom
fix/config-source-publication-oct15
Oct 16, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/config-source-publication-oct15

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes explicitly enabled plugins being rejected when a newer authored configuration resolves to unchanged runtime values.

User Impact

Authored policy updates now reach consumers even when runtime values remain equal. Existing captured reads retain their original source; fresh reads see the replacement. Equal publications and version-only restamps remain no-ops. Display preferences and agent identities keep their narrow refresh scopes.

Why This Change Was Made

The publication shortcut compared only runtime values and discarded meaningful source updates. Publication now compares runtime and authored policy against their recorded values and resolution provenance. The existing session-change owner combines their effects, preserving full invalidation for model-policy and in-place changes without rebuilding every session for presentation-only edits. Config hashes remain with the existing value-fact owner.

Evidence

  • Reproduced the original disabled-by-default plugin facade failure. Seven source publication/cache/capture assertions fail on the original producer while two version-only no-op controls pass.
  • Five scope assertions fail on the previous PR revision; the correction passes all 71 publication/value-fact cases, including the moved and extended presentation/profile table.
  • All 11 plugin-facade cases and two selected source-only secret-runtime cases passed. The remaining 38 secret-runtime cases were outside the selected scope.
  • Targeted config/CLI test types, scoped lint, formatting and git diff --check passed.
  • Independent scope review found no actionable P0–P2 findings. The subsequent hash-helper relocation was independently verified to preserve its exact body, imports and two callers.

The exact-head hosted run failed in two jobs: pinned Bun setup exhausted downloads with HTTP 504 responses before tests started, and the cron registry-owner shard failed its selected/fallback provider and recurring startup-plugin cases. The aggregate CI gate failed downstream. The automated failure report marks these unknown because its scheduled-main comparison has no matching shard; preflight checkout receipts establish the exact tested merge, and direct source inspection attributes both failures to unchanged setup/account-admission owners. Landing uses the authorized inherited-failure exception, subject to native authority and review/security checks. These results are not green CI.

The cron fixtures and account-admission owners predate this change. The selected providers supply deferred runtime auth without a stored account; the recurring fixture uses a provider-config key. Later main PR #173509 admits the latter route, while deferred runtime credentials remain subject to account admission. Those repairs stay separate from this configuration publication fix.

@vincentkoc vincentkoc self-assigned this Oct 15, 2026
@clawsweeper

clawsweeper Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@vincentkoc
vincentkoc marked this pull request as ready for review October 15, 2026 17:30
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 15, 2026
@clawsweeper

clawsweeper Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR publishes authored configuration changes even when their resolved runtime values remain unchanged.

Example: Publish runtime {} after explicitly enabling plugins.entries.fixture.enabled in the authored source.

  • Before: The publisher discards the new source, and the disabled-by-default plugin facade remains blocked.
  • After: Fresh consumers receive the enabled source policy while previously captured reads retain their original policy.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, focused producer repair with meaningful owner-boundary tests, but one concrete invalidation regression remains.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its supplied evidence reports publication, facade, capture, and secret-runtime tests rather than a shipped-entry-point demonstration.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An explicitly enabled plugin can remain rejected because its newer authored policy is discarded when resolved runtime values stay equal.
Reason: The existing facade contract demonstrates useful corrective work, and the maintainer-authored direction needs no additional product approval.

Merge readiness

⛔ Needs changes before merge - 2 items remain

Keep this PR open: it repairs a real source-publication defect, but introduces unnecessary full session invalidation for ordinary preference writes.

Priority: P2
Reviewed head: 65da0e991e388c431f80c727d367f04e0432184e

Before merge

  • [P2] Preserve narrow scopes when authored display values change (P2) - Publishing initial runtime/source { agents: { entries: { main: {} } } }, then distinct runtime/source copies adding ui.prefs.sidebarEntries: ["sessions"], now makes sourceMatchesPublished false and unconditionally emits scope: "config". Previously runtimeSessionChangeScope classified this as config-presentation. The full scope dirties topology, invalidates the session catalog, and invalidates resident rows in session-row-projection.ts, restoring avoidable rebuilds and session-list stalls on ordinary preference writes. Keep the source-aware publication check, but classify source changes without overriding presentation/profile scope when their actual impact is narrow; extend the scope regression to include authored sources.
  • Explain or restore the original intent of Session invalidation scope - f8900ae: Prevent unnecessary session-row rebuilds while retaining presentation/profile scopes for genuine changes and broad invalidation for recorded-value drift.

Findings

  • [P2] [P2] Preserve narrow scopes when authored display values change — src/config/runtime-snapshot.ts:237-240

Provenance

  • Session invalidation scope changes intended behavior without addressing why it exists (f8900ae: Prevent unnecessary session-row rebuilds while retaining presentation/profile scopes for genuine changes and broad invalidation for recorded-value drift.)

Tests

  • Missing end-to-end proof: Add coverage that publishes both runtime and authored source after a ui.prefs-only change and verifies session rows and catalogs remain warm.
Agent review details

How this fits together

The config publisher receives resolved runtime values and authored source values, records their publication facts, and supplies snapshots and invalidation events to plugin, model, and session consumers.

flowchart TD
  A[Authored configuration] --> C[Runtime preparation]
  B[Resolved runtime values] --> C
  C --> D[Config publication owner]
  D --> E[Captured reads]
  D --> F[Plugin activation policy]
  D --> G[Session and model projections]
Loading

Technical review

Best possible solution:

Retain source-aware publication while preserving narrow session invalidation for presentation and profile changes.

Do we have a high-confidence way to reproduce the issue?

Source inspection establishes the discarded-source path, and the existing disabled-by-default facade test exercises its consumer; no reproduction was executed during this read-only review.

Is this the best way to solve the issue?

Fixing the shared publisher is appropriate, but source publication and session-row invalidation must remain separate decisions so display changes preserve their existing narrow scope.

Full review comments:

  • [P2] [P2] Preserve narrow scopes when authored display values change — src/config/runtime-snapshot.ts:237-240
    Publishing initial runtime/source { agents: { entries: { main: {} } } }, then distinct runtime/source copies adding ui.prefs.sidebarEntries: ["sessions"], now makes sourceMatchesPublished false and unconditionally emits scope: "config". Previously runtimeSessionChangeScope classified this as config-presentation. The full scope dirties topology, invalidates the session catalog, and invalidates resident rows in session-row-projection.ts, restoring avoidable rebuilds and session-list stalls on ordinary preference writes. Keep the source-aware publication check, but classify source changes without overriding presentation/profile scope when their actual impact is narrow; extend the scope regression to include authored sources.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5da0c5547cf1.

Provenance checked

  • Equal-runtime publication suppression changes intended behavior with a stated reason (6b36172: Preserve config/source identities and revision when publication is genuinely unchanged, preventing pending hooks from failing currentness checks.)
  • Recorded value and provenance comparisons keeps the original intent (b4ca9a7: Reuse publication hashes across equal mutable clones while detecting in-place edits and retaining opaque-value fallback behavior.)
  • Model configuration hashing extraction keeps the original intent (9310023: Keep model projections across UI preference and version-stamp writes while retaining authored policy and resolution provenance.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test src/config/runtime-snapshot.test.ts src/config/runtime-snapshot-value-fact.test.ts src/plugin-sdk/facade-runtime.test.ts --maxWorkers=1
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit b4ca9a7 adds src/config/runtime-snapshot.ts:239 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b4ca9a7a94c8; files: src/config/runtime-snapshot.ts)

PR surface

Source +42, Tests +79. Total +121 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 62 20 +42
Tests 2 83 4 +79
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 145 24 +121

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The fix restores authored plugin policy publication, with a limited performance regression in session invalidation that needs repair.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 15, 2026, 1:47 PM ET / 17:47 UTC.

@vincentkoc
vincentkoc merged commit cedc5ae into main Oct 16, 2026
163 of 168 checks passed
@vincentkoc
vincentkoc deleted the fix/config-source-publication-oct15 branch October 16, 2026 00:59
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

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

Labels

P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant