Skip to content

fix(skillgen): make --update append to cost.json like the initial build#1934

Open
kimdzhekhon wants to merge 1 commit into
Graphify-Labs:v8from
kimdzhekhon:fix/update-appends-cost-json-1769
Open

fix(skillgen): make --update append to cost.json like the initial build#1934
kimdzhekhon wants to merge 1 commit into
Graphify-Labs:v8from
kimdzhekhon:fix/update-appends-cost-json-1769

Conversation

@kimdzhekhon

Copy link
Copy Markdown

Summary

  • The initial full-build skill flow (core.md Step 8) appends each run to graphify-out/cost.json and updates running totals.
  • The --update (incremental) flow never touched cost.json at all — it only calls save_manifest. So after the first full build, every subsequent graphify update printed its token usage to stdout and discarded it; cost.json stayed frozen on the initial run's single entry forever, matching the symptom in cost.json never appends after the initial run — extract prints token counts but doesn't persist them #1769 exactly.
  • Adds the same append-a-run/update-totals block to the shared references/update.md fragment, right after save_manifest, using new_extraction's token counts and incremental['new_total'] for the file count.
  • Regenerated all 14 per-host update.md artifacts and their tools/skillgen/expected/ snapshots via python -m tools.skillgen && python -m tools.skillgen --bless.

Fixes #1769.

Test plan

  • python -m tools.skillgen --check — clean after regenerating (no drift)
  • uv run pytest tests/test_skillgen.py -q — 58 passed
  • uv run pytest tests/ -q — full suite: 3264 passed (5 pre-existing failures unrelated to this change, missing optional openai dependency in this environment)
  • Manually verified the generated graphify/skills/claude/references/update.md contains the new cost.json block with correct variable references

The initial full-build skill flow (Step 8 in core.md) appends each run
to graphify-out/cost.json and updates the running totals. The --update
(incremental) flow saves the manifest but never touched cost.json at
all, so after the first full build, every subsequent `graphify update`
printed its token usage to stdout and then discarded it — cost.json
stayed frozen on the initial run's single entry forever.

Add the same append-a-run-and-update-totals block to the shared
references/update.md fragment (right after save_manifest), sourced
from new_extraction's token counts and incremental['new_total'] for
the file count. Regenerated the 14 per-host skill-*.md/update.md
artifacts and their tools/skillgen/expected/ snapshots via
`python -m tools.skillgen && python -m tools.skillgen --bless`.

Fixes Graphify-Labs#1769.
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.

cost.json never appends after the initial run — extract prints token counts but doesn't persist them

1 participant