@brainervirus/workit-pi 7.3.0 → 7.4.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.
package/dist/workit.js CHANGED
@@ -13743,7 +13743,7 @@ function selectMethods(policy, capabilities) {
13743
13743
  }
13744
13744
  var invariantBootstrap = () => `
13745
13745
  Workit is optional coordination and proof tooling around the host: you decide
13746
- what and whether, the \`workit\` CLI does how and records what it observed.
13746
+ what and whether, the CLI does how and records what it observed.
13747
13747
  Native host allow/ask/deny, sandbox and org rules stay authoritative. Never
13748
13748
  switch paths to evade a denial, never claim enforcement a host cannot provide,
13749
13749
  and never fabricate an approval or verdict. A question answer is not
@@ -13764,8 +13764,8 @@ Autonomy contract:
13764
13764
  never edit workspaces.json or route around a grant_required.
13765
13765
  - Ask only for a product or preference choice, or for authority you lack, with
13766
13766
  your recommended answer. Facts are yours: read, run or prototype.
13767
- - Label claims measured (you ran it this session and saw the result),
13768
- inferred, or guess. Prose is a note: only a configured check the CLI ran
13767
+ - Label claims measured (you ran it this session and saw it), inferred, or
13768
+ guess. Prose is a note: only a configured check the CLI ran
13769
13769
  (\`workit check <name>\`) satisfies a gate; an ad-hoc
13770
13770
  \`workit check -- <cmd>\` never does.
13771
13771
  - Author is not verifier: your own verdict is \`--self\` (after an observed
@@ -13777,23 +13777,21 @@ Autonomy contract:
13777
13777
  reconcile every requested item and observe it (\`workit verify-delivery\`).
13778
13778
 
13779
13779
  CLI first: if a step has one right answer, use the \`workit\` verb instead of
13780
- hand-running git, gh or glab: check, git, pr, ci, stack, verify-delivery,
13781
- ledger, handoff, test-audit (\`workit help <verb>\`; without \`workit\` on
13782
- PATH, \`npx -y @brainervirus/workit-cli\`). \`busy\` is retryable
13783
- (\`workit doctor --fix-lock\` clears a dead lock); \`blocked\` names its unblock.
13780
+ hand-running git, gh or glab (\`workit git|pr|ci|check\`; \`workit help\` lists
13781
+ the rest; without \`workit\` on PATH, \`npx -y @brainervirus/workit-cli\`).
13782
+ \`busy\` is retryable (\`workit doctor --fix-lock\` clears a dead lock).
13784
13783
  The task families (task, policy, evidence, finding, decision, worker, state)
13785
13784
  are optional continuity for tracked work; each branch has one implicit task
13786
13785
  that the first recording creates, and a solo edit needs no task. A decision
13787
13786
  records a user choice; it never authorizes an effect. Judge work once with
13788
13787
  \`workit policy assess --judge risk= behavior= product-choice= plan=\`; an
13789
13788
  open choice or missing plan blocks edits until recorded.
13790
- Omit revisions; a revision_conflict means one you passed is stale, so re-read.
13789
+ Omit revisions; on a revision_conflict, re-read.
13791
13790
  Across repositories, bind each item to its checkout, branch and endpoint,
13792
13791
  resolve competing targets before a mutation, and reconcile an uncertain
13793
13792
  external effect before retrying it.
13794
13793
 
13795
- Mid-task input: answer a quick question in place, fold an adjustment in, and
13796
- never silently drop or resume an objective (workit-continue).
13794
+ Mid-task: never silently drop or resume an objective (workit-continue).
13797
13795
 
13798
13796
  Skills: load the skill, never act from memory of it (slash aliases /wk-<name>).
13799
13797
  - brainstorm, plan, spec, grill, should we: workit-shape
@@ -13807,6 +13805,7 @@ Skills: load the skill, never act from memory of it (slash aliases /wk-<name>).
13807
13805
  - deslop, slop, dead code: workit-deslop
13808
13806
  - fan out, parallelize, parallel agents, swarm: workit-fanout
13809
13807
  - verify the app, smoke test, prove it works: workit-verify-app
13808
+ - retro (user-invoked; offer it): workit-retro
13810
13809
  `.trim();
13811
13810
 
13812
13811
  // packages/workit-core/src/core/task-context.ts
@@ -19049,7 +19048,8 @@ var WORKIT_SKILL_ALIASES = {
19049
19048
  "wk-test-audit": "workit-test-audit",
19050
19049
  "wk-deslop": "workit-deslop",
19051
19050
  "wk-fanout": "workit-fanout",
19052
- "wk-verify-app": "workit-verify-app"
19051
+ "wk-verify-app": "workit-verify-app",
19052
+ "wk-retro": "workit-retro"
19053
19053
  };
19054
19054
  if (false) {}
19055
19055
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-pi",
3
- "version": "7.3.0",
3
+ "version": "7.4.0",
4
4
  "description": "Workit native extension for Pi — tools, method skills, and session continuity",
5
5
  "keywords": [
6
6
  "agentic-coding",
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: workit-retro
3
+ description: Find repeated friction in recent sessions; propose cited fixes ranked by enforcer strength, never applied. Use for retro.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Retro: turn repeated friction into enforcers
8
+
9
+ User-invoked: offer it, never start it yourself. Run it after a session, PR,
10
+ stack or fan-in, including ones that went well; a smooth session still shows
11
+ where agents searched too long, worked around a tool or re-ran a check. Retro
12
+ proposes and stops. Nothing changes until the user approves.
13
+
14
+ 1. **Scope.** Default: this repository's work since the last retro (its
15
+ `retro:` row in `workit ledger list --type decision`), else the last ~10
16
+ sessions. State the window in one line.
17
+ 2. **Read through workit, cheapest first.** Every finding cites these:
18
+ - `workit ledger list --last 200`: rulings (ambiguities the agent had to
19
+ settle), failed or self verdicts, handoffs, check runs, CI reruns.
20
+ - `workit pr status --pr <n>` for each recent PR: threads, failing checks.
21
+ - `git log --oneline -50`, plus reverts and fixups after review.
22
+ - `workit knowledge lint`: today's AGENTS.md and need-based files.
23
+ - Session transcripts **only if the user opts in**, and only this
24
+ workspace's (`references/sources.md`). Never read other projects.
25
+
26
+ Cite by location (ledger row, PR, commit, session file and line). Never
27
+ copy secrets, tokens or personal data from any source into the report.
28
+ 3. **Group into classes.** Navigation cost (many searches before the right
29
+ file, a stale doc followed), repeated mistakes, workarounds (a hand-run
30
+ command where a verb exists, a skipped step), unstable checks (the same
31
+ `workit check <name>` red then green with no change). A class needs **2 or
32
+ more cited occurrences**; a one-off is not a learning.
33
+ 4. **Name the strongest enforcer that works**, strongest first: architecture
34
+ or types (the mistake cannot be written) > lint rule > configured check
35
+ (`workit.checks.json`, `workit check <name>`) or CI job > test >
36
+ `CODING_STANDARDS.md` (judgment the reviewer reads) > AGENTS.md pointer
37
+ (navigation only). A mechanical rule gets a check, not prose: a check can
38
+ fail, a sentence cannot. From types to test, the proof is that the new
39
+ enforcer fails on the cited past mistake. A rule whose mistake can no
40
+ longer happen is deleted.
41
+ 5. **Upstream.** When a workit skill, verb or hook caused the friction,
42
+ propose an issue or PR on BrainerVirus/workit. Never fork a local copy.
43
+ The issue shows the workit behavior in a minimal synthetic reproduction:
44
+ no private repo name, path, code, ledger text, PR or thread quote, or
45
+ transcript. Show the exact draft body; file it only after the user approves.
46
+ 6. **Bloat guards.** AGENTS.md stays within 8 KB: each addition names what it
47
+ removes. Create `CODING_STANDARDS.md` or `GLOSSARY.md` only in the same
48
+ edit as its first real entry, never as a scaffold. Edit steering text by
49
+ `references/steering.md`; `workit knowledge lint` passes after the slice.
50
+ 7. **Report one ranked list, then stop:** Accepted (proposed), Backlog,
51
+ Dropped, each with its citations, enforcer and reason. Each approved item
52
+ becomes a normal slice (workit-implement, then workit-ship), a tracker
53
+ issue, or `.out-of-scope/<concept>.md` when rejected and likely to return.
54
+ Record the user's answer so the next retro starts there:
55
+ `workit ledger decision "retro: <accepted ids>" --why "<window>"`.
56
+
57
+ ## Example
58
+
59
+ Bad: "Agents seem lost in the build. Added 'read the build docs carefully' to
60
+ AGENTS.md." One vague occurrence, no citation, a no-op line, auto-applied.
61
+
62
+ Good: "Navigation, 3 occurrences (rulings 12, 19; PR #88 thread): agents sought
63
+ check names in package.json, missing `workit.checks.json`. Enforcer: AGENTS.md
64
+ pointer, +74 bytes, minus the stale Commands paragraph (-210). Unstable check,
65
+ 2 occurrences (ledger rows 31, 44: `e2e` red then green on one SHA): a debug
66
+ slice to fix the check. Approve?"
67
+
68
+ ## Check
69
+
70
+ ```sh
71
+ workit knowledge lint # exit 0 before and after each approved slice
72
+ ```
@@ -0,0 +1,3 @@
1
+ # Codex: user-invoked only (the counterpart of disable-model-invocation).
2
+ policy:
3
+ allow_implicit_invocation: false
@@ -0,0 +1,35 @@
1
+ # Session transcripts (opt-in, this workspace only)
2
+
3
+ Transcripts are the most expensive source and can hold private material. Read
4
+ them only after the user says yes to a question such as "Also read the last 10
5
+ session transcripts for this workspace? (local files, read-only)". The default
6
+ is no: the ledger, `pr status` and git are enough for most retros.
7
+
8
+ ## Where they live
9
+
10
+ Typical locations; confirm each exists. Resolve the path from this workspace's
11
+ absolute path, never with a wildcard across projects. If a host's layout
12
+ differs from the one below, say so and skip it rather than search wider.
13
+
14
+ | Host | Location |
15
+ | --- | --- |
16
+ | Claude Code | `~/.claude/projects/<folder>/*.jsonl`, one folder per path from `git worktree list`: the absolute path with every `/` and `.` replaced by `-`. Compute each folder name; never glob for it |
17
+ | Codex | `~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl`. To filter, parse only line 1 (`session_meta`) and read only its `cwd` field; skip files whose `cwd` is not this workspace without reading or reporting anything else from them |
18
+ | Cursor | `~/.cursor/projects/<workspace slug>/agent-transcripts/` |
19
+ | Pi | `~/.pi/agent/sessions/--<workspace path, / replaced by ->--/*.jsonl` |
20
+ | OpenCode | this project's sessions from `opencode session list`, read with `opencode export <id>` |
21
+
22
+ Linked worktrees of the same repository count as this workspace; other
23
+ repositories never do.
24
+
25
+ ## How to read them
26
+
27
+ - Newest first, at most the agreed number of sessions.
28
+ - On a host with subagents, one read-only analyst per lens, each returning
29
+ only cited occurrences (session file plus line or message index):
30
+ - navigation: searches and reads before the right file was found, stale docs
31
+ followed;
32
+ - tool economy: hand-run commands where a `workit` verb exists, repeated
33
+ reads of the same file, long outputs nobody used;
34
+ - repeated work: the same fix or check redone, a step undone later;
35
+ - request conflicts: instructions the agent had to reconcile or ask about.
@@ -0,0 +1,39 @@
1
+ # Editing steering text (AGENTS.md, CODING_STANDARDS.md, skills)
2
+
3
+ Steering text is paid for on every session that reads it. Each line must
4
+ change what an agent does; everything else is cost.
5
+
6
+ ## Write
7
+
8
+ - **Point, do not copy.** Link the file or name the command; never paste its
9
+ content. A pointer says when to follow it: "Read before editing a hook:
10
+ `docs/agents/hosts.md`".
11
+ - **Say what done looks like.** "Run `bun run check`; it must exit 0" beats
12
+ "make sure everything works".
13
+ - **Concrete over adjectives.** A command, a path, a number. Prefer the action
14
+ to take over a list of things to avoid.
15
+ - **One rule, one home.** A rule with an enforcer (type, lint, check, test)
16
+ appears in steering text at most as a pointer to that enforcer. The same
17
+ sentence in AGENTS.md and CODING_STANDARDS.md is a defect
18
+ (`duplicate-rule`).
19
+ - **Judgment goes to CODING_STANDARDS.md**, which the reviewer reads; only
20
+ navigation goes to AGENTS.md.
21
+
22
+ ## Cut
23
+
24
+ - **No-ops.** Delete lines that would not change any behavior if removed:
25
+ "be thorough", "write clean code", "keep it concise", "follow best
26
+ practices".
27
+ - **Session residue.** No notes about one session, no implementation detail
28
+ the code already shows, no `path:line` references (they go stale).
29
+ - **Dead rules.** A rule whose mistake can no longer happen (a type or check
30
+ now prevents it) is deleted, not kept "for context".
31
+
32
+ ## Budget
33
+
34
+ - AGENTS.md stays within 8 KB (`workit knowledge lint`, rule
35
+ `agents-budget`). A proposal that adds text names what it removes, or shows
36
+ the byte count still holds.
37
+ - A need-based file (`CODING_STANDARDS.md`, `GLOSSARY.md`) is created in the
38
+ same edit as its first real entry. Headers-only or "TBD" files fail the lint
39
+ (`scaffold-file`).
@@ -18,8 +18,9 @@ independent; `type-check-only` never proves a behavior change.
18
18
  3. Judge two axes separately, never merged or re-ranked:
