Skip to content

fix(cli): admit CLI tag removal through the daemon - #5645

Merged
Sinity merged 2 commits into
masterfrom
claude/prep-semanticbugs
Sep 27, 2026
Merged

Sinity merged 2 commits into
masterfrom
claude/prep-semanticbugs

Conversation

@Sinity

@Sinity Sinity commented Sep 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • mark --tag-remove through the daemon was refused on every route. mutate-remove-tag now admits the api and cli surfaces, matching its add counterpart.
  • Adds an end-to-end test proving that a child stranded by a parent re-parse is recomposed by the lineage_prefix_recompose debt stage.

Problem

mutate-remove-tag declared no allowed_surfaces. _declare_executor_authority therefore back-filled it as API-only, and MutationTransaction.prepare_bound raised SurfaceDeniedError for the cli principal. The CLI removal payload of mutation.session.tag lowers onto exactly that per-target actuator, so every CLI tag removal failed. The add payload lowers onto mutate-bulk-tag-sessions, which admits api and cli. That asymmetry survived because the daemon write test drove only the add payload.

The lineage half of this PR adds no production code. A parent full replace that drops a child's branch-point message has, since #5376, recorded lineage_prefix_recompose debt, and the stage re-derives the child from its retained raw. No test drove that debt through the drain for this loss, only for the identity-alias loss.

Solution

  • polylogue/operations/specs.py: mutate-remove-tag declares allowed_surfaces=("api", "cli").
  • tests/unit/daemon/test_http_write_coordination.py: a real-daemon test adds a tag and then removes it through mutation.session.tag. It asserts two mutate-remove-tag operation runs under the cli surface. Anti-vacuity: deleting the declaration makes the removal fail with SurfaceDeniedError.
  • tests/unit/daemon/test_convergence_debt.py: seeds a two-link Codex lineage and replaces the parent through the writer with its branch-point message under a new native id. It asserts that the child is stranded with one debt row, drains once, and asserts that the child's composed transcript is complete again and the row is cleared.

Verification

  • devtools test tests/unit/daemon/test_http_write_coordination.py tests/unit/daemon/test_convergence_debt.py tests/unit/operations/test_specs.py tests/unit/api/test_facade_mutation_census.py tests/unit/mcp/test_privileged_tools.py → 82 passed, 35 failed.
  • All 35 failures are in test_privileged_tools.py and test_facade_mutation_census.py. The same two files on clean origin/master give 41 passed, 35 failed, so none come from this PR. They are the facade's FacadeDaemonRequiredError route and the pinned facade inventory.
  • devtools verify --quick → verify: PASSED exit=0

Residuals

  • polylogue/operations/specs.py is inside the derived schema-identity closure, so this must land before a fresh rebuild starts.
  • The 35 pre-existing failures above are not addressed here.

🤖 Generated with Claude Code

https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4

Sinity and others added 2 commits September 27, 2026 19:58
mutate-remove-tag declared no allowed_surfaces, so the executor
back-fill made it API-only and every 'mark --tag-remove' lowered by the
daemon under a cli principal was refused with SurfaceDeniedError. Its
add counterpart (mutate-bulk-tag-sessions) admits api and cli; the
removal now does too, and the daemon write test drives the removal
payload.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
A parent re-parse that drops the child's branch-point message records
lineage_prefix_recompose debt; nothing drove that debt through the
drain to show the child's composed transcript comes back complete.

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-27T18:01:39.455082Z 8cbbb46 PR opened
ℹ️ 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.

@Sinity
Sinity enabled auto-merge (squash) September 27, 2026 18:02
@Sinity
Sinity merged commit 048ade4 into master Sep 27, 2026
3 checks passed
@Sinity
Sinity deleted the claude/prep-semanticbugs branch September 27, 2026 18:08
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