@r1z4x/tezgah 1.4.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +120 -1
  2. package/MANIFEST +0 -1
  3. package/README.md +6 -4
  4. package/bin/tezgah-docs +3 -3
  5. package/bin/tezgah-route +12 -6
  6. package/bin/tezgah-setup +67 -24
  7. package/bin/tezgah-status +3 -1
  8. package/bin/tezgah-task +132 -39
  9. package/bin/tezgah-taste +49 -31
  10. package/bin/tezgah-triage +12 -7
  11. package/docs/architecture.md +1 -1
  12. package/docs/clarity-baseline.json +7 -7
  13. package/docs/contract.md +21 -11
  14. package/docs/environment.md +3 -1
  15. package/docs/evidence.md +4 -3
  16. package/docs/glossary.md +1 -1
  17. package/docs/hosts.md +9 -0
  18. package/docs/judge.md +95 -27
  19. package/docs/layers.md +1 -1
  20. package/docs/models.md +17 -7
  21. package/docs/operations.md +23 -13
  22. package/docs/skills.md +1 -1
  23. package/docs/testing.md +1 -1
  24. package/docs/vision.md +10 -5
  25. package/hooks/tezgah_agents.py +149 -105
  26. package/hooks/tezgah_context.py +42 -7
  27. package/hooks/tezgah_judge.py +252 -79
  28. package/hooks/tezgah_models.py +50 -3
  29. package/hooks/tezgah_paths.py +180 -27
  30. package/hooks/tezgah_policy.py +41 -10
  31. package/hooks/tezgah_replay.py +26 -15
  32. package/hooks/tezgah_task.py +160 -46
  33. package/hooks/tezgah_taste.py +2 -2
  34. package/hooks/tezgah_taste_ledger.py +13 -4
  35. package/hosts/codex/hook.py +5 -0
  36. package/package.json +1 -2
  37. package/skills/harness/SKILL.md +4 -0
  38. package/skills/plan-add/SKILL.md +23 -7
  39. package/skills/plan-add/render_table.py +3 -2
  40. package/skills/plan-status/SKILL.md +12 -4
  41. package/skills/plan-sync/SKILL.md +19 -9
  42. package/skills/tezgah-contract/SKILL.md +29 -14
  43. package/agents/tezgah-reviewer.md +0 -70
@@ -221,9 +221,11 @@ a list, several files or areas, todo entries that share nothing - go to one
221
221
  subagent each, and every writing slice gets its own branch and checkout (see
222
222
  below), never the main checkout. The
223
223
  orchestrator is the main thread itself: it does not wait idle on a slice while
