@picoai/tickets 0.3.0 → 0.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/.tickets/spec/AGENTS_EXAMPLE.md +2 -0
- package/.tickets/spec/TICKETS.md +20 -11
- package/.tickets/spec/profile/defaults.yml +2 -0
- package/.tickets/spec/version/20260317-2-tickets-spec.md +106 -0
- package/README.md +23 -2
- package/package.json +1 -1
- package/release-history.json +7 -0
- package/src/cli.js +205 -48
- package/src/lib/config.js +14 -0
- package/src/lib/constants.js +4 -1
- package/src/lib/index.js +241 -0
- package/src/lib/listing.js +6 -3
- package/src/lib/planning.js +249 -152
- package/src/lib/projections.js +9 -0
- package/src/lib/validation.js +218 -0
|
@@ -7,6 +7,8 @@ The purpose of this bootstrap is to ensure an agent loads the canonical ticketin
|
|
|
7
7
|
### Required Behavior
|
|
8
8
|
- First action: if your environment supports repo-local skills and `.tickets/skills/tickets/SKILL.md` exists, load that skill. Otherwise open and read `TICKETS.md`.
|
|
9
9
|
- First response: briefly confirm understanding of the ticketing system before starting any implementation work.
|
|
10
|
+
- Before interpreting planning language or creating tickets, consult `.tickets/config.yml` for repo-local defaults and semantic overrides.
|
|
11
|
+
- When the human uses feature/phase/milestone/roadmap or custom repo terms, keep using their vocabulary in the conversation and translate it into the generic CLI planning fields internally.
|
|
10
12
|
- Use the repo-local CLI (`npx @picoai/tickets`) as the integration surface for tickets and logs.
|
|
11
13
|
- Before performing work on a ticket, validate it: run `npx @picoai/tickets validate` (or `npx @picoai/tickets validate --issues` + `npx @picoai/tickets repair`).
|
|
12
14
|
- When logging via the CLI: use `npx @picoai/tickets log --machine` so logs are strictly structured.
|
package/.tickets/spec/TICKETS.md
CHANGED
|
@@ -40,8 +40,8 @@ This repository uses a repo-native ticketing system designed for **parallel, lon
|
|
|
40
40
|
|
|
41
41
|
## Spec version
|
|
42
42
|
- `version`: 3
|
|
43
|
-
- `version_url`: `version/20260317-tickets-spec.md`
|
|
44
|
-
- Local file: `/.tickets/spec/version/20260317-tickets-spec.md`
|
|
43
|
+
- `version_url`: `version/20260317-2-tickets-spec.md`
|
|
44
|
+
- Local file: `/.tickets/spec/version/20260317-2-tickets-spec.md`
|
|
45
45
|
|
|
46
46
|
Version definitions live under `/.tickets/spec/version/`. Each spec file is self-contained and ends with a diff from the previous version.
|
|
47
47
|
|
|
@@ -60,6 +60,7 @@ Repo artifacts:
|
|
|
60
60
|
- `.tickets/config.yml`: authoritative repo-local machine-readable overrides
|
|
61
61
|
- `.tickets/skills/tickets/SKILL.md`: repo skill projection with equivalent workflow semantics
|
|
62
62
|
- `TICKETS.override.md`: optional narrative companion for human-only local policy
|
|
63
|
+
- `/.tickets/derived/planning-index.json`: derived cache used by `list`, `plan`, and `graph`
|
|
63
64
|
|
|
64
65
|
## What this system is
|
|
65
66
|
- A lightweight, Markdown-first ticket format stored under `/.tickets/`
|
|
@@ -96,6 +97,7 @@ Default `init` creates, if missing:
|
|
|
96
97
|
- `npx @picoai/tickets status --ticket <id> --status doing`
|
|
97
98
|
- `npx @picoai/tickets log --ticket <id> --summary "..." --machine --context "..."`
|
|
98
99
|
- `npx @picoai/tickets claim --ticket <id>`
|
|
100
|
+
- `npx @picoai/tickets list --ready --sort lane`
|
|
99
101
|
- `npx @picoai/tickets plan --format json`
|
|
100
102
|
- `npx @picoai/tickets graph --view portfolio`
|
|
101
103
|
|
|
@@ -138,6 +140,7 @@ By default:
|
|
|
138
140
|
- `roadmap` -> `planning.horizon`
|
|
139
141
|
|
|
140
142
|
Repos may override these mappings in `.tickets/config.yml` without changing the core CLI or validation invariants.
|
|
143
|
+
Treat the list above as defaults. Agents should consult `.tickets/config.yml` before interpreting repo-specific planning language or creating tickets.
|
|
141
144
|
|
|
142
145
|
### Worked example
|
|
143
146
|
|
|
@@ -145,7 +148,7 @@ Repos may override these mappings in `.tickets/config.yml` without changing the
|
|
|
145
148
|
---
|
|
146
149
|
id: 0191c2d3-4e5f-7a8b-9c0d-1e2f3a4b5c6d
|
|
147
150
|
version: 3
|
|
148
|
-
version_url: "version/20260317-tickets-spec.md"
|
|
151
|
+
version_url: "version/20260317-2-tickets-spec.md"
|
|
149
152
|
title: "Feature Alpha"
|
|
150
153
|
status: doing
|
|
151
154
|
created_at: 2026-03-17T17:00:00Z
|
|
@@ -190,7 +193,7 @@ resolution: dropped
|
|
|
190
193
|
Claim log example:
|
|
191
194
|
|
|
192
195
|
```json
|
|
193
|
-
{"version":3,"version_url":"version/20260317-tickets-spec.md","ts":"2026-03-17T17:05:00Z","run_started":"20260317T170500.000Z","actor_type":"agent","actor_id":"agent:codex","summary":"Acquired claim 0191c2d3-...","event_type":"claim","written_by":"tickets","claim":{"action":"acquire","claim_id":"0191c2d3-4e5f-7a8b-9c0d-1e2f3a4b5d00","holder_id":"agent:codex","holder_type":"agent","ttl_minutes":60,"expires_at":"2026-03-17T18:05:00Z","reason":""}}
|
|
196
|
+
{"version":3,"version_url":"version/20260317-2-tickets-spec.md","ts":"2026-03-17T17:05:00Z","run_started":"20260317T170500.000Z","actor_type":"agent","actor_id":"agent:codex","summary":"Acquired claim 0191c2d3-...","event_type":"claim","written_by":"tickets","claim":{"action":"acquire","claim_id":"0191c2d3-4e5f-7a8b-9c0d-1e2f3a4b5d00","holder_id":"agent:codex","holder_type":"agent","ttl_minutes":60,"expires_at":"2026-03-17T18:05:00Z","reason":""}}
|
|
194
197
|
```
|
|
195
198
|
|
|
196
199
|
## Ticket definition (`ticket.md`)
|
|
@@ -357,19 +360,25 @@ Primary commands:
|
|
|
357
360
|
- `graph`
|
|
358
361
|
|
|
359
362
|
Listing and reporting:
|
|
360
|
-
- `list`
|
|
361
|
-
- `plan`
|
|
362
|
-
- `graph`
|
|
363
|
+
- `list` is the broad queue/report view. Use it to filter and sort work across the repo.
|
|
364
|
+
- `plan` is the operational board. Use it for ready work, in-progress work, blocked work, and group/checkpoint rollups.
|
|
365
|
+
- `graph` is the structural map. Use it to inspect dependency, sequence, and containment relationships.
|
|
366
|
+
|
|
367
|
+
Derived index:
|
|
368
|
+
- `list`, `plan`, and `graph` maintain a derived planning index at `/.tickets/derived/planning-index.json`
|
|
369
|
+
- the index is disposable cache state
|
|
370
|
+
- the CLI rebuilds it automatically when ticket, log, config, or tool metadata changes
|
|
363
371
|
|
|
364
372
|
## Agent protocol
|
|
365
373
|
|
|
366
374
|
Agents should:
|
|
367
375
|
1. Load the repo skill if supported and present, otherwise read `TICKETS.md`
|
|
368
376
|
2. Open the assigned ticket
|
|
369
|
-
3.
|
|
370
|
-
4.
|
|
371
|
-
5.
|
|
372
|
-
6.
|
|
377
|
+
3. Consult `.tickets/config.yml` for repo-local defaults and semantic overrides before interpreting planning terms or creating tickets
|
|
378
|
+
4. Validate before implementation
|
|
379
|
+
5. Respect `assignment.mode`, `agent_limits`, planning constraints, and active claims
|
|
380
|
+
6. Use `status`, `log`, `claim`, `list`, `plan`, and `graph` through the CLI
|
|
381
|
+
7. If splitting work, create child tickets with copied minimum context and log `created_from`
|
|
373
382
|
|
|
374
383
|
## Safety and hygiene
|
|
375
384
|
- Do not write secrets into tickets or logs
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Ticket Format Spec (Version 3)
|
|
2
|
+
|
|
3
|
+
- Version: 3
|
|
4
|
+
- Version URL: `version/20260317-2-tickets-spec.md`
|
|
5
|
+
- Released: 2026-03-17
|
|
6
|
+
- Status: current
|
|
7
|
+
|
|
8
|
+
## Definition (format and derived tooling contract)
|
|
9
|
+
This version defines the ticket, repo config, log, and derived planning-index contracts used by this repo. Workflow policy and narrative guidance live in `TICKETS.md`.
|
|
10
|
+
|
|
11
|
+
### Ticket front matter (required)
|
|
12
|
+
- `id`: lowercase UUIDv7 string
|
|
13
|
+
- `version`: format version (integer)
|
|
14
|
+
- `version_url`: path to this definition (repo-local, relative to `.tickets/spec/`)
|
|
15
|
+
- `title`: string
|
|
16
|
+
- `status`: `todo|doing|blocked|done|canceled`
|
|
17
|
+
- `created_at`: ISO 8601 UTC timestamp
|
|
18
|
+
|
|
19
|
+
### Ticket front matter (optional)
|
|
20
|
+
- `priority`: `low|medium|high|critical`
|
|
21
|
+
- `labels`: list of strings
|
|
22
|
+
- `assignment`: mapping
|
|
23
|
+
- `dependencies`: list of ticket IDs
|
|
24
|
+
- `blocks`: list of ticket IDs
|
|
25
|
+
- `related`: list of ticket IDs
|
|
26
|
+
- `planning`: mapping
|
|
27
|
+
- `node_type`: `work|group|checkpoint`
|
|
28
|
+
- `group_ids`: list of ticket IDs
|
|
29
|
+
- `lane`: string or null
|
|
30
|
+
- `rank`: positive integer or null
|
|
31
|
+
- `horizon`: string or null
|
|
32
|
+
- `precedes`: list of ticket IDs
|
|
33
|
+
- `resolution`: `completed|merged|dropped|null`
|
|
34
|
+
- `agent_limits`: mapping
|
|
35
|
+
- `verification`: mapping
|
|
36
|
+
- `custom`: mapping
|
|
37
|
+
|
|
38
|
+
Rules:
|
|
39
|
+
- `resolution` is only valid when `status` is terminal (`done` or `canceled`)
|
|
40
|
+
- grouping is persisted only through `planning.group_ids`
|
|
41
|
+
- sequencing is persisted only through `planning.precedes`
|
|
42
|
+
- `planning.group_ids` may only reference `group` or `checkpoint` tickets
|
|
43
|
+
- `planning.precedes` must not contain cycles
|
|
44
|
+
- group/checkpoint containment must not contain cycles
|
|
45
|
+
- duplicate `rank` values are invalid within the same peer set (`node_type`, sorted `group_ids`, `lane`, `horizon`)
|
|
46
|
+
|
|
47
|
+
### Repo config (`.tickets/config.yml`)
|
|
48
|
+
- `workflow.mode`: `auto|doc_first|skill_first`
|
|
49
|
+
- `defaults.planning.node_type`: `work|group|checkpoint`
|
|
50
|
+
- `defaults.planning.lane`: string or null
|
|
51
|
+
- `defaults.planning.horizon`: string or null
|
|
52
|
+
- `defaults.claims.ttl_minutes`: positive integer
|
|
53
|
+
- `semantics.terms`: mapping from human-facing terms to generic planning primitives
|
|
54
|
+
- `views`: repo-local reporting preferences
|
|
55
|
+
|
|
56
|
+
Repo config may override defaults and human semantic mappings, but may not redefine CLI invariants, status values, or log schema.
|
|
57
|
+
|
|
58
|
+
### Log entry (required)
|
|
59
|
+
- `version`: format version (integer)
|
|
60
|
+
- `version_url`: path to this definition (repo-local, relative to `.tickets/spec/`)
|
|
61
|
+
- `ts`: ISO 8601 UTC timestamp
|
|
62
|
+
- `run_started`: ISO 8601 UTC timestamp
|
|
63
|
+
- `actor_type`: `human|agent`
|
|
64
|
+
- `actor_id`: string
|
|
65
|
+
- `summary`: short string
|
|
66
|
+
- `event_type`: `status|work|claim`
|
|
67
|
+
|
|
68
|
+
### Log entry (conditional)
|
|
69
|
+
- `context`: non-empty list of strings when `event_type: work` and the entry is machine-written
|
|
70
|
+
- `claim`: required mapping when `event_type: claim`
|
|
71
|
+
- `action`: `acquire|renew|release|override`
|
|
72
|
+
- `claim_id`: UUIDv7 string
|
|
73
|
+
- `holder_id`: string
|
|
74
|
+
- `holder_type`: `human|agent`
|
|
75
|
+
- `ttl_minutes`: positive integer for non-release events
|
|
76
|
+
- `expires_at`: ISO 8601 UTC timestamp for non-release events
|
|
77
|
+
- `reason`: optional string
|
|
78
|
+
- `supersedes_claim_id`: optional UUIDv7 string or null
|
|
79
|
+
|
|
80
|
+
### Derived planning index (`/.tickets/derived/planning-index.json`)
|
|
81
|
+
- The index is derived cache state, not source of truth.
|
|
82
|
+
- The file is disposable and may be rebuilt at any time by the CLI.
|
|
83
|
+
- Required metadata:
|
|
84
|
+
- `index_format_id`: fixed UUIDv7 identifying the derived index format
|
|
85
|
+
- `index_format_label`: readable label for the index format revision
|
|
86
|
+
- `tool.format_version`
|
|
87
|
+
- `tool.format_version_url`
|
|
88
|
+
- `source_state`
|
|
89
|
+
- The CLI must rebuild the index when source files or embedded format/tool metadata no longer match.
|
|
90
|
+
|
|
91
|
+
### Reporting semantics
|
|
92
|
+
- `list` is the broad queue/report view.
|
|
93
|
+
- `plan` is the operational state view for ready, active, blocked, and group rollups.
|
|
94
|
+
- `graph` is the structural relationship view.
|
|
95
|
+
- Repo-specific planning language remains authoritative only in `.tickets/config.yml`.
|
|
96
|
+
|
|
97
|
+
### Extensions
|
|
98
|
+
- Extensions are repo-local and must live under the `custom` key.
|
|
99
|
+
- Tools should ignore unknown keys under `custom`.
|
|
100
|
+
|
|
101
|
+
## Diff from previous version
|
|
102
|
+
- Added planning-default overrides for `lane` and `horizon` in `.tickets/config.yml`.
|
|
103
|
+
- Added global planning validation for missing references, invalid group targets, cycles, and rank conflicts.
|
|
104
|
+
- Defined the derived planning index and its invalidation requirements.
|
|
105
|
+
- Clarified the operational split between `list`, `plan`, and `graph`.
|
|
106
|
+
- Clarified that repo-specific semantic mappings remain authoritative only in `.tickets/config.yml`.
|
package/README.md
CHANGED
|
@@ -24,8 +24,8 @@ The system is designed for teams that want ticket state to live in the repo, sta
|
|
|
24
24
|
## Spec version
|
|
25
25
|
|
|
26
26
|
- `version`: 3
|
|
27
|
-
- `version_url`: `version/20260317-tickets-spec.md`
|
|
28
|
-
- Local file in package assets: `.tickets/spec/version/20260317-tickets-spec.md`
|
|
27
|
+
- `version_url`: `version/20260317-2-tickets-spec.md`
|
|
28
|
+
- Local file in package assets: `.tickets/spec/version/20260317-2-tickets-spec.md`
|
|
29
29
|
|
|
30
30
|
## Install
|
|
31
31
|
|
|
@@ -86,6 +86,7 @@ Default semantic mapping:
|
|
|
86
86
|
- `roadmap` -> `planning.horizon`
|
|
87
87
|
|
|
88
88
|
Repos can override those terms in `.tickets/config.yml` without changing core execution semantics.
|
|
89
|
+
Treat the list above as defaults. Agents should consult `.tickets/config.yml` before interpreting repo-specific planning vocabulary.
|
|
89
90
|
|
|
90
91
|
## Claims
|
|
91
92
|
|
|
@@ -126,6 +127,12 @@ Planning options:
|
|
|
126
127
|
- `--precedes <ticketId>` repeatable
|
|
127
128
|
- `--resolution <completed|merged|dropped>`
|
|
128
129
|
|
|
130
|
+
Behavior:
|
|
131
|
+
- `--group-id` must reference an existing `group` or `checkpoint`
|
|
132
|
+
- missing `lane` and `horizon` can be inherited from referenced parent groups when unambiguous
|
|
133
|
+
- missing `rank` is assigned automatically when the lane is known
|
|
134
|
+
- repo defaults for planning fields come from `.tickets/config.yml`
|
|
135
|
+
|
|
129
136
|
### `validate`
|
|
130
137
|
|
|
131
138
|
```bash
|
|
@@ -137,6 +144,7 @@ Validates:
|
|
|
137
144
|
- machine-written log entries
|
|
138
145
|
- claim event payloads
|
|
139
146
|
- repo-local `.tickets/config.yml`
|
|
147
|
+
- planning graph correctness such as missing references, cycles, and rank conflicts
|
|
140
148
|
|
|
141
149
|
### `status`
|
|
142
150
|
|
|
@@ -174,6 +182,8 @@ Additional filters:
|
|
|
174
182
|
- `--claimed`
|
|
175
183
|
- `--claimed-by <actorId>`
|
|
176
184
|
- `--ready`
|
|
185
|
+
- `--sort <ready|priority|lane|rank|updated|title>`
|
|
186
|
+
- `--reverse`
|
|
177
187
|
- `--json`
|
|
178
188
|
|
|
179
189
|
### `plan`
|
|
@@ -186,6 +196,7 @@ Reports ready work and derived group/checkpoint rollups.
|
|
|
186
196
|
|
|
187
197
|
Use this when you want to answer:
|
|
188
198
|
- what is ready now
|
|
199
|
+
- what is already in progress
|
|
189
200
|
- what is blocked
|
|
190
201
|
- how a group or checkpoint is progressing
|
|
191
202
|
|
|
@@ -195,6 +206,16 @@ Use this when you want to answer:
|
|
|
195
206
|
npx @picoai/tickets graph [--ticket <ticket>] [--view dependency|sequence|portfolio|all] [--format mermaid|dot|json]
|
|
196
207
|
```
|
|
197
208
|
|
|
209
|
+
`graph` is the structural view. It shows dependency, sequence, and containment relationships, with planning metadata attached to each node.
|
|
210
|
+
|
|
211
|
+
## Derived index
|
|
212
|
+
|
|
213
|
+
`list`, `plan`, and `graph` maintain a derived planning index at `/.tickets/derived/planning-index.json`.
|
|
214
|
+
|
|
215
|
+
- it is cache state, not source of truth
|
|
216
|
+
- it is safe to delete
|
|
217
|
+
- the CLI rebuilds it automatically when tickets, logs, repo config, or tool metadata change
|
|
218
|
+
|
|
198
219
|
## Assets shipped with this package
|
|
199
220
|
|
|
200
221
|
- `.tickets/spec/TICKETS.md`
|
package/package.json
CHANGED
package/release-history.json
CHANGED