Skip to content

fix: repair inherited master failures and API-surface writes - #5669

Merged
Sinity merged 4 commits into
masterfrom
claude/prep-inherited
Sep 27, 2026
Merged

Sinity merged 4 commits into
masterfrom
claude/prep-inherited

Conversation

@Sinity

@Sinity Sinity commented Sep 27, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the tests that fail on clean master, and the two product defects behind the biggest groups of them.

Problem

On clean master (checked at 2da021c54), 11 tests in the web reader, MCP raw-session operations, thread profiles and browser capture failed, 35 in test_privileged_tools.py and test_facade_mutation_census.py, 5 in test_session_insight_refresh.py, and 4 more elsewhere. Two of the causes are product defects:

  • API-owned mutations were refused through the daemon. The daemon labels every machine-protocol principal as surface cli. user.* overlay operations and mutation.facade.* products have no CLI route, and their actuators allow only mcp/api/facade. So a web-reader saved-view save, or an annotation or saved-view delete, answered 409 SurfaceDeniedError. Every Python-API or MCP facade write through a running daemon also failed; for example, add_tag returned "did not complete: failed".
  • The async insight rebuild never cleared profile demand. rebuild_session_insights_async replaced profiles but left the session_profile_demand row they satisfied. The profile therefore read stale forever, although its binding matched. The sync twin already acknowledges the captured revision.

The remaining failures were stale tests, each against a deliberate change:

Solution

  • MutationPrincipal.on_surface(...). The user-overlay handler and the facade product handlers now execute as the api surface, the public surface that owns them, whichever transport delivered the request.
  • The facade client lowers tuple arguments to JSON arrays before the strict request models validate them. bulk_tag_sessions and post_blackboard_note were refused before any daemon call.
  • The saved-view HTTP route validates its query spec strictly, so a bad field is a 400 with field, not a 409 failed operation.
  • The async rebuild deletes the exact captured demand revision for each rebuilt session. The derived-sweep census declares it and is regenerated; the regeneration also reorders the stale daemon_ingest.py entry.
  • The MCP write, run and confirm-gate tests now run against the real resident operation stack (running_daemon_operations). The executor spies and failure-propagation proofs therefore observe the daemon's executor.
  • test_facade_mutation_census.py is deleted. Its own retirement condition fired: the helper is gone and every facade mutation submits a declared operation.
  • Each stale test is realigned with the contract it tests; see the commit messages.

Verification

  • devtools test over the 11 affected test files plus the three test_revision_backfill.py ids and test_raw_observation_owner.py: 707 passed (receipt 20260927T193036Z-focused-test-1998248-bb6cdb4a, pre-rebase; the rebase onto 917fcaa17 applied cleanly and touched none of these files except an unrelated appended web-reader test).
  • devtools verify --quick passed before the last two test-only edits; the hosted quick gate covers the pushed head.
  • Derived-sweep census round-trip re-checked on the rebased tree: identical.
  • devtools schema closure: mutation_transaction.py and derived/session/rebuild.py are IN, so this lands before a rebuild. The other changed production files are OUT.

Residuals

  • The route-family declarations carry placeholder examples (default/route) that no handler accepts, for example /api/import/explain and /api/webui/freshness return 400. The example replay now covers the kernel-bound routes only; polylogue-otmpm tracks making the family examples real.
  • A pre-reset archive (index user_version 67) is now classified upgrade_runtime, because the counter restarted at 1. The old archive is inert salvage and is never opened, so this was not changed.

🤖 Generated with Claude Code

https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4

Sinity and others added 3 commits September 27, 2026 21:50
The daemon derives every machine-protocol principal as surface cli, so
user.* overlay and mutation.facade.* products, which have no CLI route,
were refused by their actuators' surface allowlists: web-reader saves
and deletes answered 409 and every facade write through a running
daemon failed. Those families now execute as the api surface.

Also lower facade tuple arguments to JSON arrays before request
validation, answer a malformed saved-view query with its 400 field
error at the HTTP boundary, run the MCP write tests against the real
operation stack, and retire the facade mutation census whose helper
#5550 deleted.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
The async twin rebuilt profiles but never cleared the demand revision
it satisfied, so a current profile kept reading stale. It now deletes
the exact captured revision per rebuilt session, as the sync route
does. Regenerate the derived-sweep census and move two test fixtures
off the retired session_events.summary column and onto source-owned
marker inputs.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
Read JSON from stdout when a warning goes to stderr, find raw coverage
rows by origin, derive schema mismatches from the current version
counter, replay only kernel-bound route examples, pass the
prepared_artifact keyword through a shard test double, count the
census wrapper's phase commit, and make the paused-preparation
completion bound a hang guard.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-27T20:14:22.855192Z 7a16eae New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 288d1d05ac

ℹ️ 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".

A saved-view query whose value the spec parser cannot coerce, such as
limit="not-a-number", raised a plain ValueError that the safe handler
reported as a 500.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
@Sinity
Sinity enabled auto-merge (squash) September 27, 2026 20:30
@Sinity
Sinity merged commit 4c3d557 into master Sep 27, 2026
3 checks passed
@Sinity
Sinity deleted the claude/prep-inherited branch September 27, 2026 21:01
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