@r1z4x/tezgah 1.0.0 → 1.2.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 (60) hide show
  1. package/CHANGELOG.md +92 -1
  2. package/MANIFEST +10 -0
  3. package/bin/tezgah-agents +10 -1
  4. package/bin/tezgah-docs +1 -1
  5. package/bin/tezgah-doctor +11 -0
  6. package/bin/tezgah-research +31 -14
  7. package/bin/tezgah-setup +154 -29
  8. package/bin/tezgah-skill +59 -0
  9. package/bin/tezgah-skill.py +59 -0
  10. package/bin/tezgah-status +62 -1
  11. package/bin/tezgah-taste +504 -5
  12. package/bin/tezgah-triage +5 -3
  13. package/docs/README.md +1 -0
  14. package/docs/architecture.md +5 -2
  15. package/docs/citations-baseline.json +1 -1
  16. package/docs/clarity-baseline.json +9 -9
  17. package/docs/contract.md +68 -26
  18. package/docs/environment.md +6 -3
  19. package/docs/evidence.md +7 -0
  20. package/docs/gate.md +13 -7
  21. package/docs/glossary.md +1 -1
  22. package/docs/hosts.md +48 -1
  23. package/docs/index.json +34 -3
  24. package/docs/judge.md +75 -60
  25. package/docs/models.md +14 -8
  26. package/docs/operations.md +80 -25
  27. package/docs/orca.md +126 -0
  28. package/docs/research.md +38 -3
  29. package/docs/skills.md +74 -0
  30. package/docs/status-line.md +3 -1
  31. package/docs/testing.md +33 -21
  32. package/docs/vision.md +12 -8
  33. package/hooks/projects-posttooluse.py +7 -0
  34. package/hooks/projects-pretooluse.py +17 -5
  35. package/hooks/tezgah_agents.py +135 -13
  36. package/hooks/tezgah_components.py +3 -0
  37. package/hooks/tezgah_context.py +84 -22
  38. package/hooks/tezgah_gate.py +133 -17
  39. package/hooks/tezgah_integrity.py +60 -13
  40. package/hooks/tezgah_judge.py +288 -66
  41. package/hooks/tezgah_models.py +41 -5
  42. package/hooks/tezgah_orca.py +144 -0
  43. package/hooks/tezgah_paths.py +40 -6
  44. package/hooks/tezgah_policy.py +109 -35
  45. package/hooks/tezgah_research.py +104 -8
  46. package/hooks/tezgah_skill_pick.py +459 -8
  47. package/hooks/tezgah_stack.py +382 -0
  48. package/hooks/tezgah_stopspec.py +2 -2
  49. package/hooks/tezgah_taste.py +35 -9
  50. package/hooks/tezgah_taste_ledger.py +628 -0
  51. package/hosts/codex/hook.py +12 -1
  52. package/hosts/cursor/hook.py +12 -4
  53. package/hosts/omp/hook.py +18 -6
  54. package/hosts/omp/tezgah-hook.ts.in +20 -7
  55. package/hosts/opencode/plugins/tezgah.js +28 -15
  56. package/output-styles/tezgah.md +34 -19
  57. package/package.json +1 -1
  58. package/skills/i-have-adhd/SKILL.md +2 -2
  59. package/skills/research/SKILL.md +60 -17
  60. package/skills/tezgah-contract/SKILL.md +55 -13
@@ -44,6 +44,12 @@ Tezgah maintenance is in scope when the user asks for it, when the repo IS the
44
44
  tezgah checkout, or when tezgah's own check (`tezgah-setup --status`) is the
45
45
  requested task.
46
46
 
