know-code
Read references/question-templates.md, references/levels.md, and references/grading-rubric.md before quizzing or grading.
Flow (range — one quiz per feature branch)
attest-init (once) → range begin → teach → taught (human seal)
→ questions → quiz validate → ask → grade propose (agent) → grade --review (human) → pass (human)
→ commit → range seal → push
0. Range + attest
know-code attest-init # human, once per machine
know-code range begin # pin merge-base — quiz covers all commits until seal
know-code range status # check active session
1. Teach + seal
Run know-code-teach, then human:
know-code taught
Re-seal taught when the diff hash changes.
2. Question quota (agent)
know-code questions --json
know-code questions --template # starter quiz.json skeleton
know-code quiz validate
Write exactly minQuestions entries in .know-code/quiz.json (see quiz docs).
3. Quiz
Agent starts the server; human answers in the browser (not chat):
know-code ask --quiz .know-code/quiz.json
know-code ask --no-open # SSH / headless
4. Agent grading proposal
After ask, read .know-code/answers.json and write .know-code/grade-proposal.json:
know-code grade propose --json # rubric context
Follow references/grading-rubric.md. Never run grade --score or pass.
5. Human review + seal
know-code grade --review
know-code pass
6. Commit + range seal
know-code commit -m "<message>" # or -F file; always adds trailer
know-code range seal # optional: --rewrite (force-push)
Gated by hooks: git commit, git push, gh pr create, glab mr create.
Debugging
know-code status --json
know-code doctor
Hard rules
- Run
know-code questionsbefore writing the quiz - Agent writes
grade-proposal.json; human runsgrade --review - Never forge seals or set
KNOW_CODE_ATTEST_PASSPHRASE/KNOW_CODE_OVERRIDEfrom the agent - Quiz in the browser, not chat
- 2+ commits before push → use
range begin