fix(skills): remove invalid OpenCode/Codex agent guidance (#825)#804
Closed
hypnwtykvmpr wants to merge 17 commits into
Closed
fix(skills): remove invalid OpenCode/Codex agent guidance (#825)#804hypnwtykvmpr wants to merge 17 commits into
hypnwtykvmpr wants to merge 17 commits into
Conversation
4b94d36 to
4f78b3e
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tors - Add .sh, .bash, .json to CODE_EXTENSIONS in detect.py so files reach extractor - Fix test_detect_incremental manifest path collision with new .json extension - Update test_watch to reflect .json/.sh are now watched extensions - B-1: only emit source imports for paths that exist on disk - J-1: replace stat()+read() with bounded read to eliminate TOCTOU - J-3: move pair_count cap inside loop so it is honoured exactly - J-4: namespace $ref/extends refs with "ref_" prefix to prevent ID collision Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…on graph change safishamsi#873: Remove blanket dot-prefix exclusion from detect.py and extract.py collect_files(). Add framework caches (.next, .nuxt, .turbo, .angular, .idea, .cache, .parcel-cache, .svelte-kit, .terraform, .serverless, .graphify) to _SKIP_DIRS so they stay blocked. Meaningful dot dirs (.github, .claude, etc.) are now indexed. safishamsi#874: Add _maybe_reload() with mtime+size stat key and threading.Lock to serve.py. call_tool and read_resource call _maybe_reload() on every request; the graph reloads automatically when graph.json changes without restarting the MCP server. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
graphify.exe and python.exe are co-located in the same Scripts\ directory for both uv tool and pipx installs. Use Get-Command graphify to find that directory and pick up the correct Python instead of falling through to bare python (which is a different interpreter that doesn't have graphify). Also replace all bare `python .graphify_*` invocations throughout the skill with `& (Get-Content graphify-out\.graphify_python)` so every step uses the saved interpreter, and fix the bash $(cat ...) syntax to PowerShell & (Get-Content ...). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…hamsi#831) antigravity install on Windows now installs skill-windows.md instead of skill.md by redirecting to a new antigravity-windows platform config at install time via sys.platform check. Python detection in Find-GraphifyPython now uses uv tool dir (respects UV_TOOL_DIR) and pipx environment --value PIPX_LOCAL_VENVS (respects PIPX_HOME) instead of guessing from the shim location. The graphify.exe shim and python.exe live in different directories for both uv and pipx on Windows so the previous Get-Command approach was wrong. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move all intermediate data files and temp step scripts from the project root into graphify-out/ to match the bash skill behaviour. Also fix the > redirect on detect.json which wrote UTF-16LE in PowerShell 5.1 - now uses Out-File -Encoding utf8 consistently. Files moved: .graphify_detect.json, .graphify_ast.json, .graphify_extract.json, .graphify_semantic.json, .graphify_analysis.json, .graphify_labels.json, .graphify_incremental.json, .graphify_old.json, all .graphify_step_*.py temp scripts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…label normalization Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…merges on short labels (safishamsi#878) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Cherry-picked from PR safishamsi#881 (merged into v7) — adds case study artifacts matching the worked/karpathy-repos/ convention.
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
Closes #825. The installed OpenCode
SKILL.mdinstructedsubagent_type="general-purpose"— an agent type OpenCode does not support — and blocked large-corpus runs on an interactive subfolder prompt. A cross-skill audit (.AUDIT/825-cross-skill-check.py) confirmed the Codex skill had the identical logical bug: it dispatches viaspawn_agent(agent_type="worker", ...)but still told users to "re-run withgeneral-purposeagent" on failure — impossible to follow.This PR fixes both, makes large-corpus handling deterministic, normalizes returned-agent JSON to per-chunk files, and adds a Python validation boundary so untrusted agent payloads can't exhaust disk/memory or escape the chunk directory.
Changes (latest commit,
c720f1a)Skill text (
graphify/skill-opencode.md,graphify/skill-codex.md)@mentionfor OpenCode,spawn_agentfor Codex); removed all Claudesubagent_type="general-purpose"/Explore type/ "general-purpose agent" guidance.--max-concurrency 1(a real CLI flag).NNis derived from the dispatcher, never from agent output (path-traversal safety).Python enforcement boundary (
graphify/semantic_cleanup.py)validate_semantic_fragment(fragment) -> list[str]: ≤ 25 MB payload, ≤ 10,000 nodes, ≤ 100,000 edges, ASCII-only IDs with no path separators (/,\,..),file_typewhitelist (code|document|paper|image).load_validated_semantic_fragment(path) -> tuple[dict | None, list[str]]:stat().st_sizeguard runs beforeread_text()/json.loads(), so oversize chunk files are rejected without allocation. JSON decode errors return aserrorsinstead of raising.Tests
tests/test_install.pycovering OpenCode and Codex (agent-type ban, non-interactive large-corpus, returned-JSON normalization, platform-neutral dispatch language).tests/test_semantic_cleanup.py(validation + load helper: valid, non-object, oversize, too-many-nodes, too-many-edges, path-traversal ID, invalid file_type, oversize-before-parse, invalid-JSON-no-raise, valid-load).CHANGELOG.mdentry under## Unreleased.Audit artifact
.AUDIT/825-cross-skill-check.pyreads eachgraphify/skill-*.mdand treats platform-override blockquotes as the authoritative dispatch contract. After this PR it exits0.skill-droid.mdandskill-trae.mdremainNEEDS-EXTERNAL-VERIFICATION(their Task-tool variants need platform-runtime contract confirmation) and are deliberately out of scope;skill-copilot.mdwarrants a separate investigation issue because it has no platform-override block.Validation
.venv/bin/python -m pytest -p no:cacheprovider→ 2180 passed in 15 s.venv/bin/python .AUDIT/825-cross-skill-check.py→ exit0rg -n "general-purpose|subagent_type|Explore type|MUST use the Agent tool here|After each Agent call completes|ask which subfolder to run on|wait for the user's answer before proceeding" graphify/skill-opencode.md graphify/skill-codex.md→ no matchesgraphify install --platform codexagainst the new template → installedSKILL.mdverified clean by the same extended grepgraphify update . --force→ graph regenerated (7443 nodes, 12057 edges, 546 communities)git apply --checkwas the verification gate during the runbook revision passPreviously included work (12 prior fork commits on this branch)
The branch also carries 12 fork commits that this PR's #825 fix depends on (notably
graphify/semantic_cleanup.pywas introduced earlier in this stack and this PR extends it). Brief summary, newest first:fix: restore local graphify fixes after upstream syncfeat: callflow HTML offline-ready (vendored Mermaid 11.14.0 with SRI fallback)fix: graph path / parser hardeningtest: hollow response expectations after upstream rebaseci: install action test dependenciesfix: graph rebuild validation and manifest handlingtest: escape elixir interpolation fixturefix: pypdf for PDF image extractionfeat: upstream issue rollup — wiki links, rationale guard, offline viz, PPTX/PDF, GitHub Action, corpus docsfix: security hardening (9 findings from systematic review) — introducesgraphify/semantic_cleanup.pyfeat: bash shell script extraction + ForgeCode install platform supportIf preferred, the prior commits can be split into a separate PR — but a direct cherry-pick of the #825 commit onto
upstream/v7will fail becausesemantic_cleanup.pydoesn't exist there yet.