Repository navigation
feat(repo): guidance:overlay arm and overlay reach check #338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
napetrov
wants to merge
17
commits into
intel:main
Choose a base branch
from
napetrov:ce-overlay
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+959
−21
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
83863a9
feat(repo): guidance:overlay arm and overlay reach check
napetrov ee38237
Address review: overlay arm link walk, kept overlays, setup-patch files
napetrov a52e675
Address review: leave a shared-target load unattributed in the overla…
napetrov f442d5d
Address review: an overlay cell is identified by its overlay
napetrov 7d4fd3c
Address review: document ambiguous overlays in the reach schema
napetrov 4f33efc
Address review: pin no load on an ambiguous overlay link
napetrov 3d7334b
fix(overlay): a native name in a link group pins nothing; readlink ta…
napetrov b880a3e
fix(overlay): pin both names of an overlay link group; say when a mis…
napetrov d94e397
Merge branch 'main' of https://github.com/intel/dokimi into pr338-lan…
napetrov e761468
fix(overlay): drop the unused own parameter of _pinned_names
napetrov 6232e4d
fix(overlay): refuse to unlink an overlay under a path a setup patch …
napetrov e9a486f
fix(overlay): refuse a kept path under a removed link; unlink a file …
napetrov ba6dbfd
fix(overlay): load builtin profiles by path, not name
antonwolfy 5b80dbd
Merge remote-tracking branch 'intel/main' into pr338-land1031
napetrov ae4e427
Merge remote-tracking branch 'intel/main' into pr338-land1031
napetrov 7e46426
fix(overlay): unlink under a removed alias first, attribute linked lo…
napetrov d70dd57
fix(overlay): unlink removed overlays by canonical path; native names…
napetrov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <!-- | ||
| Copyright (C) 2026 Intel Corporation | ||
| SPDX-License-Identifier: Apache-2.0 | ||
| --> | ||
|
|
||
| ### Added | ||
|
|
||
| - **`guidance:overlay` arm for per-agent AGENTS.md overlays** — `dokimi repo run --arm guidance:overlay` gives a cell the base `AGENTS.md` and the `AGENTS.<agent>.md` of the harness under test, and removes the overlays of other agents (agentsmd/agents.md#185). A harness profile names its agent with the new `overlay` key (`claude` for Claude Code, `codex`, `copilot`). The arm refuses to run without that key, or when the base has no overlay for the agent. `dokimi repo reach` now probes every `AGENTS.<name>.md`, and reports a foreign overlay that the harness loaded as a `finding:` line and in the `overlays` block of `guidance_reach.v1`. Its `own_loaded` field says whether the harness loads its own overlay at all. |
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # Copyright (C) 2026 Intel Corporation | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| """Per-agent overlays of AGENTS.md (agentsmd/agents.md#185): ``AGENTS.<agent>.md`` beside an ``AGENTS.md``. | ||
|
|
||
| An overlay is named by the agent it is for, in lower case (``AGENTS.claude.md``). A harness profile names | ||
| its overlay with its ``overlay`` key. The ``guidance:overlay`` arm keeps the overlay of that name and removes | ||
| the others, and the reach probe reports any foreign overlay a harness loaded anyway. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import functools | ||
| import re | ||
| from pathlib import PurePosixPath | ||
|
|
||
| from .harness_profile import PROFILE_DIR, builtin_profiles, load_profile | ||
|
|
||
| OVERLAY_RE = re.compile(r"AGENTS\.([A-Za-z0-9][A-Za-z0-9-]*)\.md") | ||
|
|
||
|
|
||
| @functools.lru_cache(maxsize=1) | ||
| def native_names() -> frozenset[str]: | ||
| """Guidance names a builtin harness loads by its own convention (``AGENTS.override.md``): never an overlay.""" | ||
| return frozenset( | ||
| n | ||
| for name in builtin_profiles() | ||
| for n in load_profile(str(PROFILE_DIR / f"{name}.yaml")).guidance_names | ||
| ) | ||
|
|
||
|
|
||
| def overlay_of(path: str) -> str | None: | ||
| """The agent the guidance file ``path`` is an overlay for, ``None`` when it is not one. | ||
|
|
||
| A file under ``.claude`` is skill content, not guidance, so it is never an overlay. | ||
| """ | ||
| parts = PurePosixPath(path).parts | ||
| if ".claude" in parts or parts[-1] in native_names(): | ||
| return None | ||
| match = OVERLAY_RE.fullmatch(parts[-1]) | ||
| return match.group(1).lower() if match else None |
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: this says a native guidance name must belong to the alias group, but
_pinned_namesmarks a linked load ambiguous whenever any harness-native file is present anywhere in the probe. For example, with separateCLAUDE.mdandAGENTS.codex.md -> docs/shared.md, a loadeddocs/shared.mdis ambiguous even though its alias group has no native name. Document the probe-wide condition so readers can correctly interpret missingcross_loadedfindings; the implementation's conservative rule can remain unchanged.Suggestion: