Repository navigation
fix(skill): pass labels, add-URL and clone values through sidecar files - #5307
danikdanik wants to merge 1 commit into
Conversation
|
Thanks for the pull request, @danikdanik. A maintainer will review it soon. Want to talk it through while it is in review? Come join us on our Discord server. For longer-form discussion there is also GitHub Discussions. A couple of things that speed up review: make sure the test suite passes on Python 3.11 and 3.13, and that the change keeps extraction deterministic. |
|
Thanks @danikdanik! One small thing: our changelog and release notes are built from PR titles, so we use the conventional-commits format, for example: Prefixes we use: |
There was a problem hiding this comment.
Graphify code review 
Review completed · 866e5c165de1
Tip
Merge confidence: 5/5 · Looks safe to merge · 🟠 High impact
No issues reported
1 not re-checked
The change moves labels, add arguments, clone URLs, and Obsidian paths in skill instructions into sidecar files.
Full summary
The change moves labels, add arguments, clone URLs, and Obsidian paths in skill instructions into sidecar files. It also updates PowerShell translation for sidecar reads and expands ~ in the Obsidian export path.
What this review covered
- We didn't review 122 files that aren't source code, such as docs, config, images, or generated or third-party code.
- Some lookups asked for files or lines that do not exist; the review was told and carried on.
- 5 of 5 changed files inspected. This is scope, not a correctness guarantee.
Code graph and static checks · 2086 functions depend on this change
Impact & health
Impact — 2086 functions depend on the 1688 functions this change touches.
Health — grade A; 10 existing hotspot(s) in the area this change touches (pre-existing, not introduced here):
dispatch_command()— 8 callers, 156 callees (high)main()— 128 callers, 3 callees (high)_run_hook_guard()— 7 callers, 18 callees (high)_run_cli()— 11 callers, 8 callees (high)render()— 16 callers, 5 callees (high)audit_coverage()— 8 callers, 6 callees (high)_stale_graph_sources()— 7 callers, 6 callees (high)main()— 3 callers, 11 callees (medium)- …and 2 more
Formal checks — 2086 functions this change can affect weren't formally checked in this review. Formal checks are informational only.
Gate & verification
✅ PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 2011 function(s) in the blast radius were not formally verified this run
Test selection
594 of 594 test file(s) selected (100%) via static blast radius.
Escalated to a full run for safety (
noncode-change,uncovered-code) — the selection is not trustworthy on its own (see below). CI should run the whole suite.
tests/pi.test.ts— full-run-safetytests/test_4874_jvm_resolution.py— full-run-safetytests/test_4909_reference_binding_scale.py— full-run-safetytests/test_4978_reconcile_cost.py— full-run-safetytests/test_4992_ts_import_types.py— full-run-safetytests/test_5072_splittable_under_cap_retry.py— full-run-safetytests/test_affected_cli.py— impact, full-run-safetytests/test_affected_defines.py— full-run-safetytests/test_affected_member_seed.py— full-run-safetytests/test_affected_overrides.py— full-run-safetytests/test_affected_path_file_node.py— full-run-safetytests/test_affected_seed_reference_forms.py— impact, full-run-safetytests/test_agents_platform.py— impact, full-run-safetytests/test_alias_folding.py— full-run-safetytests/test_analyze.py— full-run-safetytests/test_anthropic_custom_endpoint.py— full-run-safetytests/test_antigravity_install.py— full-run-safetytests/test_apm_fallback_version.py— full-run-safetytests/test_architecture_doc.py— full-run-safetytests/test_astro_extraction.py— full-run-safetytests/test_astro_import_ids.py— full-run-safetytests/test_atomic_canvas_export.py— full-run-safetytests/test_atomic_version_stamp.py— full-run-safetytests/test_atomic_writes.py— full-run-safetytests/test_backend_env_isolation.py— full-run-safetytests/test_backend_extras.py— full-run-safetytests/test_backend_opt_in.py— full-run-safetytests/test_benchmark.py— full-run-safetytests/test_benchmark_raw_graph.py— full-run-safetytests/test_benchmark_real_query.py— full-run-safetytests/test_binary_media_words.py— full-run-safetytests/test_blade_extractor.py— full-run-safetytests/test_build.py— full-run-safetytests/test_build_located_semantic_identity.py— full-run-safetytests/test_build_merge_dedup_scope.py— full-run-safetytests/test_build_merge_ghost_fold_4955.py— full-run-safetytests/test_build_merge_hyperedges_and_prune.py— full-run-safetytests/test_build_merge_shrink_guard.py— full-run-safetytests/test_builtin_global_type_refs.py— full-run-safetytests/test_c_include_resolution.py— full-run-safetytests/test_cache.py— full-run-safetytests/test_cache_long_paths.py— full-run-safetytests/test_cache_stale_import_target.py— full-run-safetytests/test_cache_windows_case_4925.py— full-run-safetytests/test_callflow_html.py— full-run-safetytests/test_cargo_introspect.py— full-run-safetytests/test_cargo_missing_manifest.py— full-run-safetytests/test_carried_hyperedge_remap.py— full-run-safetytests/test_case_only_decl_ids_4904.py— full-run-safetytests/test_case_sensitive_resolution.py— full-run-safety- … and 544 more
⚠️ non-code file(s) changed (graphify/skill-agents.md,graphify/skill-aider.md,graphify/skill-amp.md,graphify/skill-claw.md,graphify/skill-codex.md…) → running the full suite for safety (a code graph can't see config/fixture/data deps)
⚠️ changed code file(s) with no mapped test (graphify/skill-agents.md,graphify/skill-aider.md,graphify/skill-amp.md,graphify/skill-claw.md,graphify/skill-codex.md…) — a coverage gap or a missing link — running the full suite rather than only the selected tests
Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.
…r files Three runbooks still pasted free-text values into executable source after the INPUT_PATH fix (Graphify-Labs#4762): - labels = LABELS_DICT: Step 5 pasted the agent-built community-name dict into Python source; a label containing a quote or brace broke the literal and ran as code. - ingest('URL', ..., author='AUTHOR', contributor='CONTRIBUTOR'): the /graphify add URL and user names went into Python string literals. - graphify clone <url> and export obsidian --dir <path>: URLs and paths were pasted unquoted into shell lines, where &, ; or $() executes. All now travel through graphify-out/ sidecars the agent writes first: .graphify_labels.json (Step 5 reads it back), .graphify_add_url plus optional .graphify_add_author/.graphify_add_contributor (missing file maps to None), .graphify_clone_url/.graphify_clone_branch and .graphify_obsidian_dir. The PowerShell translator gains a $(cat FILE) -> Get-Content -Raw rule so the same sidecars work in the windows render. Adds a fence test banning the paste-the-value tokens across all generated bodies.
0fb7cad to
866e5c1
Compare
|
Fixed in 866e5c1 — |
Summary
Sweeps the remaining paste-the-value placeholders out of the distributed skills:
/graphify add's URL/author/contributor, the Step-5LABELS_DICTdict literal,graphify clone's URL/branch, the custom--obsidian-dir, and the Whisper model/prompt env vars — all the same unsafe-interpolation class as #4762.Why
ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR')pasted three values into single-quoted Python literals;labels = LABELS_DICTpasted an entire agent-composed dict into Python source (the worst of the class — it is code, not data);graphify clone <github-url>and--dir ~/vaultspasted values into unquoted shell arguments; andexport GRAPHIFY_WHISPER_PROMPT="<hint>"put agent-composed text into a double-quoted assignment. Any quote, brace or$(in those values broke out of its literal.How
Same transport as #4762 and the companion SPEC_PATH/query fixes: the agent writes the value to a
graphify-out/sidecar, the command reads it back..graphify_add_url/.graphify_add_author/.graphify_add_contributor— a_opt()helper maps missing optional files toNone. Afinally:unlinks all three so a later/graphify addcan't silently inherit a previous run's metadata, and a missing URL file now fails with a cleanerror:line instead of a traceback..graphify_labels.json— Step 5 reads the labels dict back as JSON. The aider monolith's split-brain path (readgraphify-out/, wrote and cleaned a cwd copy) is unified ongraphify-out/to match devin/core..graphify_clone_url/.graphify_clone_branch— Step 0 createsgraphify-outfirst (it precedes Step 1's mkdir on a fresh workspace) andrm -fs the sidecars after the clone..graphify_obsidian_dir— the obsidian fence split in two (previously bothexport obsidianvariants ran unconditionally, and without a named dir the sidecar read yielded--dir ""); the--dirfence deletes the sidecar after use.cli.py.expanduser()s the--dirvalue since a~/read from a file no longer gets shell expansion..graphify_whisper_model/.graphify_whisper_prompt— both env exports now read files (|| echo basepreserves the model default).tools/skillgen/gen.py—$(cat FILE)in CLI lines and prose spans translates to$((Get-Content FILE -Raw).Trim()): inside"..."a bare(Get-Content ...)is a literal string in PowerShell, and.Trim()matches bash's trailing-newline stripping.tools/skillgen/gen.py— the_is_add_labels_sidecar_fix_linesanction predicate was tightened so generic lines (out = ingest(,return None,if not p.exists():) can't silently re-admit a paste line; the removed v8 line is sanctioned only in its exact old shape.What changed
gen.py+cli.py; all 134 generated artifacts regenerated (--checkclean).tests/test_skillgen_add_labels_sidecars.py(new) — bans the paste placeholders across generated bodies and pins the evaluated PowerShell subexpression form.tests/test_community_labels_skill.py,tests/test_skillgen.py— harnesses write/read.graphify_labels.jsoninstead of substitutingLABELS_DICT; monolith round-trip stays clean under the tightened sanction.Validation
python -m tools.skillgen --check: 134 artifacts byte-match.pytest tests/test_skillgen.py tests/test_skillgen_add_labels_sidecars.py tests/test_community_labels_skill.py tests/test_skillgen_input_path_injection.py: 139 passed.upstream/v8(env-only); nothing attributable to this diff.