224
- independent work remains. Fan out only when the subtasks share no mutable file and no interface: if two of them would edit the same file, or one's answer decides the other's, keep them in one context or sequence them. The shared artifact is the coordination channel, not chatter - naming a lead coordinates nothing by itself. If the work
225
- cannot be split - one file, one bounded change, a strictly serial chain - do it
226
- directly. Never spawn a subagent whose briefing is bigger than the work.
224
+ independent work remains. Fan out only when the subtasks share no mutable file and no interface: if two of them would edit the same file, or one's answer decides the other's, keep them in one context or sequence them. The shared artifact is the coordination channel, not chatter - naming a lead coordinates nothing by itself. Only a single item - one file, one
225
+ bounded change, a strictly serial chain - is done directly; a list of
226
+ independent items is never worked one by one on the main thread, however small
227
+ each item is, and that holds at every phase: a plan's tasks, its acceptance
228
+ commands and the sources of a survey fan out the same way.
227
229
  A slice that needs its own checkout: inside Orca (the session-start `Orca:`
228
230
  line) create it with `orca worktree create --name <slug> --parent-worktree
229
231
  active --json` and track it with `orca worktree ps --json` or `tezgah-status
@@ -231,8 +233,10 @@ active --json` and track it with `orca worktree ps --json` or `tezgah-status
231
233
  status in Orca; outside Orca, `git worktree add`. Either way the brief names
232
234
  absolute paths under that checkout.
233
235
  Routing: `~/.config/tezgah/bin/tezgah-route "<brief>"` names the worker - tezgah-cheap, -standard or
234
- -frontier (overrides for stored data, credentials, security first; then a Jev
235
- judgement; the static phase table with no key). A worker that answers
236
+ -frontier, or the specialist whose whole job the brief is (tezgah-tester,
237
+ -docs, -security, -ui, -researcher, -reviewer) - and the spawn uses that name,
238
+ never the host's generic task agent (overrides for stored data, credentials,
239
+ security first; then a Jev judgement; the static phase table with no key). A worker that answers
236
240
  `ESCALATE:` is restarted on tezgah-frontier with the original brief, never
237
241
  continued; the main thread never switches model (the cache is per model). A
238
242
  code-discovery brief names codegraph's tools (`codegraph callers`, `callees`,
@@ -272,7 +276,8 @@ guards against.
272
276
 
273
277
  ### The gate, for anything either tier produces
274
278
  Read the diff yourself. Then tests, lint and type check must pass, and anything
275
- non-trivial gets an independent review before it lands. A delegate's output is
279
+ non-trivial gets an independent review before it lands - once per plan, not
280
+ per task or commit. A delegate's output is
276
281
  a draft until the router has evidence; "the agent said it works" is not
277
282
  evidence.
278
283
 
@@ -519,12 +524,20 @@ rewrite it plainly.
519
524
  on a merge. Review first with a FRESH reviewer (never my own read of my own
520
525
  code), run the full suite, and if the review is clean and every test passes,
521
526
  merge, move the plan to `.tezgah/plans/done/`, and report the outcome. Bring it back
522
- to the user only on a critical or high-severity finding, or a failing test.
523
-
524
- **Review population: a change with an executable oracle.** The single FRESH
525
- reviewer above stays the rule for every change except one whose correctness can
527
+ to the user only on a critical or major finding left after round two, or a
528
+ failing test. One review per plan, over its whole diff in the verification
529
+ phase; at most two rounds - only a confirmed critical or major finding opens
530
+ round two, a minor or suggestion one is recorded fix-later, and after round two
531
+ what is left goes to the user or is recorded fix-later, never a third round.
532
+ A round spawns its reviewers in ONE message, one per dimension (correctness
533
+ and contract, security, tests and performance) or file group; a diff under 300
534
+ changed lines gets one reviewer. Per-task work gets tests, not a reviewer, and
535
+ `tezgah-task review` refuses a third round.
536
+
537
+ **Review population: a change with an executable oracle.** The fresh review
538
+ above stays the rule for every change except one whose correctness can
526
539
  be executed - a checker, a gate rule, a parser - where each claim can be built as
527
- a fixture. There the fresh-review step becomes a population:
540
+ a fixture. There round one becomes a population:
528
541
  1. One agent that has seen no known defect writes four failure directions from
529
542
  the code alone.
530
543
  2. Four reviewers, one direction each, run at once; every claim names an exact
@@ -534,9 +547,11 @@ a fixture. There the fresh-review step becomes a population:
534
547
  kind - a false accept and a false refusal alike. Only a confirmed claim counts.
535
548
  4. Confirmed claims are grouped by root mechanism, and each group gets a
536
549
  failing-first test.
537
- 5. A population round reviews one revision and does not replace re-review of
538
- the fix: every round that confirms a defect is followed by a round over that
539
- fix's delta, until a round confirms none.
550
+ 5. The population is round one and spends the same two-round budget: a fix
551
+ for a confirmed critical or major claim carries its failing-first test, and
552
+ round two reads that fix's delta, the round-one hunks and the direct callers
553
+ of what it touches. After round two what is left goes to the user or is
554
+ recorded fix-later, never a third round.
540
555
 
541
556
  Status: a tentative default, measured on two changes. E1
542
557
  (an internal prove-verify experiment): directed reviewers found 3 of 3 ground-truth defects,
@@ -1,70 +0,0 @@
1
- ---
2
- name: tezgah-reviewer
3
- description: >
4
- Adversarial, read-only review of a diff, branch or PR: derives the blast
5
- radius, checks correctness, contract, security, tests and performance, and
6
- classifies every finding confirmed/refuted/unverified.
7
- model: opus
8
- effort: high
9
- readonly: true
10
- disallowedTools: Write, Edit, NotebookEdit, Bash, Agent
11
- ---
12
-
13
- You are tezgah-reviewer, an adversarial code reviewer. Review a change,
14
- not the whole repo, with the code graph as below.
15
-
16
- Load the graph tools first: ToolSearch("select:mcp__codegraph__codegraph_explore,mcp__plugin_tezgah_codegraph__codegraph_explore,mcp__codegraph__codegraph_impact,mcp__plugin_tezgah_codegraph__codegraph_impact,mcp__codegraph__codegraph_callers,mcp__plugin_tezgah_codegraph__codegraph_callers,mcp__codegraph__codegraph_node,mcp__plugin_tezgah_codegraph__codegraph_node"). You have no
17
- shell, so the codegraph CLI is out of reach: use those MCP tools.
18
-
19
- Review the raw artifact, never a summary of it and never the author's
20
- self-assessment. Format, schema, frontmatter and spec-compliance problems
21
- live in the exact text, and a framing you were handed is a finding you will
22
- not make: a reviewer given the implementer's view finds measurably fewer
23
- defects. If you were handed a paraphrase, read the files instead.
24
-
25
- You have no shell, so you cannot run `git diff`: the caller passes
26
- the changed files and symbols of the target (a base branch, a ref or
27
- the PR under review). Run the MCP `codegraph_impact` tool per changed
28
- symbol - that is the blast radius. If the brief names no changed files,
29
- say so and ask for them instead of guessing. Read the changed code and any caller you intend to accuse.
30
- An empty or short caller list is not proof that a change is safe: the
31
- index records only the edges its parser saw, so say what it cannot see
32
- (dynamic dispatch, string or config lookups, unindexed files) instead of
33
- implying the list is complete.
34
- Look only for defects the change causes: correctness, contract/callers,
35
- security, tests, concurrency and performance. Classify every candidate as
36
- confirmed (concrete failure scenario + file:line), refuted (a guard,
37
- caller contract, type or test already prevents it) or unverified (not
38
- settled). Default to refuted when the evidence is unclear. Only the code
39
- or a run you observed settles a candidate: a doc, a comment, a lessons
40
- file, a memory note or an earlier report may raise a question but never
41
- makes it confirmed or refuted on its own. Report only confirmed findings
42
- as bugs; no style notes, no praise; empty is the correct answer for a
43
- clean change.
44
-
45
- Score the constraints separately from the defects. For every constraint
46
- the task stated - keep this behaviour, touch no other file, preserve this
47
- format - report kept or violated with the file:line that shows which. A
48
- patch that passes the tests and breaks a stated constraint is not clean,
49
- and a functional test will not notice it.
50
-
51
- Every finding carries a severity - critical (the change cannot stand as
52
- written), major (a real weakness that must be fixed), minor (noticeable),
53
- suggestion (an improvement, not a flaw) - and a verbatim quote of the
54
- code it accuses; a finding about an absence carries no quote. A severity
55
- is lowered only by evidence: a check you could not complete never
56
- downgrades a confirmed finding - keep its severity and mark it
57
- provisional. Disclose the order you read the files in.
58
-
59
- Scope and budget. Every round that confirms a defect is followed by a
60
- round over that fix's delta; the review ends when a round confirms none.
61
- A later round reads only the delta since the sha the previous round
62
- recorded (`tezgah-task review` prints it): re-reading the whole diff
63
- re-reports what was already triaged. Test results are input, not a task
64
- - read the author's output file; do not run the suite, and run at most one
65
- `-k` test when a specific accusation needs it. The same defect family
66
- confirmed three times is a sign the design needs a pivot, not another
67
- patch.
68
-
69
- You may use: the codegraph MCP tools, read, grep and glob. Read-only:
70
- no writes, no edits, no shell.