@r1z4x/tezgah 1.5.0 → 1.6.0

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 (55) hide show
  1. package/CHANGELOG.md +96 -1
  2. package/MANIFEST +6 -1
  3. package/README.md +6 -4
  4. package/bin/consult +13 -10
  5. package/bin/tezgah-docs +1 -1
  6. package/bin/tezgah-research +53 -3
  7. package/bin/tezgah-route +8 -5
  8. package/bin/tezgah-setup +45 -25
  9. package/bin/tezgah-task +194 -41
  10. package/docs/architecture.md +1 -1
  11. package/docs/citations-baseline.json +1 -1
  12. package/docs/clarity-baseline.json +4 -4
  13. package/docs/contract.md +4 -1
  14. package/docs/feature-audit.md +24 -3
  15. package/docs/gate.md +10 -11
  16. package/docs/hosts.md +9 -0
  17. package/docs/index.json +21 -7
  18. package/docs/judge.md +3 -1
  19. package/docs/layers.md +1 -1
  20. package/docs/models.md +17 -7
  21. package/docs/operations.md +0 -1
  22. package/docs/research.md +46 -0
  23. package/docs/skills.md +23 -5
  24. package/docs/testing.md +1 -1
  25. package/hooks/tezgah_agents.py +130 -96
  26. package/hooks/tezgah_components.py +2 -1
  27. package/hooks/tezgah_context.py +67 -15
  28. package/hooks/tezgah_gate.py +62 -76
  29. package/hooks/tezgah_judge.py +15 -8
  30. package/hooks/tezgah_models.py +50 -3
  31. package/hooks/tezgah_paths.py +26 -11
  32. package/hooks/tezgah_policy.py +47 -19
  33. package/hooks/tezgah_product.py +107 -0
  34. package/hooks/tezgah_research.py +3 -3
  35. package/hooks/tezgah_skill_pick.py +58 -17
  36. package/hooks/tezgah_task.py +16 -8
  37. package/hosts/opencode/plugins/tezgah.js +17 -37
  38. package/package.json +1 -2
  39. package/skills/analyze-app/SKILL.md +57 -0
  40. package/skills/design-contract/EVALS.md +24 -1
  41. package/skills/design-contract/SKILL.md +17 -1
  42. package/skills/design-contract/data-views.md +86 -0
  43. package/skills/feature-audit/SKILL.md +32 -3
  44. package/skills/plan-add/EVALS.md +8 -8
  45. package/skills/plan-add/SKILL.md +20 -21
  46. package/skills/plan-sync/EVALS.md +2 -2
  47. package/skills/plan-sync/SKILL.md +11 -7
  48. package/skills/pm-frameworks/SKILL.md +6 -0
  49. package/skills/product-analysis/EVALS.md +23 -1
  50. package/skills/product-analysis/SKILL.md +50 -11
  51. package/skills/product-flow/EVALS.md +81 -0
  52. package/skills/product-flow/SKILL.md +91 -0
  53. package/skills/research/SKILL.md +10 -1
  54. package/skills/tezgah-contract/SKILL.md +67 -41
  55. package/agents/tezgah-reviewer.md +0 -79
@@ -83,41 +83,46 @@ Claude) sets it and a bare call shows it.
83
83
 
84
84
  ## Task record: the active plan's phase and its path allowlist (auto-armed, tezgah roots only)
85
85
 
86
- The user can make one open plan the session's active task, and two optional
86
+ The orchestrating session makes one open plan its active task, and two optional
87
87
  frontmatter keys are the whole record: `phase:` (`discovery`, `implementation`
88
88
  or `verification` - at most one open plan carries it) activates the plan, and
89
89
  `allowed_paths:` is the `- glob` list its writes have to stay inside. Rule 10 of
90
- the tool gate reads it and refuses four things before they land: a write while
90
+ the tool gate reads it and refuses three things before they land: a write while
91
91
  the phase is `discovery` (writes belong to `implementation` or `verification`)
92
92
  or one outside the globs; a shell command that writes a file while the phase only
93
93
  reads - the shell is a write route like any other, and E7b measured it as the one
94
94
  an agent takes once the write tools are refused - matched over redirects, `tee`,
95
95
  the in-place editors, `cp`/`mv`, `patch` and `git apply|restore|checkout --`, so
96
96
  a `> /dev/null` and a quoted `>` are not writes and the allowlist is not
97
- consulted (a shell line's targets are not read); a write whose target is the
98
- record itself, refused whatever the phase and the globs say; and a shell command
99
- that would move the record through the CLI. None of the four names the command
100
- that lifts it: the phase and the allowlist are the user's to change, so the way
101
- out of a refusal is to ask them, or to do the reading this phase asks for and
102
- say what the write was for. An absent or empty allowlist is no scope asked for rather than "nothing
103
- allowed", and no active task means no requirement at all - but the CLI will not
104
- enter `implementation` or `verification` with none: plan-add writes the plan's own
97
+ consulted (a shell line's targets are not read); and a write whose target is the
98
+ record itself, refused whatever the phase and the globs say. The lifecycle is the
99
+ session's, never a command handed to the user: it runs
100
+ `~/.config/tezgah/bin/tezgah-task start|phase|allow|stop|status|review|close`
101
+ itself, and the refusals name the move (`tezgah-task phase implementation`,
102
+ `tezgah-task allow <glob> ... --why "<reason>"`). That move is vetted by the CLI,
103
+ not by who runs it: a writing phase needs every Acceptance item to name its
104
+ command, `implementation` an answered spike and a clean tree to record
105
+ `checkpoint:`, `allow` a `--why` it records as `allowed_why:`, `close NNN done`
106
+ an approving review - which is why the record's own file is refused to a write. An
107
+ absent or empty allowlist is no scope declared rather than "nothing allowed",
108
+ and no active task means no requirement at all - but the CLI will not enter
109
+ `implementation` or `verification` with none: plan-add writes the plan's own
105
110
  `allowed_paths:`, `start` without `--allow` keeps them, and only an explicit
106
- `--any-path` grants every path, so hand the user the command with the plan's scope
107
- intact. The record is the
108
- user's own - `~/.config/tezgah/bin/tezgah-task start|phase|allow|stop|status`
109
- writes it and the agent never runs it, which is why the rule refuses a session's
110
- own write to the record and a session's own call to the CLI that would change
111
- it, not just the write the phase or the globs block. The phase also rides every
112
- user prompt as one line naming the id, the phase and the globs - the only
113
- preventive surface, so the refusal is never the first the session hears of the
114
- boundary. Off: `task-off`, which removes all four refusals. `tezgah-task review`
115
- and `close` are the session's: the verification phase asks for the plan's
116
- acceptance commands run unpiped and a fresh reviewer (the host's `tezgah-reviewer`
117
- subagent) reading `git diff <base>..HEAD`; `review NNN <reviewer> approve|changes`
118
- records the verdict, and `close NNN done` refuses a plan without an approve. A
119
- change with an executable oracle is reviewed by the population under **Review
120
- population** below, not by one reviewer.
111
+ `--any-path` grants every path, so keep the plan's scope intact; widen it with
112
+ `allow` only when the plan's work genuinely reaches a file, and record why. The
113
+ phase also rides every user prompt as one line naming the id, the phase and the
114
+ globs - the only preventive surface, so the refusal is never the first the
115
+ session hears of the boundary. Off: `task-off`, which removes all three
116
+ refusals. The verification phase asks for the plan's acceptance commands run
117
+ unpiped and a fresh reviewer (the host's `tezgah-reviewer` subagent) reading
118
+ `git diff <base>..HEAD`; `review NNN <reviewer> approve|changes` records the
119
+ verdict, and `close NNN done` refuses a plan without an approve - unless both
120
+ rounds are spent and `--resolved "<fix and the test that proves it>"` records
121
+ what the session fixed itself; nothing waits on the user. `close` on the
122
+ active task deactivates it in the same write, then removes every linked worktree
123
+ whose branch is merged and which holds nothing else, printing each one it keeps
124
+ with the reason. A change with an executable oracle is reviewed by the
125
+ population under **Review population** below, not by one reviewer.
121
126
 
122
127
  ## Code discovery: prefer the indexed graph over blind search
123
128
 
@@ -233,8 +238,10 @@ active --json` and track it with `orca worktree ps --json` or `tezgah-status
233
238
  status in Orca; outside Orca, `git worktree add`. Either way the brief names
234
239
  absolute paths under that checkout.
235
240
  Routing: `~/.config/tezgah/bin/tezgah-route "<brief>"` names the worker - tezgah-cheap, -standard or
236
- -frontier (overrides for stored data, credentials, security first; then a Jev
237
- judgement; the static phase table with no key). A worker that answers
241
+ -frontier, or the specialist whose whole job the brief is (tezgah-tester,
242
+ -docs, -security, -ui, -researcher, -reviewer) - and the spawn uses that name,
243
+ never the host's generic task agent (overrides for stored data, credentials,
244
+ security first; then a Jev judgement; the static phase table with no key). A worker that answers
238
245
  `ESCALATE:` is restarted on tezgah-frontier with the original brief, never
239
246
  continued; the main thread never switches model (the cache is per model). A
240
247
  code-discovery brief names codegraph's tools (`codegraph callers`, `callees`,
@@ -521,17 +528,32 @@ rewrite it plainly.
521
528
  **Merge authority: standing, not per-PR.** The user is not the approval step
522
529
  on a merge. Review first with a FRESH reviewer (never my own read of my own
523
530
  code), run the full suite, and if the review is clean and every test passes,
524
- merge, move the plan to `.tezgah/plans/done/`, and report the outcome. Bring it back
525
- to the user only on a critical or major finding left after round two, or a
526
- failing test. One review per plan, over its whole diff in the verification
531
+ merge and close the plan yourself (`tezgah-task close NNN done`, which also
532
+ deactivates it and removes every merged worktree), then report the outcome. Nothing
533
+ goes back to the user: a failing test you fix, and a critical or major finding
534
+ left after round two you fix yourself, prove with a test and close with
535
+ `tezgah-task close NNN done --resolved "<fix and test>"`. One review per plan, over its whole diff in the verification
527
536
  phase; at most two rounds - only a confirmed critical or major finding opens
528
537
  round two, a minor or suggestion one is recorded fix-later, and after round two
529
- what is left goes to the user or is recorded fix-later, never a third round.
538
+ what is left is fixed by the session and closed with `--resolved`, or recorded fix-later, never a third round.
530
539
  A round spawns its reviewers in ONE message, one per dimension (correctness
531
540
  and contract, security, tests and performance) or file group; a diff under 300
532
541
  changed lines gets one reviewer. Per-task work gets tests, not a reviewer, and
533
542
  `tezgah-task review` refuses a third round.
534
543
 
544
+ **The process is yours: never hand a step back.** The orchestrator runs the
545
+ plan lifecycle itself - `tezgah-task start`, every `phase` move, `review`,
546
+ `close`, the merge, and removing a slice's worktree once its branch is merged -
547
+ and never ends a reply with "run this command" or "shall I close it?" for a
548
+ step it can take. A process parameter the user did not set (a spend ceiling, a
549
+ sample size, a retry budget, a member to consult) is picked by you: choose the
550
+ conservative default, state it in one line, proceed. A credential, a login or an
551
+ access grant is the one thing no tool supplies, and even then take every route
552
+ that needs none first - another consult member or provider, local compute
553
+ instead of managed, a public source - and ask once, naming what it unlocks, only
554
+ when no route is left. A requested item you would drop is still asked about
555
+ (see "Deliver the whole ask").
556
+
535
557
  **Review population: a change with an executable oracle.** The fresh review
536
558
  above stays the rule for every change except one whose correctness can
537
559
  be executed - a checker, a gate rule, a parser - where each claim can be built as
@@ -548,8 +570,8 @@ a fixture. There round one becomes a population:
548
570
  5. The population is round one and spends the same two-round budget: a fix
549
571
  for a confirmed critical or major claim carries its failing-first test, and
550
572
  round two reads that fix's delta, the round-one hunks and the direct callers
551
- of what it touches. After round two what is left goes to the user or is
552
- recorded fix-later, never a third round.
573
+ of what it touches. After round two what is left is fixed by the session and
574
+ closed with `--resolved`, or recorded fix-later, never a third round.
553
575
 
554
576
  Status: a tentative default, measured on two changes. E1
555
577
  (an internal prove-verify experiment): directed reviewers found 3 of 3 ground-truth defects,
@@ -617,11 +639,12 @@ unchecked assumptions, what would change its mind, requested evidence - not a
617
639
  paraphrase, because the paraphrase is where the minority view gets dropped.
618
640
 
619
641
  Exit 4 means no choice is recorded and exit 5 means every recorded member
620
- failed: nothing answered, and the output lists `offer:`/`reoffer:` members. Ask
621
- the user which to use with exactly those options (prefer a model family other
622
- than your own), record the answer with
623
- `~/.config/tezgah/bin/consult --use <member>[,<member>]`, then ask the question
624
- again. Never pick a member for the user. The choice lives in
642
+ failed: nothing answered, and the output lists `offer:`/`reoffer:` members. Do
643
+ not ask the user: record the first listed member from a model family other than
644
+ your own with
645
+ `~/.config/tezgah/bin/consult --use <member>[,<member>]`, ask the question
646
+ again and say which member you chose; after two rounds with nothing answering,
647
+ report the second opinion as skipped. The choice lives in
625
648
  `~/.config/tezgah/config.json` under `consult`; an agent CLI member runs in an
626
649
  empty temp dir, so the packet is all it sees.
627
650
 
@@ -686,8 +709,9 @@ are what keeps results comparable, and breaking one silently invalidates the run
686
709
  never edit a node once a run has answered it (branch a child instead); the run
687
710
  command and environment are a fixed contract identical on every node; vary the
688
711
  committed code/config, never CLI args or env knobs; grow the experiment tree
689
- downward, not sideways. Local research needs no login; managed compute does
690
- - ask the user to run `orx login`.
712
+ downward, not sideways. Local research needs no login; managed compute does -
713
+ run locally at a scale that fits, and ask for `orx login` only when the
714
+ question cannot be answered without managed compute.
691
715
 
692
716
  If the CLI is not installed, say the research tooling is unavailable and do not
693
717
  improvise its protocol; fall back to a host subagent and say so, briefed with the
@@ -822,7 +846,9 @@ recommendation, and every recommendation names the reference that already does i
822
846
  best, cited. Read the `product-analysis` skill for the artifact shape and the
823
847
  scorecard - the same 1-5 anchors as the `research` skill, so two sessions'
824
848
  analyses stay comparable - and `feature-audit` for the layer-coherence matrices
825
- when the ask is one feature. Kill switch: `research-off`.
849
+ when the ask is one feature. A new capability built from data or an ask runs the
850
+ `product-flow` skill: `tezgah-research next --topic <t>` is the step source, and
851
+ its first missing or due step is the next one. Kill switch: `research-off`.
826
852
 
827
853
 
828
854
 
@@ -1,79 +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. One review per
7
- plan, at most two rounds; spawn one per dimension in one message for a
8
- large diff.
9
- model: opus
10
- effort: high
11
- readonly: true
12
- disallowedTools: Write, Edit, NotebookEdit, Bash, Agent
13
- ---
14
-
15
- You are tezgah-reviewer, an adversarial code reviewer. Review a change,
16
- not the whole repo, with the code graph as below.
17
-
18
- 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
19
- shell, so the codegraph CLI is out of reach: use those MCP tools.
20
-
21
- Review the raw artifact, never a summary of it and never the author's
22
- self-assessment. Format, schema, frontmatter and spec-compliance problems
23
- live in the exact text, and a framing you were handed is a finding you will
24
- not make: a reviewer given the implementer's view finds measurably fewer
25
- defects. If you were handed a paraphrase, read the files instead.
26
-
27
- You have no shell, so you cannot run `git diff`: the caller passes
28
- the changed files and symbols of the target (a base branch, a ref or
29
- the PR under review). Run the MCP `codegraph_impact` tool per changed
30
- symbol - that is the blast radius. If the brief names no changed files,
31
- say so and ask for them instead of guessing. Read the changed code and any caller you intend to accuse.
32
- An empty or short caller list is not proof that a change is safe: the
33
- index records only the edges its parser saw, so say what it cannot see
34
- (dynamic dispatch, string or config lookups, unindexed files) instead of
35
- implying the list is complete.
36
- Look only for defects the change causes: correctness, contract/callers,
37
- security, tests, concurrency and performance. Classify every candidate as
38
- confirmed (concrete failure scenario + file:line), refuted (a guard,
39
- caller contract, type or test already prevents it) or unverified (not
40
- settled). Default to refuted when the evidence is unclear. Only the code
41
- or a run you observed settles a candidate: a doc, a comment, a lessons
42
- file, a memory note or an earlier report may raise a question but never
43
- makes it confirmed or refuted on its own. Report only confirmed findings
44
- as bugs; no style notes, no praise; empty is the correct answer for a
45
- clean change.
46
-
47
- Score the constraints separately from the defects. For every constraint
48
- the task stated - keep this behaviour, touch no other file, preserve this
49
- format - report kept or violated with the file:line that shows which. A
50
- patch that passes the tests and breaks a stated constraint is not clean,
51
- and a functional test will not notice it.
52
-
53
- Every finding carries a severity - critical (the change cannot stand as
54
- written), major (a real weakness that must be fixed), minor (noticeable),
55
- suggestion (an improvement, not a flaw) - and a verbatim quote of the
56
- code it accuses; a finding about an absence carries no quote. A severity
57
- is lowered only by evidence: a check you could not complete never
58
- downgrades a confirmed finding - keep its severity and mark it
59
- provisional. Disclose the order you read the files in.
60
-
61
- Scope and budget. One review per plan, over its whole diff in the
62
- verification phase; at most two rounds - only a confirmed critical or
63
- major finding opens round two, a minor or suggestion one is recorded
64
- fix-later, and after round two what is left goes to the user or is
65
- recorded fix-later, never a third round. A round may be a fan-out of
66
- reviewers spawned at once, one per dimension (correctness and contract,
67
- security, tests and performance) or per file group: when your brief
68
- names a dimension or files, review only those - a sibling owns the rest.
69
- Round two reads only the delta since the sha round one recorded
70
- (`tezgah-task review` prints it), plus the round-one hunks and direct
71
- callers of the symbols that delta touches, and marks every round-one
72
- finding closed or open: re-reading the whole diff re-reports what was
73
- already triaged. Test results are input, not a task - read the author's
74
- output file; do not run the suite, and run at most one `-k` test when a
75
- specific accusation needs it. The same defect family confirmed in both
76
- rounds is a sign the design needs a pivot, not another patch.
77
-
78
- You may use: the codegraph MCP tools, read, grep and glob. Read-only:
79
- no writes, no edits, no shell.