Skip to content

Normalize publication context and separate shim responsibilities - #381

Merged
HackingGate merged 1 commit into
mainfrom
feat/publication-context-20261016
Oct 16, 2026
Merged

HackingGate merged 1 commit into
mainfrom
feat/publication-context-20261016

Conversation

@HackingGate

Copy link
Copy Markdown
Owner

Publication adapters need to distinguish absent subjects from unread input and share the same destination when applying scope and ownership checks. Introduce a common subject Invocation and a command context that binds arguments, destination, host, and selection provenance for one invocation.

Extract destination/scope resolution and checker execution into internal shim modules. Keep policy dispatch centralized and preserve the single-binary interface, stdin replay, original argument handoff, and editor checks. Hooks and direct text retain their documented destination limits.

Validation: 543 unit tests and 257 focused CLI/structural tests, including shared allowed/refused fixtures across scan, guard, hook, shim, and editor, unread-input cases, environment/explicit destination precedence, and cached destination behavior. All-target Clippy and normal commit checks pass.

Closes #373. Closes #374.

Give text adapters and command publication an explicit Invocation subject
contract, preserving absent, empty and unread input and independent tool
identity. Bind command scope, ownership and text destination checks to one
lazy normalized destination with host and selection provenance.

Move pattern_refusal, pattern_finding and consult into shim::checker.
Move scope_holds, forge, visibility, gh_repository_target,
declared_standing and effective_scope into shim::destination.
Replace resolve_target with Destination::resolve, and ScopeMemo::holds and
ScopeMemo::standing with the bound CommandContext methods. No rule bodies,
checker exit contracts, editor behavior or process handoff are changed.

Add an allowed/refused fixture matrix across scan, guard, hook, command and
editor paths, unread-surface cases, and destination-observation tests.
Document the shared boundary and the adapters' remaining limits.

Validated 543 unit tests and 257 focused CLI/structural tests; clippy
--all-targets passes.

Implements #373 and the first cohesive module boundaries for #374.
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5392eaf3-56d1-4268-9724-2f3164da0b37
📥 Commits

Reviewing files that changed from the base of the PR and between 3ae2ecf and 1a488fd.

📒 Files selected for processing: 10
  • docs/DESIGN.md
  • docs/REFERENCE.md
  • src/hook.rs
  • src/invocation.rs
  • src/main.rs
  • src/shim.rs
  • src/shim/checker.rs
  • src/shim/destination.rs
  • src/text.rs
  • tests/publication_paths.rs
+-------------------------------------------------+
| We don't ship debt; we refinance it into tests. |
+-------------------------------------------------+
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.95782% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.67%. Comparing base (3ae2ecf) to head (1a488fd).

Files with missing lines Patch % Lines
src/shim/checker.rs 88.69% 13 Missing ⚠️
src/shim/destination.rs 96.85% 8 Missing ⚠️
src/shim.rs 98.41% 1 Missing ⚠️
src/text.rs 96.77% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (95.95%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #381      +/-   ##
==========================================
+ Coverage   94.61%   94.67%   +0.06%     
==========================================
  Files          46       49       +3     
  Lines       25233    25327      +94     
==========================================
+ Hits        23873    23978     +105     
+ Misses       1360     1349      -11     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@HackingGate
HackingGate marked this pull request as ready for review October 16, 2026 12:36
@HackingGate
HackingGate merged commit c80bbf0 into main Oct 16, 2026
12 checks passed
@HackingGate
HackingGate deleted the feat/publication-context-20261016 branch October 16, 2026 12:36
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.

Design: separate shim responsibilities behind internal module boundaries Design: normalize invocation context before evaluating publication policy

2 participants