Skip to content

fix(skill): pass labels, add-URL and clone values through sidecar files - #5307

Open
danikdanik wants to merge 1 commit into
Graphify-Labs:v8from
danikdanik:fix/skill-remaining-substitutions
Open

danikdanik wants to merge 1 commit into
Graphify-Labs:v8from
danikdanik:fix/skill-remaining-substitutions

Conversation

@danikdanik

Copy link
Copy Markdown

Summary

Sweeps the remaining paste-the-value placeholders out of the distributed skills: /graphify add's URL/author/contributor, the Step-5 LABELS_DICT dict 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_DICT pasted an entire agent-composed dict into Python source (the worst of the class — it is code, not data); graphify clone <github-url> and --dir ~/vaults pasted values into unquoted shell arguments; and export 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 to None. A finally: unlinks all three so a later /graphify add can't silently inherit a previous run's metadata, and a missing URL file now fails with a clean error: line instead of a traceback.
  • .graphify_labels.json — Step 5 reads the labels dict back as JSON. The aider monolith's split-brain path (read graphify-out/, wrote and cleaned a cwd copy) is unified on graphify-out/ to match devin/core.
  • .graphify_clone_url / .graphify_clone_branch — Step 0 creates graphify-out first (it precedes Step 1's mkdir on a fresh workspace) and rm -fs the sidecars after the clone.
  • .graphify_obsidian_dir — the obsidian fence split in two (previously both export obsidian variants ran unconditionally, and without a named dir the sidecar read yielded --dir ""); the --dir fence deletes the sidecar after use. cli.py .expanduser()s the --dir value since a ~/ read from a file no longer gets shell expansion.
  • .graphify_whisper_model / .graphify_whisper_prompt — both env exports now read files (|| echo base preserves 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_line sanction 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

  • 6 fragments + gen.py + cli.py; all 134 generated artifacts regenerated (--check clean).
  • 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.json instead of substituting LABELS_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.
  • Full tests/ sweep run: failures identical to pristine upstream/v8 (env-only); nothing attributable to this diff.

@github-actions

Copy link
Copy Markdown

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.

@github-actions github-actions Bot added the needs:title PR title should follow the conventional-commit format label Nov 18, 2026
@github-actions

Copy link
Copy Markdown

Thanks @danikdanik! One small thing: our changelog and release notes are built from PR titles, so we use the conventional-commits format, for example:

fix(python): resolve a bare stdlib import correctly

Prefixes we use: feat, fix, docs, chore, refactor, test, perf, build, ci. Editing the PR title clears this automatically. This is just a nudge and does not block review.

@graphify-labs graphify-labs Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graphify code review View in Graphify

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-safety
  • tests/test_4874_jvm_resolution.py — full-run-safety
  • tests/test_4909_reference_binding_scale.py — full-run-safety
  • tests/test_4978_reconcile_cost.py — full-run-safety
  • tests/test_4992_ts_import_types.py — full-run-safety
  • tests/test_5072_splittable_under_cap_retry.py — full-run-safety
  • tests/test_affected_cli.py — impact, full-run-safety
  • tests/test_affected_defines.py — full-run-safety
  • tests/test_affected_member_seed.py — full-run-safety
  • tests/test_affected_overrides.py — full-run-safety
  • tests/test_affected_path_file_node.py — full-run-safety
  • tests/test_affected_seed_reference_forms.py — impact, full-run-safety
  • tests/test_agents_platform.py — impact, full-run-safety
  • tests/test_alias_folding.py — full-run-safety
  • tests/test_analyze.py — full-run-safety
  • tests/test_anthropic_custom_endpoint.py — full-run-safety
  • tests/test_antigravity_install.py — full-run-safety
  • tests/test_apm_fallback_version.py — full-run-safety
  • tests/test_architecture_doc.py — full-run-safety
  • tests/test_astro_extraction.py — full-run-safety
  • tests/test_astro_import_ids.py — full-run-safety
  • tests/test_atomic_canvas_export.py — full-run-safety
  • tests/test_atomic_version_stamp.py — full-run-safety
  • tests/test_atomic_writes.py — full-run-safety
  • tests/test_backend_env_isolation.py — full-run-safety
  • tests/test_backend_extras.py — full-run-safety
  • tests/test_backend_opt_in.py — full-run-safety
  • tests/test_benchmark.py — full-run-safety
  • tests/test_benchmark_raw_graph.py — full-run-safety
  • tests/test_benchmark_real_query.py — full-run-safety
  • tests/test_binary_media_words.py — full-run-safety
  • tests/test_blade_extractor.py — full-run-safety
  • tests/test_build.py — full-run-safety
  • tests/test_build_located_semantic_identity.py — full-run-safety
  • tests/test_build_merge_dedup_scope.py — full-run-safety
  • tests/test_build_merge_ghost_fold_4955.py — full-run-safety
  • tests/test_build_merge_hyperedges_and_prune.py — full-run-safety
  • tests/test_build_merge_shrink_guard.py — full-run-safety
  • tests/test_builtin_global_type_refs.py — full-run-safety
  • tests/test_c_include_resolution.py — full-run-safety
  • tests/test_cache.py — full-run-safety
  • tests/test_cache_long_paths.py — full-run-safety
  • tests/test_cache_stale_import_target.py — full-run-safety
  • tests/test_cache_windows_case_4925.py — full-run-safety
  • tests/test_callflow_html.py — full-run-safety
  • tests/test_cargo_introspect.py — full-run-safety
  • tests/test_cargo_missing_manifest.py — full-run-safety
  • tests/test_carried_hyperedge_remap.py — full-run-safety
  • tests/test_case_only_decl_ids_4904.py — full-run-safety
  • tests/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.
@danikdanik
danikdanik force-pushed the fix/skill-remaining-substitutions branch from 0fb7cad to 866e5c1 Compare November 18, 2026 09:53
@danikdanik danikdanik changed the title security(skill): sweep remaining paste-the-value placeholders onto sidecar files fix(skill): pass labels, add-URL and clone values through sidecar files Nov 18, 2026
@danikdanik

Copy link
Copy Markdown
Author

Fixed in 866e5c1 — --dir now does Path(args[i + 1]).expanduser() without strip(), restoring the base behavior of passing argv verbatim. Sidecar values already arrive newline-free ($(cat) / .TrimEnd("r","n") in the runbooks), so no strip is needed on the CLI path. Also applied the same TrimEnd fix here that #5306 got flagged for, since this branch shares _cat_to_get_content. (Title also switched to conventional-commits format.)

@github-actions github-actions Bot removed the needs:title PR title should follow the conventional-commit format label Nov 18, 2026

This branch has not been deployed

No deployments
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.

1 participant