19
19
  - **Spec:** does the diff do what the acceptance says? Missing, creep or
20
20
  wrong; quote the line.
21
- - **Standards:** repo rules first, then a smell baseline (unclear name, long
22
- function, duplicated logic, leaky abstraction). Judgment only; lint owns nits.
21
+ - **Standards:** repo rules first (`CODING_STANDARDS.md` when present),
22
+ then a smell baseline (unclear name, long function, duplicated logic,
23
+ leaky abstraction). Judgment only; lint owns nits.
23
24
  4. **Tests:** `workit test-audit --diff`. Would each new test fail if the
24
25
  behavior broke? Triage with workit-test-audit.
25
26
  5. **Blast radius:** for each touched contract, caller, config or migration,
@@ -10,11 +10,14 @@ user asks for one, say which trigger fired, and let the user decline.
10
10
  | Plan | more than one slice with dependencies, or work that will be resumed by someone else | `docs/<topic>/plan.md`, next to the spec |
11
11
  | ADR | the choice is hard to reverse **and** surprising **and** a real trade-off (all three) | `docs/adr/NNNN-<slug>.md` |
12
12
  | Glossary entry | a project term was ambiguous and you resolved it | `GLOSSARY.md` (create lazily) |
13
+ | Coding standard | a judgment-call rule a reviewer must check, recurring twice (workit-retro); a mechanical rule gets a check instead | `CODING_STANDARDS.md` (create lazily) |
13
14
  | Out of scope | a request was rejected and is likely to come back | `.out-of-scope/<concept>.md` |
14
15
 
15
16
  Never: a spec for a one-file mechanical fix, a plan that restates the spec,
16
17
  file paths or line numbers in a spec (they go stale), a glossary entry for a
17
18
  general programming term.
19
+ Create a lazy file only in the same edit as its first real entry, never as a
20
+ headers-only or TBD scaffold (`workit knowledge lint` flags one).
18
21
 
19
22
  ## Spec (scaled to the work)
20
23
 
@@ -53,7 +53,8 @@ the base keeps moving, or after 3 failed fix attempts on the same check.
53
53
  6. **Verified.** After the last push a non-author records a verdict
54
54
  (workit-review); `pr status` showing self-reviewed is not verified. Land only when granted: `workit stack land` (the
55
55
  contiguous verified run from the root) or `workit pr merge`.
56
- 7. **Observe it landed:** `workit verify-delivery pr` or `merge`.
56
+ 7. **Observe it landed:** `workit verify-delivery pr` or `merge`. At any endpoint
57
+ (stack land, fan-in too), after a failed verdict or a check red 3+ times: offer `/wk-retro`.
57
58
 
58
59
  ## Example
59
60