47
+ Using the skills is the user's work, not maintenance: before working a topic
48
+ an installed skill covers, run `tezgah-skill <words>` (BM25 over every
49
+ installed skill's sections) and read only the `skill://<name>:<start>-<end>`
50
+ range it returns - or the absolute path beside it on a host that does not
51
+ resolve `skill://` - instead of loading the whole skill.
52
+
47
53
  ## Workspace: `.tezgah/` only
48
54
 
49
55
  Every per-project tezgah artifact - plans, research lines, analysis, lessons -
@@ -140,7 +146,7 @@ prefers shell tools; that preference does NOT cover definitions, callers, or
140
146
  blast radius - those go to the graph. The graph answers from a parsed call
141
147
  graph, so it beats text search on renames, dynamic dispatch and cross-file
142
148
  callers. On Claude a PreToolUse hook denies the Explore subagent here and nudges
143
- the first identifier-shaped Grep per session toward the graph. The MCP tool's
149
+ the first code-symbol search per session toward the graph. The MCP tool's
144
150
  schema is deferred: on the FIRST code-discovery step of the session load it -
145
151
  ToolSearch("select:mcp__codegraph__codegraph_explore,mcp__plugin_tezgah_codegraph__codegraph_explore")
146
152
  (the plain name on a checkout's own server, the `plugin_tezgah_` one on a plugin
@@ -209,9 +215,21 @@ discovery, review, impact analysis (research goes to OpenResearch - see the
209
215
  Research section - with a host subagent only as the fallback when `orx` is
210
216
  absent). Subtasks with no data dependency
211
217
  between them MUST be spawned in ONE message so they run in parallel; dependent
212
- ones run sequentially, each briefed with the previous result. 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
218
+ ones run sequentially, each briefed with the previous result. Fanning out is the
219
+ default, not a favour the user has to ask for: two or more independent items -
220
+ a list, several files or areas, todo entries that share nothing - go to one
221
+ subagent each, and every writing slice gets its own branch and checkout (see
222
+ below), never the main checkout. The
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
213
225
  cannot be split - one file, one bounded change, a strictly serial chain - do it
214
226
  directly. Never spawn a subagent whose briefing is bigger than the work.
227
+ A slice that needs its own checkout: inside Orca (the session-start `Orca:`
228
+ line) create it with `orca worktree create --name <slug> --parent-worktree
229
+ active --json` and track it with `orca worktree ps --json` or `tezgah-status
230
+ --orca` - a raw `git worktree add` gets no card, terminal tracking or agent
231
+ status in Orca; outside Orca, `git worktree add`. Either way the brief names
232
+ absolute paths under that checkout.
215
233
  Routing: `~/.config/tezgah/bin/tezgah-route "<brief>"` names the worker - tezgah-cheap, -standard or
216
234
  -frontier (overrides for stored data, credentials, security first; then a Jev
217
235
  judgement; the static phase table with no key). A worker that answers
@@ -297,10 +315,11 @@ anything explicitly requested. Bug fix = root cause where all callers route
297
315
  through, not the symptom path. A deliberate corner cut gets a `ponytail:`
298
316
  comment naming the ceiling and upgrade path. Output: code first, then at most
299
317
  three short lines (what was skipped, when to add it); how the reply reads otherwise - answer first, at most five ranked items, no preamble - is adhd's.
300
- On the FIRST non-trivial coding task of the session, load the full skill with
301
- Skill(tezgah:ponytail) on Claude, or the installed `ponytail` skill on every
302
- other host - the plugin name is part of the skill name on Claude, and this
303
- summary is not the whole contract.
318
+ Non-trivial logic leaves ONE runnable check (an assert self-check or one small
319
+ test); a complex ask ships the lazy version and names the fuller one in the
320
+ same reply. These rules are in force from the first turn; the full skill
321
+ (Skill(tezgah:ponytail) on Claude, the installed `ponytail` skill elsewhere)
322
+ holds the level table and the examples.
304
323
  Level: `tezgah-pony lite|full|ultra` (bare call shows it; stored in
305
324
  ~/.config/tezgah/ponytail.level, machine-wide until changed). The default `full`
306
325
  adds nothing to this reminder; a non-default level is named in it every turn.
@@ -339,8 +358,10 @@ The reader has to act on the answer, and the friction between "got it" and
339
358
  Break any of these when the ask is an explanation (explain fully, no preamble,
340
359
  no closer), or when a rule would delete the answer itself (an options question
341
360
  gets 2-4 ranked options with one line of trade-off each, recommendation first).
342
- On the FIRST non-trivial answer of the session, read the full `i-have-adhd`
343
- skill from the router - this summary is not the whole contract.
361
+ After three "still broken" turns, name the suspect assumption and ask one
362
+ diagnostic question. Before sending, delete an opening sentence that announces,
363
+ a closing one that recaps, any by-the-way sidebar and any empty hedge. In force
364
+ from the first answer; the full `i-have-adhd` skill holds the examples.
344
365
  Off: `tezgah-adhd off` (the kill switch file), or a repo's `.no-adhd`.
345
366
 
346
367
 
@@ -623,13 +644,31 @@ experiments/variants, or producing a research artifact (report, figure, dataset)
623
644
  It is NOT "where is X defined" or "who calls Y" - that is code discovery and
624
645
  stays on the codegraph index.
625
646
 
647
+ **Lock the line to the question asked.** Restate the user's question verbatim as
648
+ the line's scope (`--ask`) and name what is in it and what is out (`--in`,
649
+ `--out`: state.json `scope`). Every finding answers an in-scope item - a claim's
650
+ `trace` names its `S<n>`, and `tezgah-research check` refuses one that names none -
651
+ and a finding that answers nothing asked is dropped, not reported as a bonus. Do
652
+ not widen the question, add sub-questions or chase an adjacent topic; a tangent
653
+ worth having is one line under Open questions for the user to pick. The question
654
+ picks the method, not the tooling: a qualitative, conceptual or reference question
655
+ is a source review (`--method qualitative`: no metric, no experiment), and a
656
+ metric, a locked evaluation and the experiment tree belong only to a question
657
+ whose answer is a measurement (`--method measured`). A plain factual or reference
658
+ question gets no line at all: answer it in the reply from primary sources. Depth
659
+ is the primary source read, not more breadth - the spec, the paper, the code, the
660
+ vendor's own documentation - each finding citing the source it rests on and
661
+ stating its confidence (high, medium or low, and why); a summary of summaries is
662
+ not an answer.
663
+
626
664
  When the task is research and the OpenResearch CLI is installed, drive it
627
665
  through that CLI instead of ad-hoc local scripting. Resolve it as `orx` on PATH,
628
666
  else `~/.cargo/bin/orx` (the installer's location, which a non-interactive shell
629
667
  does not put on PATH). Load the operating manual first:
630
668
  the `orx` skill if the host has it, otherwise run `orx skill` from the shell; then
631
- the named modules (`orx skill experiment-tree`, `orx skill lit-review`,
632
- `orx skill evidence`, ...). Its cardinal rules are not style preferences - they
669
+ the module the method needs - `orx skill lit-review` for sources,
670
+ `orx skill experiment-tree` and `orx skill evidence` for a measured line. On a
671
+ measured line its cardinal rules are not style preferences - they
633
672
  are what keeps results comparable, and breaking one silently invalidates the run:
634
673
  never edit a node once a run has answered it (branch a child instead); the run
635
674
  command and environment are a fixed contract identical on every node; vary the
@@ -638,7 +677,8 @@ downward, not sideways. Local research needs no login; managed compute does
638
677
  - ask the user to run `orx login`.
639
678
 
640
679
  If the CLI is not installed, say the research tooling is unavailable and do not
641
- improvise its protocol; fall back to a host subagent and say so. Kill switch:
680
+ improvise its protocol; fall back to a host subagent and say so, briefed with the
681
+ question verbatim, its in- and out-of-scope items and its method. Kill switch:
642
682
  `research-off`.
643
683
 
644
684
  Keep the line auditable in the repository, not in your head:
@@ -655,11 +695,13 @@ row, and results rows left append-only; `~/.config/tezgah/bin/tezgah-research in
655
695
  construct and conclusion validity threats, whatever `phase` says. `state.json`
656
696
  `deliverable` names what the line delivers and lists the ask's items, each answered
657
697
  in the report, a decision or a claim `trace`, or written `A<n> not delivered:
658
- <reason>`. A design, plan or analysis is produced as >= 3 variants in
698
+ <reason>`. A design or plan the user will choose between is produced as >= 3
699
+ variants in
659
700
  `decisions/<id>/` - `criteria.json` committed before any cell, `variants.jsonl` (V0
660
701
  the status quo), cells appended by `tezgah-research compare`, `decision.md` naming
661
702
  the chosen id, each rejected id with the criterion that ruled it out, and a `flip:`
662
- condition; a new version of a line is opened `init --supersedes <old>` and carries
703
+ condition (an analysis answers its question once); a new version of a line is
704
+ opened `init --supersedes <old>` and carries
663
705
  the old one as a variant. Code or config variants are sibling orx nodes under one
664
706
  head node. Literature is found with `orx discover` and read with `orx paper`; an
665
707
  agent's summary is indexed as `agent-report` and never alone carries a literature