kdd-scaffold: generate KDD task contracts as a native Tool #4805
MauricioPerera
started this conversation in
Show Your Plugins!
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Repo: https://github.com/MauricioPerera/kdd-scaffold
Fourth plugin in this batch. Complements kdd-gates (#4797): that one validates KDD task contracts, this one generates them.
kdd_scaffoldwritesknowledge/contracts/<task>.md(frontmatter + all 7 required sections) from an oracle test file that must already exist — oracle-first is enforced, not just suggested.Two things that might be useful to anyone building a Tool that mutates files or handles frozen hashes:
ctx.fs, not rawnode:fs. A plugin's host code can reach around the harness's own filesystem seam with zero friction — nothing stops you. Butctx.fs.resolve/stat/readText/writeTextplusctx.waterfall('fs/write-intent', ...)andctx.emit('fs/observed', ...)is what keeps a write inside the same sandbox/observed-state pipeline the agent's own edit tool uses (mirroreddsh-tool-str-replace-editor's own implementation to get this right).tests_sha256is computed here directly from the oracle file's real content (SHA256, LF-normalized) — the same algorithmvalidate_contracts.py --hashuses — instead of accepting it as a tool parameter.Real bug found while verifying it live: an empty
tags: []passesvalidate_contracts.pycleanly but failsvalidate_okf.py(also scansknowledge/contracts/), which requires a non-empty, lowercase tags list. Madetagsa required parameter instead of a silent empty default.Verified end-to-end against the real KDD template repo: scaffold → validate, 0 errors on both gates on the first clean run.
MIT licensed, tagged
dsh-plugin.All reactions