Skip to content

Use host-generic graphify skill instructions#1530

Closed
ari-mitophane wants to merge 1 commit into
Graphify-Labs:v8from
ari-mitophane:icarus/fix-codex-agents-template-pr
Closed

Use host-generic graphify skill instructions#1530
ari-mitophane wants to merge 1 commit into
Graphify-Labs:v8from
ari-mitophane:icarus/fix-codex-agents-template-pr

Conversation

@ari-mitophane

Copy link
Copy Markdown
Contributor

Purpose

Fix Graphify-generated install guidance so Codex/agent-facing surfaces do not tell hosts to invoke a literal skill tool with skill: "graphify". The generated wording now stays host-generic and points users to the installed graphify skill or instructions.

Implemented Delta

  • Updated the always-on AGENTS source fragment, packaged graphify/always_on/agents-md.md, and expected skillgen snapshot to use host-generic /graphify guidance.
  • Updated _skill_registration() so Claude/CodeBuddy registration snippets use the same host-generic wording.
  • Replaced stale English code-block examples in translated README files.
  • Added regression tests for AGENTS and registration helper wording.
  • Tightened the always-on roundtrip test to allow only the exact approved agents-md sentence delta.
  • Made skillgen git blob reads decode as UTF-8 explicitly on Windows.

Current Behavior

graphify codex install and related generated/registration examples can surface wording that tells agents to invoke a literal skill tool with skill: "graphify", which is host-specific and not valid in every environment.

Desired Behavior

Generated install guidance should say that /graphify should use the installed graphify skill or instructions before doing anything else, without naming a literal tool API that may not exist.

Key Interfaces / Modules

  • tools/skillgen/fragments/always-on/agents-md.md: source AGENTS wording.
  • graphify/always_on/agents-md.md: packaged always-on artifact.
  • tools/skillgen/expected/graphify__always_on__agents-md.md: generated snapshot.
  • graphify/__main__.py: _skill_registration() output and UTF-8 git blob reads.
  • tests/test_install_strings.py and tests/test_skillgen.py: regression coverage.

Decision Path

The bad text is produced by Graphify install surfaces, so the durable fix is upstream in the template/generator path rather than downstream edits in every consuming repository. The historical roundtrip guard remains strict: the test now proves the rendered AGENTS block equals the v8 baseline with only the exact approved sentence replacement.

Discarded Candidates

  • Downstream AGENTS edits were rejected because graphify codex install would regenerate the old wording.
  • A file-level agents-md roundtrip exemption was rejected because it could hide unrelated drift.
  • Broad translation rewrites were rejected because the stale translated README lines are English code-block examples.

Verification

  • python -m pytest tests/test_skillgen.py::test_always_on_roundtrip_is_byte_faithful -q
  • python -m pytest tests/test_install_strings.py -k "agents_section or skill_registration"
  • python -m pytest tests/test_install.py -k agents_install
  • python -m pytest tests/test_skillgen.py -k always_on
  • python -m tools.skillgen --check
  • rg -n 'invoke the Skill tool|invoke the skill tool|skill: "graphify"|skill tool' -S . --glob '!tests/**' --glob '!graphify-out/**' --glob '!.git/**'
  • git diff --check
  • graphify update .

Noted but not caused by this PR: broader local pytest over tests/test_install_strings.py tests/test_install.py tests/test_skillgen.py has pre-existing Windows/source-checkout failures around pytest import/source state, Windows path separator expectations, and missing installed graphifyy package metadata causing __version__ to be unknown.

Failure Modes / Residual Risk

Line-ending warnings appear in this Windows checkout because global core.autocrlf is enabled. The committed diff is limited to the intended wording, test, and generator changes.

Reviewer Guidance

Start with tests/test_skillgen.py::test_always_on_roundtrip_is_byte_faithful to check the intentionally narrow historical-baseline exception, then review the AGENTS fragment and _skill_registration() wording.

Out of Scope

  • Changing hook behavior.
  • Reworking translated README prose beyond the stale English code-block sentence.
  • Fixing unrelated Windows/source-checkout test failures.

Related Issues

None.

Implemented Delta
- Replaced literal `skill` tool invocation wording in the Codex AGENTS always-on template, generated artifact, expected snapshot, registration helper, and translated README examples.
- Added regression coverage for the AGENTS template and `_skill_registration()` helper so `skill: "graphify"` wording does not return.
- Narrowed the always-on historical roundtrip exception to the exact approved agents-md sentence replacement.
- Made skillgen git blob reads decode as UTF-8 explicitly for Windows.

Decision Path
- The bad wording is generated by Graphify install surfaces, so the fix belongs upstream instead of patching downstream repositories.
- The AGENTS template source, packaged output, and expected artifact were updated together to keep skillgen checks coherent.
- The roundtrip guard remains strict except for the one intentional sentence delta.

Discarded Candidates
- Downstream per-repo AGENTS patches were rejected because `graphify codex install` would regenerate the bad text.
- A file-level agents-md roundtrip exemption was rejected because it could hide unrelated drift.
- Translation rewrites were rejected; the stale lines were English code-block examples, so literal replacement was sufficient.

Failure Modes
- Full local pytest over `tests/test_install_strings.py tests/test_install.py tests/test_skillgen.py` has pre-existing Windows/source-checkout failures unrelated to this patch: pytest import/source artifact, Windows path separator assertion, and missing installed package metadata causing `__version__` to be `unknown`.
- Git emits LF-to-CRLF warnings in this Windows checkout because global `core.autocrlf` is enabled.

