@etiquekit/etq 1.0.9 → 1.0.11

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.
@@ -0,0 +1,77 @@
1
+ # Operator Playbook
2
+
3
+ You are the principal. Agents execute; **you decide.** This is the when-X-do-Y
4
+ card for running the workflow on the go. (`AGENTS.md` tells agents how to
5
+ behave — this file tells *you* what move to make.)
6
+
7
+ ## Starting work
8
+
9
+ - **Before dispatching, shape the task**: one agent or several? does review need
10
+ a separate mind? is checking cheap? If it's a judgment call — keep it yourself.
11
+ - **Write the envelope, always**: `allowed_writes`, validation, stop conditions,
12
+ pinned base commit. The envelope *is* the speed — it's what lets an agent run
13
+ unattended and lets you trust the result.
14
+ - **One task, one worktree, one branch.** Never work on a shared checkout.
15
+
16
+ ## While an agent works
17
+
18
+ - **Don't add a second writer to the same scope.** Design can be parallel;
19
+ writing is single-writer. Resist "helping" in its files.
20
+ - **Don't steer mid-run.** Post an amendment packet instead; the agent's
21
+ stop-conditions are your remote control.
22
+ - Long silence ≠ progress. Check the session notes, not the vibe.
23
+
24
+ ## When a return arrives
25
+
26
+ - **An agent STOPPED or COUNTERED? That is the system working.** Read its
27
+ evidence, then uphold or amend — never bulldoze past it. A lying green is
28
+ worse than an honest red.
29
+ - **Self-reported evidence is a claim, not a proof.** Before landing anything
30
+ that matters, get a second party to re-run the checks — runtime proof beats
31
+ reading code beats trusting a summary.
32
+ - **Review the diff against the envelope**: files outside `allowed_writes` are
33
+ red flags even when the code looks good.
34
+
35
+ ## The reviewer moment (the most-missed nudge)
36
+
37
+ - **Branch ready → spin exactly one reviewer.** Read-only audit, a *different*
38
+ model/vendor than the implementer, returning evidence and proposed
39
+ amendments — never edits, never merges.
40
+ - Never be shy to add **reviewers**; be very shy to add **writers**.
41
+ - A good implementing agent will *ask* you for a reviewer at the right moment.
42
+ Honor the shape it proposes.
43
+
44
+ ## Gates (yours alone)
45
+
46
+ - Merging, closing, promoting, granting scope, spending money, touching
47
+ credentials or production — these never delegate. An agent that "just did it"
48
+ is a defect, not initiative.
49
+ - Before approving: read the evidence, not the summary line.
50
+ - Anything needing secrets, network egress, or real user data is a *perimeter
51
+ decision*, not a task detail. Stop and decide it explicitly.
52
+
53
+ ## Hygiene, on the go
54
+
55
+ - Lost? `etq whereami`. Broken? `etq doctor`.
56
+ - Finish your posts: a half-committed event blocks every other seat.
57
+ - Don't leave counters unanswered overnight — a stopped agent is parked
58
+ capacity waiting on *you*.
59
+ - The urge to skip the envelope for "a quick fix" is how quick fixes become
60
+ incidents. Small task, small envelope — but an envelope.
61
+
62
+ ## The human gate ("what now?")
63
+
64
+ - When an agent stops and waits, ask: **is this a stall or a gate?** A good
65
+ agent tells you; if it doesn't, ask "gate or stalled?" before nudging.
66
+ - **"continue" / "proceed" are nudges, not authority.** Never let them double
67
+ as approval. A gated act needs its own *named phrase* — a good agent mints
68
+ one ("say 'accept and land' to merge"); echo it exactly or refuse it.
69
+ - At a gate, demand the card: what's decided, the options, the evidence, the
70
+ phrase. Deciding from a summary line is how gates rubber-stamp themselves.
71
+
72
+ ## When you're the bottleneck
73
+
74
+ - Triage by type: **decisions** (only you) → **reviews** (route one reviewer) →
75
+ **FYI** (skim). Work the decisions first.
76
+ - If the same nudge keeps recurring, it belongs in a stop-condition or a
77
+ template — encode it once instead of remembering it nightly.
package/docs/README.md CHANGED
@@ -11,6 +11,7 @@ References:
11
11
 
12
12
  - [CODEX_CLIENT_COMPATIBILITY.md](CODEX_CLIENT_COMPATIBILITY.md)
13
13
  - [RELEASE_SURFACE_AUDIT.md](RELEASE_SURFACE_AUDIT.md)
14
+ - [INTEGRATION_UI.md](INTEGRATION_UI.md) — building a UI/consumer over the event log and packets
14
15
 
15
16
  Source checkouts also keep hosted parity, portal, managed-runtime parity, and root kernel notes for
16
17
  maintainers. They are not part of the local devkit tarball.
@@ -7,7 +7,7 @@ Start with one project owner and one review seat. Add runtime-specific seats onl
7
7
  1. Install project-local agent guidance with `setup`.
8
8
  2. Initialize the project with `bootstrap local`.
9
9
  3. Read `AGENTS.md`, `BOARD.md`, `SESSION_PICKUP.md`, and `SEAT_OPERATING_MANUAL.md`.
10
- 4. Run `whereami`, `doctor`, and `status`.
10
+ 4. After resume or runner/model swaps, run `resume check`; otherwise run `whereami`, `doctor`, and `status`.
11
11
  5. Confirm the lead and review seats.
12
12
  6. Use `$etiquette-seat-lifecycle` before pickup after stale context, resume, runner/model/profile swaps, or workflow migration.
13
13
  7. Have the lead seat `join` and `pickup` the first generated task.
@@ -18,6 +18,7 @@ Start with one project owner and one review seat. Add runtime-specific seats onl
18
18
  ```sh
19
19
  etiquette setup --target codex --project "$PWD"
20
20
  etiquette bootstrap local --project "$PWD" --profile codex-cc-gemini --task-prefix APP
21
+ etiquette resume check --project "$PWD" --seat codex-seat --task APP-001 --json
21
22
  etiquette whereami --project "$PWD" --seat codex-seat --task APP-001
22
23
  etiquette doctor --project "$PWD"
23
24
  etiquette status --project "$PWD"
@@ -96,5 +97,4 @@ Remote execution is a later layer. Plane provisioning is infra-admin scoped. Wor
96
97
  - Start with the smallest useful topology.
97
98
  - Add seats because work requires them.
98
99
  - Product-write authority requires a task, allowed writes, validation, and the right promotion gate.
99
- - Chat is not canonical record.
100
- - Runtime packs are adapters, not doctrine.
100
+ - Chat is not canonical record; runtime packs are adapters, not doctrine.
@@ -0,0 +1,95 @@
1
+ # Tag-Route v0 — paste a thread, get a bounded draft card
2
+
3
+ Tag-Route turns a pasted chat thread into a **draft task-bundle.v1 card**.
4
+ It is an entry door into the existing card lifecycle, not a new lifecycle:
5
+ drafts are non-canonical until promoted through normal pickup/return
6
+ discipline, and nothing in this path grants authority.
7
+
8
+ ## Vocabulary: card vs bundle
9
+
10
+ - **Task card** (`task-envelope.v0`) — the local work envelope under
11
+ `docs/work/tasks/`. Pickup, allowed writes, validation, receipts.
12
+ - **Task bundle** (`task-bundle.v1`) — the same envelope lineage, extended
13
+ with namespaced interop fields (`strategy_policy`, `execution_hints`,
14
+ `requirements`, `preflight_refs`, `budgets`, `provenance_window`,
15
+ `requested_by`). Every shipped task card already validates as a bundle.
16
+ - Bundles are **strictly declarative**. Script-bearing fields
17
+ (`pre_execute`, `run`, `shell`, `script`, `hooks`, ...) are rejected.
18
+ Bundles may only *reference* preflights the executor already holds
19
+ (`etq://preflights/<id>`); unknown refs refuse pickup.
20
+
21
+ ## Registries (declared, admin-signed, verified-never-authored)
22
+
23
+ - `.etiquette/bindings.yaml` — `channel-binding-registry.v1`. Each
24
+ `channel-binding.v1` entry binds a chat channel to one repository, the
25
+ write envelope compiled cards may declare, and the seat to notify.
26
+ - `.etiquette/roster/mappings.yaml` — `roster-mapping-registry.v1`. Each
27
+ `roster-mapping.v1` entry maps a chat user id to a seat card ref.
28
+
29
+ Unknown channel and unknown requesting user are refusals, not fallbacks.
30
+
31
+ ## Walkthrough: paste a thread
32
+
33
+ 1. Declare the registries once (admin act):
34
+
35
+ ```yaml
36
+ # .etiquette/bindings.yaml
37
+ schema: channel-binding-registry.v1
38
+ bindings:
39
+ - schema: channel-binding.v1
40
+ channel_id: team-help
41
+ repository_ref: github.example/org/demo-app
42
+ allowed_writes: [src/checkout/**]
43
+ notify_ref: impl-seat
44
+ admin_signature: sha256:<hex>
45
+ ```
46
+
47
+ 2. Verify them any time:
48
+
49
+ ```sh
50
+ etiquette tag bindings verify --project .
51
+ etiquette tag roster resolve U12345 --project .
52
+ ```
53
+
54
+ 3. Save the chat thread as plain text, one `<user>: <message>` per line,
55
+ then compile (or pipe it via `-`):
56
+
57
+ ```sh
58
+ etiquette tag compile thread.txt --channel team-help --project .
59
+ ```
60
+
61
+ 4. The compiled draft lands under `docs/work/drafts/<task-id>.yaml` with
62
+ `content_class: draft` and `authority: "false"`. Compile is the
63
+ canonicalization moment: the card cites its `provenance_window`
64
+ (line range + sha256 of the transcript slice) so chat-sourced context
65
+ stays auditable without ever becoming a startup doc.
66
+
67
+ 5. The bound seat gets a wake notice on the existing notify queue
68
+ (`etiquette notify poll --seat impl-seat`). Promotion of the draft into
69
+ a real task card remains a separate, gated act by an authorized seat.
70
+
71
+ ## Refusals (machine-checked)
72
+
73
+ - Channel not in `bindings.yaml` -> `unknown channel`.
74
+ - Requesting user (first speaker, or `--user`) not in the roster ->
75
+ `unknown requesting user` plus an enrollment hint.
76
+ - Execution content in the window (script-bearing directives, fenced
77
+ shell blocks) -> `execution content rejected`. The final card is also
78
+ re-validated against the bundle schema, which rejects script-bearing
79
+ fields wherever they nest.
80
+
81
+ ## Security contract: executor inertness
82
+
83
+ The pickup/return executor treats the envelope as data. The only executable
84
+ surfaces are `validation` (sanctioned gate commands) and executor-held
85
+ `preflight_refs`. Every other field — `execution_strategy`, `rig_conductor`,
86
+ `topology_constraints`, `expected_return`, and any nested script-bearing key —
87
+ is inert: read, projected, printed, never executed. The executor spawns only
88
+ hard-coded programs; no shell interprets a bundle string. Pinned by
89
+ `contracts/tag-route-inertness.test.ts` (behavioral trap + static pin).
90
+
91
+ ## Out of scope in v0
92
+
93
+ The always-on chat listener is a hosted-plane concern and ships
94
+ separately. It will call this same compile path; nothing in v0 assumes it
95
+ exists. A pasted transcript keeps the whole flow local and testable.
@@ -33,11 +33,17 @@ Agent resume restores conversation context. It does not prove repo context.
33
33
  After any resume, run:
34
34
 
35
35
  ```sh
36
+ etiquette resume check --project "$PWD" --seat <seat> --task <task> --json
36
37
  etiquette whereami --project "$PWD" --seat <seat> --task <task>
37
38
  git status -sb
38
39
  git branch --show-current
39
40
  ```
40
41
 
42
+ `resume check` is read-only and fail-closed. It treats the runner resume hash as
43
+ conversation context only, then verifies project, seat, task, lifecycle, and
44
+ session bindings before pickup. If it reports `rebind_required`, use the seat
45
+ rebind and lifecycle skills before reading old session runbooks as assignment.
46
+
41
47
  If the runner asks whether to resume in the old session directory or the
42
48
  current directory, choose the current directory only when it is the intended
43
49
  project worktree for the task. Do not resume a repo-local task inside a global
@@ -59,7 +59,7 @@ the validator:
59
59
  - must carry at least one contemporaneous evidence ref among
60
60
  `refs.commits`, `refs.receipts`, or `refs.artifacts` — evidence that
61
61
  carries its own independent timestamps (git commits are the canonical
62
- witness);
62
+ evidence anchor);
63
63
  - authority class must be `advisory` or `audit` — a late entry never mints
64
64
  grants or execution authority;
65
65
  - one reconciliation entry covering a span with an index artifact is