Releases: chtnnh/know-code
Releases · chtnnh/know-code
Release list
v0.3.1
0.3.1
Fixes
- Fix the Umami proxy Worker’s script and event request forwarding, including a cache-versioned loader so updated upstream scripts do not depend on a manual Cloudflare cache purge.
- Make push verification walk stacked landed runs against their historical tree pairs, preserving grounded trailer verification after merge commits.
- Harden range-seal binding and status diagnostics so signed receipts stay tied to the correct head and explain stale state precisely.
Release safety
- Verify that the pushed
v…tag exactly matches the CLI package version before npm publication or GitHub Release creation.
Umami proxy provision
- Deploy the Worker before binding
UMAMI_ORIGIN. wrangler-action’ssecrets:input ransecret bulkfirst, which fails when the Worker does not exist yet —wrangler.jsoncstill listed the/s/*route, so git looked provisioned while nothing was uploaded. CI now deploys, thensecret put. - PRs that touch the proxy run unit tests +
wrangler deploy --dry-run; onlymain/workflow_dispatchdeploy.
CI verify on push (stacked-run walker)
know-code verify --from <oid>walksfrom..HEAD, splits byKnow-Code-Verifiedhash, and checks each run as a historical tree-pair (parent-of-first tree → last non-merge). Trailerless merges attach to the run but are not the hash tip, so a GitHub merge commit still matches aftermainmoved. Linear commits without a trailer fail closed. One-non-merge runs also accept the empty-tree (index) hash of that feature tip.- Workflow +
init --workflow+ composite action trigger onpushto the base branch and passgithub.event.before. PR verify is unchanged (head.sha, no--from). All-zerosbeforeskips the walk. - Docs describe the push walk and stop claiming verify cannot run after merge.
v0.3.0
0.3.0
Security — comprehensive exploit hardening (E01–E28)
Major release closing agent TOCTOU and hook-bypass classes discovered after 0.2.1.
Kernel
- Unstaged tracked edits close the gate — index-only hashing no longer leaves the gate open while working-tree edits await
git add/-a gatedTreeOidmandatory — legacygate.jsonwithout it never opens for shipping; re-runknow-code passafter upgrade- Shipping requires index tree ===
gatedTreeOid— blocks partial commits and post-pass tree drift before push - Push requires
HEAD^{tree}===gatedTreeOid— amend/--no-editwith a stale trailer cannot ship a new tree - Cleanliness via
git diff --quiet— never porcelain throughgit().trim()(which corruptedM filestatus lines) know-code commit/amendreject pathspecs — except gated slices:know-code commit -m "…" -- <files>is allowed only while the index tree still equalsgatedTreeOid(see Sliced batches below)
Sliced batches & DevEx
- Sliced batch commits — quiz once, then land a staged batch as multiple
know-code commit -m "…" -- <files>slices; the gate stays open under commit drift while the index tree matchesgatedTreeOidand no unstaged tracked edits exist pass/askpreflight — refuse to run over unstaged tracked edits (quizzing work that isn't in the hash)know-code hash --explain— shows which staged files feed the hash and which unstaged/untracked files are excludedstatusstaleness detail — stale artifacts showartifact hash vs current hashplus the likely cause instead of a bare "stale"doctorlocal-cli check — warns when bareknow-codeon PATH is a stale global instead of the local monorepo build- Actionable gate messages — "Gate seal invalid" split into real causes (unstaged edits, staged tree differs, HEAD moved after seal)
kcbin alias — everyknow-codecommand is also available askc(kc status,kc commit -m "…"); no popular CLI ships akcbinary, and user shell aliases (e.g.alias kc=kubectl) shadow it harmlessly
Hook-safe partial commits (three git-interaction bugs)
GIT_INDEX_FILEstripped from kernel git subprocesses — duringgit commit -- <paths>git exports a temp slice-only index to hooks; the pre-commit check now always hashes the real index (also kills an env-spoofing vector)write-treelock fallback — git holds.git/index.lockmid-commit;materializedTreeOidretries against a temp copy of the index instead of silently returning the empty treeCOMMIT_EDITMSGpre-written byknow-code commit— git only writes it after the pre-commit hook, so the grounded pending-trailer check could never pass on the first commit afterpass- Pre-push accepts the seal-hash trailer — after
range seal --rewrite, HEAD trailers carry the seal hash;check --pushnow accepts it at exactlysealedHeadOidwith a grounded seal — and only in push mode: the seal never authorizes a new pending commit through pre-commit - Fresh
passconsumes superseded range seals — a seal/binding from a previous batch permanently blocked any later non-range commit from shipping (with attest on, nothing else ever cleared it); a successful human pass now removes seal artifacts pinned to a non-HEAD commit or to a tip already reachable fromorigin/<baseBranch>(push happened, seal consumed) — only a just-sealed unpushed tip at HEAD stays rewrite-open
CI & release
know-codeverify workflow is PR-only — on a push to the base branch there is no merge-base ahead of HEAD, so grounded verification is impossible by construction;init --workflowgenerates PR-only triggers- Docs deploy on release tags only — the site always matches a published CLI version
Agent hooks (check-shell.sh + gate-cmd.ts)
Deny in agent context (humans stage/commit outside the agent; agents use know-code commit / amend):
| Denied | Reason |
|---|---|
git commit --amend |
Stale trailer / tree rewrite |
git commit -a/--all/-u/--update |
Auto-stage TOCTOU |
git commit with pathspecs / -C / --reuse-message / --fixup / --squash |
Stale trailer or silent stage |
git add |
Stage unreviewed work |
git add && git commit |
Compound TOCTOU |
git push --no-verify / hooksPath on push |
Skip pre-push |
git merge / cherry-pick / revert / rebase |
Implicit commits |
git stash apply/pop/branch |
Reintroduce unreviewed trees |
git reset --hard |
Rewrite working tree |
Artifacts & config
enforcePipelinedefaults totrue— teaching + quiz pipeline required before pass- Unsigned
sealed-head-binding.jsonignored whenrequireAttest: false(cannot bind HEAD alone) doctor --strict— fails when git hooks outdated/missing or agent hooks absent; warns onrequireAttest: falseand legacy gatesshiprunsdoctor --strictfirst
Tests
- Table-driven exploit matrix (
exploit-matrix.test.ts) covering E01–E28 helpers + kernel cases - Sliced-commit e2e through real hooks — pathspec commits with git's temp index and held
index.lockagainst an installed pre-commit hook - Adversarial suite — forged trailers, agent-minted tokens, stale seals, post-seal drift
Breaking changes
- Re-run
know-code passonce ifgate.jsonlacksgatedTreeOid - Agents cannot use raw
git add/git merge/ etc. — use know-code workflow enforcePipeline: trueby default- Prefer
know-code doctor --strictin CI / before ship - Verify workflow triggers on
pull_requestonly — removepush: branchesfrom existing.github/workflows/know-code.yml(grounded verification has no merge-base on pushes to the base branch)
v0.2.0
0.2.0
Agent-proposed grading (flagship)
grade-proposal.json— agent scores answers afterask; human reviews withknow-code grade --reviewknow-code grade propose --json— rubric context for agents- Sealed
grade.jsonbindsproposalDigest,humanAdjusted,finalScore allowSelfScoreconfig (default false); deprecates honor-systemgrade --score- Skill reference:
grading-rubric.md
Guided UX
know-code doctor— attest, hooks, pipeline, port checksstatus --next—nextStep+blockers[]in status outputknow-code ship— checklist before pushknow-code range continue --yes— start new range after seal (prompt, not silent auto)
CLI robustness
know-code quiz validate·questions --templateconfig set <key> <value>· expandedinitflagscommit -F/--message·know-code amendknow-code reset·range abort --keep-sealhooks install·hooks uninstall— refresh or remove git/agent hooksverify --range-seal·requireTrailerwired in check- Git hooks — pre-commit/pre-push preserve
know-code checkexit code (no false "CLI not found" on gate deny);doctorflags outdated hooks - Commit drift — gate stays valid after
know-code commitwhen tree unchanged (gatedTreeOid); verify acceptshead-trailerhash - Better deny messages with suggested next command
- Corrupt JSON errors for gate/taught/grade/answers
Docs
- New: quiz, grading, workflows, hooks, team, tutorial pages
- Expanded troubleshooting
CI / action
- Action input
require-range-trailers - Docs build in main CI
action/README.md·scripts/bump-release-pins.mjs
v0.1.4
0.1.4
Range workflow (less cumbersome)
know-code range begin— pin merge-base; one quiz covers all commits untilrange sealknow-code range seal— default receipt mode (no history rewrite); optional--rewritestampsKnow-Code-Verifiedon every commit in range (force-push required)- Cumulative range hash (
fromOid...HEAD+ staged) used when a range session is active - Config:
rangeMode(auto|index|range),rangeSeal(receipt|rewrite)
Question quota
know-code questions— agent runs before writingquiz.json;askenforces minimum count from diff size, languages, commit count, and level
Config layering
~/.know-code/config.json— user defaults (optional).know-code/config.json— per-developer repo settings (gitignored; created byknow-code init)- Attest keys live under
~/.know-code/attest/only (never committed) know-code config— show merged effective settings
Enforcement (from earlier 0.1.4 work)
- Human Ed25519 attest seals on
taught/grade/pass/range-seal(requireAttest: truedefault) know-code passrequires taught + answers + grade;KNOW_CODE_OVERRIDEneeds TTYknow-code override
Fixes (post-release)
verify --require-range-trailersreadsrange-seal.jsonafterrange seal --rewritecheckprefers current gate over stale sealed range; honors sealed rewrite for push- Git hooks resolve monorepo
packages/cli/dist/index.jsbefore globalknow-code commit -mparsing forwards-mflag correctly- Docs: config reference page, aligned CLI/skills/CI/troubleshooting across site and READMEs
v0.1.3
0.1.3
Package
- Add
packages/cli/README.mdso the npm package page has documentation know-code skills [--global]wrapsnpx skills add chtnnh/know-codefor project or user-global skill install- Release workflow uses npm Trusted Publishing (OIDC) — no
NPM_TOKEN
Docs
- Document global skill install (
--global/ harness home dirs)