Verification
- `graphify query "How does tests/test_skillgen.py check always_on_roundtrip and agents-md generated artifacts?"`
- `python -m pytest tests/test_skillgen.py::test_always_on_roundtrip_is_byte_faithful -q`
- `python -m pytest tests/test_install_strings.py -k "agents_section or skill_registration"`
- `python -m pytest tests/test_install.py -k agents_install`
- `python -m pytest tests/test_skillgen.py -k always_on`
- `python -m tools.skillgen --check`
- `rg -n 'invoke the Skill tool|invoke the `skill` tool|skill: "graphify"|`skill` tool' -S . --glob '!tests/**' --glob '!graphify-out/**' --glob '!.git/**'`
- `git diff --check`
- `graphify update .`
- `git diff --cached --name-only`

Current-State Snapshot
- Branch `icarus/fix-codex-agents-template-pr` is based on `upstream/v8`.
- Staged and committed scope is limited to ten intended tracked files.
- `graphify update .` completed; HTML visualization was skipped because the graph has more than 5,000 nodes.

Provenance-Type: bugfix
Blocked-Workflow: not-applicable
Environment-Cause: windows-line-ending-warnings
Package-Intent: keep:graphifyy
Install-Command: not-applicable
Verification-Command: python -m pytest tests/test_install_strings.py -k "agents_section or skill_registration"
Returned-To-Task: true
Affects-Package: graphifyy
Affects-Workflow: codex-install
safishamsi pushed a commit that referenced this pull request Jun 29, 2026
Generated install/skill guidance told agents to invoke a literal `skill`
tool with `skill: "graphify"`, which is host-specific and not valid in
every environment. The always-on AGENTS fragment, packaged artifact,
expected snapshot, and _skill_registration() output now use host-generic
wording: "use the installed graphify skill or instructions". Also decodes
skillgen git blob reads as UTF-8 for Windows and replaces stale English
code-block examples in the translated READMEs.

The always-on roundtrip guard deliberately freezes the v8 baseline, so an
intentional wording change would otherwise fail it. Rather than only
patching the pytest mirror (which left the blocking CLI guard
--always-on-roundtrip red, as the original PR did), this adds an explicit,
reviewable ALWAYS_ON_SANCTIONED_EDITS registry: the guard applies the
approved old->new substitution to the baseline before the byte-for-byte
compare, so this exact sentence is allowed while any other drift still
fails. CLI guard and pytest test now agree and CI passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@safishamsi

Copy link
Copy Markdown
Collaborator

Merged into v8 as e3e4198 with your authorship. The host-generic wording is the right fix — telling agents to invoke a literal skill tool with skill: "graphify" only made sense on Claude and was invalid elsewhere.

One thing I had to add before it could land: the change passed skillgen --check and the pytest mirror, but the authoritative --always-on-roundtrip CLI guard (a blocking CI step) was still red, because the PR only patched the pytest test to tolerate the mismatch and not the guard itself — so the two disagreed. Rather than weaken the guard, I added an explicit, reviewable ALWAYS_ON_SANCTIONED_EDITS registry: the guard now applies the approved old→new substitution to the frozen baseline before the byte compare, so this exact sentence is allowed while any other drift still fails. CLI guard and pytest test now agree and all five skillgen guards are green. Thanks for the clean, well-scoped PR.

@safishamsi safishamsi closed this Jun 29, 2026
safishamsi added a commit that referenced this pull request Jun 29, 2026
Covers #1499 (Ruby type-aware resolution), #1308/#1541 (workspace
exports map), #1529 (alias/workspace import-edge regression), #1531
(tsconfig paths fallbacks), #1527 (semantic cache pruning), #1475 (three
ObjC fixes), #1533 (Swift static-call confidence), #1442 (secondary LLM
timeout), #1502 (GraphML null coercion + save-result --answer-file),
#1530 (host-generic skill wording), and the Dependabot dep bumps.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mathieucarbou-ibm pushed a commit to mathieucarbou-ibm/graphify that referenced this pull request Jun 29, 2026
…#1530)

Generated install/skill guidance told agents to invoke a literal `skill`
tool with `skill: "graphify"`, which is host-specific and not valid in
every environment. The always-on AGENTS fragment, packaged artifact,
expected snapshot, and _skill_registration() output now use host-generic
wording: "use the installed graphify skill or instructions". Also decodes
skillgen git blob reads as UTF-8 for Windows and replaces stale English
code-block examples in the translated READMEs.

The always-on roundtrip guard deliberately freezes the v8 baseline, so an
intentional wording change would otherwise fail it. Rather than only
patching the pytest mirror (which left the blocking CLI guard
--always-on-roundtrip red, as the original PR did), this adds an explicit,
reviewable ALWAYS_ON_SANCTIONED_EDITS registry: the guard applies the
approved old->new substitution to the baseline before the byte-for-byte
compare, so this exact sentence is allowed while any other drift still
fails. CLI guard and pytest test now agree and CI passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mathieucarbou-ibm pushed a commit to mathieucarbou-ibm/graphify that referenced this pull request Jun 29, 2026
Covers Graphify-Labs#1499 (Ruby type-aware resolution), Graphify-Labs#1308/Graphify-Labs#1541 (workspace
exports map), Graphify-Labs#1529 (alias/workspace import-edge regression), Graphify-Labs#1531
(tsconfig paths fallbacks), Graphify-Labs#1527 (semantic cache pruning), Graphify-Labs#1475 (three
ObjC fixes), Graphify-Labs#1533 (Swift static-call confidence), Graphify-Labs#1442 (secondary LLM
timeout), Graphify-Labs#1502 (GraphML null coercion + save-result --answer-file),
Graphify-Labs#1530 (host-generic skill wording), and the Dependabot dep bumps.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

2 participants