fix(rules): use native formats and scope-specific delivery - #957
Merged
Merged
Conversation
SaulMoro
marked this pull request as draft
October 2, 2026 00:08
SaulMoro
force-pushed
the
fix/946-rules-delivery
branch
from
October 2, 2026 05:21
b9e9378 to
daf0817
Compare
This was referenced Oct 2, 2026
SaulMoro
force-pushed
the
fix/946-rules-delivery
branch
from
October 3, 2026 06:33
daf0817 to
f87b4d7
Compare
SaulMoro
marked this pull request as ready for review
October 3, 2026 06:33
Collaborator
|
This branch has merge conflicts with |
SaulMoro
force-pushed
the
fix/946-rules-delivery
branch
from
October 3, 2026 07:04
f87b4d7 to
2c70f26
Compare
|
|
Findings
Resolved
|
SaulMoro
force-pushed
the
fix/946-rules-delivery
branch
from
October 3, 2026 10:28
2474643 to
0ca60db
Compare
…ets (Tencent#946) - Keep OpenClaw's default workspace AGENTS.md out of the retired files: its default profile still reads it. - Strip a retired file of a tool with no file and no hook in this scope (OpenClaw in a project) without waiting for a replacement. - Keep doctor's Pi extension check while the project has team rules, even with no instruction blocks. - Adapt the Tencent#945 every-shape test to OpenClaw's workspace install probe and its lack of a project file; drop the Tencent#946 uninstall test Tencent#945's recorded entry ownership superseded.
- Hold back a hook tool's retired instruction file while its hook is not installed; only a tool with no project channel (OpenClaw) releases it. - Mark Hermes and OpenClaw rules always on (✓*) in every README. - Pin that a project uninstall keeps a .opencode/opencode.json left with only $schema once the recorded instructions entry goes. - Resolve the team rules once for doctor's hook checks; use one RulesHandler in the uninstall plan; return early from ruleChannelNotes outside a project; name only the files a project pull touches when the team rules cannot be resolved; drop a stray CHANGELOG period.
…namespace globs (Tencent#946) - A flat copy on record is teamai's only while it holds what was recorded or the render; remove and uninstall keep and name an edited one. - OpenCode's user rules globs own every namespace directory a rule landed in at a revision this checkout pulled, so pull and doctor reclaim the glob of a namespace the team deleted.
…n inline rules (Tencent#946) - A superseded flat copy (fe.style.md beside the author's style.md) goes only while it holds what was recorded or the render; an edited one is kept and named, a member's own file is left alone. - inlinedRulesText reads paths: through the tolerant team-rule parse, so paths: **/*.ts keeps its 'Applies to files matching' line.
…Tencent#946) parseLearningDoc logged 'Failed to parse frontmatter' at error level on every pull for a rule with paths: **/*.ts and indexed the frontmatter as body text. It now retries with the tolerant team-rule parse and logs at debug.
SaulMoro
force-pushed
the
fix/946-rules-delivery
branch
from
October 3, 2026 14:32
0ca60db to
591dc5e
Compare
|
Findings
Resolved
|
|
One parser edge looks real; I’m confirming expected syntax and impact. |
Collaborator
Author
|
@jeff-r2026 The previous automated comment published an intermediate progress message instead of the final review result. The completed Codex CI review of
The parser concern mentioned in the posted progress message did not become a finding in the final result. |
jeff-r2026
approved these changes
Oct 4, 2026
Preserve both changelog entries while integrating current main.
|
Finding
Resolved
Testing
|
Probe the resolved workspace directory instead of requiring AGENTS.md before delivering an HTTP prompt. Cover creation, successful acknowledgement and preservation of personal text.
|
Review
Testing
|
7 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Deliver rules through the files and formats each tool reads. Fix OpenCode namespace globs, OpenClaw event dispatch and hook activation, and diagnostics for missing delivery channels. Push and uninstall respect recorded ownership, flat names and shared files. YAML comments stay outside repaired glob scalars; doctor reports all-colliding flat names and stale activation after the last rule is removed. Scoped inline rules retain
Applies to files matching: <globs>as model guidance; the tool does not enforce file filtering.README capability changes
All five README variants contain the same changes:
✓*identifies always-on rules without tool-enforced path scoping. Hermes and OpenClaw use their normal user-scope channel. OpenClaw's previous check counted rule files it did not read.JoyCode scopes project rules natively; its user
rules.txtblock is always on.HTTP prompt delivery also creates a missing OpenClaw
AGENTS.mdin an existing resolved user workspace, preserving personal text.Type of Change
Test Plan
OpenClaw HTTP prompt fix at
a232064eResolved the latest P1 review finding by probing the workspace directory instead of requiring its target file. A second regression verifies that personal text in an existing
AGENTS.mdremains. English/Chinese usage guides and the core troubleshooting reference document the behavior.reportAndSyncLocalAgent:npx vitest run src/__tests__/local-agent.test.ts -t 'creates AGENTS.md for an HTTP prompt'failed withexpected 'failed' to be 'success'before the fix and passed afterward.npx vitest run --maxWorkers=4 src/__tests__/local-agent.test.ts src/__tests__/instruction-targets.test.ts src/__tests__/openclaw-hooks.test.ts src/__tests__/user-rules-files.test.ts src/__tests__/project-hook-rules.test.ts: 487 passed across 5 files.npx tsc --noEmitnpm run lintnpm run buildgit diff --checkE2E and compiled real-CLI verification were not rerun for this follow-up, preserving the user's explicit waiver. Earlier verification records remain below.
Conflict resolution at
204aa650npx tsc --noEmitnpm run lintnpm run buildnpx vitest run --maxWorkers=4 src/__tests__/import-org.test.ts src/__tests__/votes.test.ts src/__tests__/rules.test.ts src/__tests__/rule-render-contracts.test.ts src/__tests__/doctor-rules-delivery.test.ts src/__tests__/user-rules-files.test.ts src/__tests__/project-hook-rules.test.ts src/__tests__/init.test.ts src/__tests__/post-pull.test.ts: 455 passed across 9 files.git diff --check; all 83 PR-only paths and 8 main-only paths preserved byte-for-byte. The four overlapping paths are the changelog and documentation; runtime files have no overlap.E2E and real-CLI verification were not rerun for this conflict resolution, as explicitly waived by the user. Earlier evidence remains below.
Pre-merge verification at
41854ec4, based onmainat6c5949f8:npx tsc --noEmitnpm run lintnpm run buildnode node_modules/vitest/vitest.mjs run --coverage --maxWorkers=4: 7,975 passed, 20 skipped41854ec4: Node 22/Linux, the previously failing job, passed in run 37132282805. Remaining matrix/build/E2E jobs were still running when this record was added.591dc5eb: init/doctor/hooks tests, 153 passed. Covered again by the current whole unit suite.npx vitest run --config vitest.e2e.config.ts src/__tests__/e2e/doctor-delivery-cli.test.ts: 12 passed.591dc5eb: doctor-delivery and hooks-project-isolation E2E, 14 passed. Shared main-checkout Claude/Codex hooks and project isolation were not changed by this follow-up.The full E2E suite was not rerun, preserving the requested waiver. Its previously recorded run had 492 passed and 26 skipped at
f87b4d78. The post-pull CI failure was a test-fixture race: independent timers could emit close before output under worker load. The fake process now emits stream data before close and is created at spawn time; production post-pull code is unchanged. Current runtime fixes were rebuilt and verified through the real CLI.Evidence
Real CLI after build, git provider, isolated HOME, Kiro/OMP/Pi in user scope:
Both Kiro and OMP
fe.style.mdcopies retain the live rule after both pulls. PiAGENTS.mdcontainsApplies to files matching: **/*.ts; neither pull prints a frontmatter parse error. Before the fixes, the root tombstone could delete the flat copy and strict YAML parsing dropped the inline scope hint.A second project-only HOME with Hermes/Claude and an obsolete managed block in global
SOUL.md:The obsolete block is absent and personal
SOUL.mdtext remains. Previously the project-only install left the global rules behind. These runs exercise CLI delivery and migration; they do not launch those host applications.Additional real CLI after build, git provider, isolated HOME:
Before these fixes, the comment became part of the glob, all-colliding tools had no delivery diagnostic, and an empty rule set bypassed stale activation checks. These cases now pass through the compiled CLI.
Related Issues
Fixes #946.
Dependencies #952 and #958 are merged. The branch now includes
origin/mainate465eec2through merge commit204aa650; their implementation is outside this PR's diff. Conflict resolutions retain #958 automatic Codex trust, main-checkout hook sharing and doctor trust queries alongside #946 delivery notes. The init regression now checks automatic trust reporting without an unconditional manual-trust warning. English/Chinese guides retain both changes.Notes for Reviewers
Reviewed the whole branch inventory and runtime changes against
origin/main, and compared all 17 original commits withgit range-diff. The rebase preserves the previous rule ownership fixes and main's read-only votes aggregation from #968. Bilingual guides, design docs and affectedskill-datareferences are updated.Merge danger
Door: Two-way for code. Migration removes only proven, unchanged team copies and preserves member edits; restoring a legacy layout requires a compatible release and pull. The existing data-directory migration does not support downgrades.
Blast radius: Rules, instruction files, hook configuration and diagnostics across tools.
Earlier verification and retained limits
TEAMAI_RULE_PARSER_BUNDLES; they are among the current skips..codebuddy, which makes CodeBuddy count as installed.--patchand may miss the first request. Codex automatic hook trust comes from fix(hooks): trust Codex hooks and share project hooks across worktrees #958, with manual fallback when disabled or unsuccessful.DSH_HOME.