@softure-ai/skills 0.23.0 → 0.25.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/README.md +9 -3
- package/WORKFLOW.md +77 -9
- package/package.json +1 -1
- package/rules/AGENTS.md +7 -2
- package/scripts/install.mjs +18 -2
- package/scripts/portfolio.py +25 -5
- package/skills/softure-doctor/SKILL.md +18 -6
- package/skills/softure-doctor/references/state.schema.json +3 -2
- package/skills/softure-doctor/scripts/context_state.py +192 -19
- package/skills/softure-doctor/scripts/doctor.py +110 -10
- package/skills/softure-doctor/scripts/doctor_fix.py +66 -0
- package/skills/softure-doctor/scripts/doctor_sweep.py +174 -8
- package/skills/softure-roadmap/SKILL.md +18 -4
- package/skills/softure-roadmap/references/example-roadmap.md +30 -0
- package/skills/softure-roadmap/references/slicing.md +12 -3
package/README.md
CHANGED
|
@@ -32,7 +32,9 @@ It never overwrites a skill folder it did not install. Flags: `--dry-run`, `--ta
|
|
|
32
32
|
**CI job.** Run the doctor in a CI job named `context-doctor`, with no paths filter and no condition, so
|
|
33
33
|
documentation-only changes are checked too (in a project that already has history, once the rollout below
|
|
34
34
|
brings the doctor to zero). Keep that name: outside readers (`portfolio --source api`, an aggregator) look for
|
|
35
|
-
the `context-doctor` check run on the main branch's head.
|
|
35
|
+
the `context-doctor` check run on the main branch's head. In GitHub Actions the doctor writes its failure codes on
|
|
36
|
+
that check run (the annotation `context-doctor failure codes`, then one per failure) and in the job summary, so a
|
|
37
|
+
reader gets the codes through the forge API without a checkout.
|
|
36
38
|
|
|
37
39
|
```yaml
|
|
38
40
|
context-doctor:
|
|
@@ -47,7 +49,8 @@ the `context-doctor` check run on the main branch's head.
|
|
|
47
49
|
It fails on drift in `context/` (a roadmap left after its archive, archived changes not stamped,
|
|
48
50
|
`## Summary` placeholders, a stale `context/state.json`, …; WORKFLOW §12). The installer prints the
|
|
49
51
|
job until a workflow runs the doctor, and asks to rename a job that runs it under another name. `npx softure-skills state` regenerates `context/state.json`, which the
|
|
50
|
-
scripts otherwise write themselves.
|
|
52
|
+
scripts otherwise write themselves. When nothing names the project, its first run (and the installer) writes the
|
|
53
|
+
repository name into `context/workflow.json` → `project`, so the name no longer depends on how the repository was cloned.
|
|
51
54
|
|
|
52
55
|
**Rolling out to an existing project** (WORKFLOW §12.4). A project that adopted the package earlier
|
|
53
56
|
usually fails on history. Put it right, in this order, one pass per repository:
|
|
@@ -57,7 +60,10 @@ usually fails on history. Put it right, in this order, one pass per repository:
|
|
|
57
60
|
2. `npx softure-skills doctor --sweep --json`, worked by an agent with the `softure-doctor` skill
|
|
58
61
|
("Sweep history to zero"): every entry settled with its evidence (commit, release, file), never
|
|
59
62
|
without, in one change, until the doctor exits 0. Entries classed `superseded` (later roadmaps,
|
|
60
|
-
releases or changes made them obsolete) are closed by the agent as obsolete, never forwarded
|
|
63
|
+
releases or changes made them obsolete) are closed by the agent as obsolete, never forwarded; post-merge
|
|
64
|
+
steps (a release after the merge, `close #N`) are checked with the forge through `gh`, by the sweep itself
|
|
65
|
+
when it can reach it, else by the agent (class `forge`). A check carried to another roadmap (`→ roadmap-x`)
|
|
66
|
+
is ticked by `--fix`.
|
|
61
67
|
3. The owner's short list: only real owner items (a decision about future work, a secret, account or
|
|
62
68
|
connector, a step outside the repository), carried to the live roadmap or an `owner-word` issue.
|
|
63
69
|
4. The `context-doctor` job above, once the doctor is at zero.
|
package/WORKFLOW.md
CHANGED
|
@@ -80,6 +80,8 @@ or languages.
|
|
|
80
80
|
// at once (default; branches never edit roadmap.md, so merging <main> in never conflicts
|
|
81
81
|
// on it); "branch" commits them on the session branch only, <main> changes only by the merge
|
|
82
82
|
},
|
|
83
|
+
"roadmap": { "sizes": false }, // optional: true lets softure-roadmap write a relative size (S / M / L) per item and
|
|
84
|
+
// a `### Slices` block (§5); default: only when the owner asks for sizes
|
|
83
85
|
"release": { "owner": true }, // releases and deploys are never done by skills when true; false lets an autonomous
|
|
84
86
|
// project release through its own pipeline (never a production deploy, §8.4)
|
|
85
87
|
"autonomy": { // optional, read only when mode is "autonomous" (§8.4)
|
|
@@ -284,6 +286,14 @@ updated: 2026-10-01
|
|
|
284
286
|
## Order
|
|
285
287
|
Why this order; which items may run in parallel and which files each one owns.
|
|
286
288
|
|
|
289
|
+
**Sizes:** relative to each other, never hours or dates. S: … M: … L: … (optional, see below)
|
|
290
|
+
|
|
291
|
+
### Slices (optional, see below)
|
|
292
|
+
| Slice | Items | Size |
|
|
293
|
+
| --- | --- | --- |
|
|
294
|
+
| **1. First usable** | FC-1, FC-2 | 1 S, 1 M |
|
|
295
|
+
| 2. … | FC-3 | 1 L |
|
|
296
|
+
|
|
287
297
|
## Items
|
|
288
298
|
|
|
289
299
|
### FC-1: Hero in balance
|
|
@@ -291,6 +301,8 @@ Why this order; which items may run in parallel and which files each one owns.
|
|
|
291
301
|
- **Status:** ready
|
|
292
302
|
- **Outcome:** …
|
|
293
303
|
- **Prerequisites:** …
|
|
304
|
+
- **Touches (estimate):** files and areas, from a quick search
|
|
305
|
+
- **Size:** S (optional, see below)
|
|
294
306
|
- **Unknowns:** questions research must answer
|
|
295
307
|
- **Risk:** …
|
|
296
308
|
- **Baseline:** how we measure before/after
|
|
@@ -317,6 +329,16 @@ item block and appends to `## Done` itself. On a change branch (`softure-worktre
|
|
|
317
329
|
branch never conflicts on the roadmap. Orchestrators fall back to `wt-roadmap.py done` themselves when a thread did not
|
|
318
330
|
run it.
|
|
319
331
|
Each item block may carry `- **Input:** <path>` (e.g. the change folder), which tells research where its brief lives.
|
|
332
|
+
|
|
333
|
+
**Sizes and slices (optional).** An owner who funds a roadmap in slices ("the first usable slice now, the rest after
|
|
334
|
+
it") needs a rough relative size to make that call. `softure-roadmap` writes sizes only when the owner asks for them or
|
|
335
|
+
`workflow.json` sets `roadmap.sizes: true`; otherwise a roadmap has none:
|
|
336
|
+
- `- **Size:** S | M | L` in an item block, after `Touches (estimate)`. Sizes are relative to each other, never hours,
|
|
337
|
+
days, points or dates; their meaning is defined once, in a `**Sizes:**` line under `## Order`.
|
|
338
|
+
- `### Slices` under `## Order`: named groups of items in order, the first usable slice marked (bold), each with its size
|
|
339
|
+
sum as counts (`2 S, 1 M`), so the owner can fund slice by slice. Every sized item sits in exactly one slice.
|
|
340
|
+
- The `## At a glance` table, the row status and the item block's first two fields stay as they are: the parsers
|
|
341
|
+
never read a size.
|
|
320
342
|
`change.md` is defined **only** in §4. softure-roadmap (step 14, for every item it records) and softure-new write the same
|
|
321
343
|
format; softure-new takes over a `change.md` the roadmap opened.
|
|
322
344
|
|
|
@@ -623,8 +645,26 @@ after the last item", "drop SA-12"). It is the owner's word in writing, equal to
|
|
|
623
645
|
`change.md` or a standing order) gets a comment with the question and stays open.
|
|
624
646
|
- **Manual mode.** The coordinator shows open `owner-word` issues to the owner at the start of a session and acts
|
|
625
647
|
only on the owner's word in the conversation; it then comments and closes them the same way.
|
|
648
|
+
- **Answering a queue entry.** An issue that answers one `owner_queue` entry (§12.1) may carry, next to the prose, one
|
|
649
|
+
machine-readable line that names the entry by its `id` and the answer:
|
|
650
|
+
|
|
651
|
+
```markdown
|
|
652
|
+
Start the payments roadmap once the provider account is open.
|
|
653
|
+
|
|
654
|
+
<!-- owner-word: {"entry": "oq-bfe20288d8", "answer": "yes"} -->
|
|
655
|
+
```
|
|
656
|
+
|
|
657
|
+
`answer` is `yes`, `no` or `later`; the prose still says the decision and wins where the two differ (the coordinator
|
|
658
|
+
asks in a comment). The coordinator settles the entry it names in the file `source` points to, citing the issue:
|
|
659
|
+
`yes`: it carries the decision out and ticks the entry `— done: #N` (with the thread, PR or merge SHA when there is
|
|
660
|
+
one); `no`: it ticks the entry `— declined: #N` and records what follows in the roadmap (an item `dropped`, a queued
|
|
661
|
+
roadmap left waiting); `later`: it leaves the entry open and appends `(later: #N)`, so the entry keeps its `id` and
|
|
662
|
+
stays in the queue. An `entry` that is not in the current `state.json` (already settled, or an unknown id) gets a
|
|
663
|
+
comment saying so, and the issue is closed when the entry was settled. An issue without the line is read as prose,
|
|
664
|
+
as before.
|
|
626
665
|
- **Not in `state.json`.** Open owner-word issues live on the forge; an aggregator reads both (`state.json` for what
|
|
627
|
-
waits for the owner, the forge for the words already given).
|
|
666
|
+
waits for the owner, the forge for the words already given). With the line, it tells which entries an open issue
|
|
667
|
+
already answers (its `entry`) and shows them as answered until the entry leaves the queue.
|
|
628
668
|
|
|
629
669
|
## 9. Commits
|
|
630
670
|
|
|
@@ -720,9 +760,16 @@ The skills run `python3 .claude/skills/softure-doctor/scripts/context_state.py w
|
|
|
720
760
|
staged (so nobody's uncommitted edits leak in) and stages the result. By hand: `npx softure-skills state`.
|
|
721
761
|
A project without the file gets it from the first of these runs; nothing has to be migrated.
|
|
722
762
|
|
|
763
|
+
`project` falls back to the repository name, and that name's letter case is the clone's (`owner/REPO` and
|
|
764
|
+
`owner/repo` are one repository on GitHub). So the first `write` that falls back to it, and the installer, write it
|
|
765
|
+
into `context/workflow.json` → `project` (in the spelling `state.json` already holds, else the forge's
|
|
766
|
+
`GITHUB_REPOSITORY` in CI, else `origin`'s URL); from then on the value is fixed in the repository. Until it is, the
|
|
767
|
+
doctor compares a repository-derived `project` without regard to letter case, and a rewrite keeps the committed
|
|
768
|
+
spelling.
|
|
769
|
+
|
|
723
770
|
```jsonc
|
|
724
771
|
{
|
|
725
|
-
"schema_version": 1
|
|
772
|
+
"schema_version": 2, // 2 adds owner_queue[].id; read a version 1 file as one without ids
|
|
726
773
|
"project": "Example clinic", // workflow.json `project`, else the roadmap's, else the repository name; never null
|
|
727
774
|
"mode": "autonomous", "main_branch": "main",
|
|
728
775
|
"updated_at": "2026-11-20T09:00:00Z", // changes only when the content does
|
|
@@ -740,8 +787,8 @@ A project without the file gets it from the first of these runs; nothing has to
|
|
|
740
787
|
"open_changes": [ { "change_id": "search-titles", "title": "…", "status": "implementing", "roadmap_item": "SR-2",
|
|
741
788
|
"updated": "2026-11-10", "stage": "implement 2/3" } ],
|
|
742
789
|
"owner_queue": [ // everything that waits for the owner, oldest first
|
|
743
|
-
{ "kind": "decision", "source": "context/foundation/roadmap.md#Owner decisions and checks",
|
|
744
|
-
"since": "2026-11-10", "text": "**SR-5**: choose the ranking provider …" }
|
|
790
|
+
{ "id": "oq-06e40f59e9", "kind": "decision", "source": "context/foundation/roadmap.md#Owner decisions and checks",
|
|
791
|
+
"item": "SR-5", "since": "2026-11-10", "text": "**SR-5**: choose the ranking provider …" }
|
|
745
792
|
],
|
|
746
793
|
"last_release": { "version": "v1.4.0", "date": "2026-10-02", // as a closed roadmap recorded it (§5.2); the
|
|
747
794
|
"source": "context/foundation/archive/2026-09-30-roadmap.md" } // portfolio asks the forge first
|
|
@@ -767,7 +814,11 @@ An unticked entry in any other archived roadmap, and any unticked `## Owner deci
|
|
|
767
814
|
roadmap, is history to settle (the doctor's `archived-roadmap-open-checks`), not something that waits for the owner.
|
|
768
815
|
Entries from open changes are refreshed on every write and never make the file stale, like `open_changes`. `source` is the file, `#`, and the heading; `item` the roadmap ID the entry names;
|
|
769
816
|
`since` the date in the entry, else the file's `updated`, and once written it is kept for that entry on every
|
|
770
|
-
rewrite.
|
|
817
|
+
rewrite. `id` is a short stable id (`oq-` and a hash of `source`, `item` and the entry's text when it first appeared):
|
|
818
|
+
it is kept, like `since`, on every rewrite, also when only the entry's wording changed or it moved to another heading
|
|
819
|
+
of the same file (the same item and kind, or text that is still close), so a reader follows one entry across scans
|
|
820
|
+
without fingerprinting it and an owner-word issue can name the entry it answers (§8.6). Owner-word issues live on the
|
|
821
|
+
forge, not here.
|
|
771
822
|
|
|
772
823
|
`open_changes` and `updated_at` are refreshed on every write but never make the file stale: a change branch edits
|
|
773
824
|
its own `change.md` without touching `state.json`, and stays green.
|
|
@@ -800,7 +851,11 @@ left after them; `--fix --write` applies them, only under `context/`, and a seco
|
|
|
800
851
|
the file's current path when git history shows where it moved (rename detection, followed across moves); a file
|
|
801
852
|
deleted on purpose (git shows the deletion, no rename) is marked `(removed in <sha>)` with the deleting commit;
|
|
802
853
|
- an unticked Progress item of an archived plan that is struck through or carries a dropped/cancelled/not-applicable
|
|
803
|
-
note is normalised to `- [x] ~~<item>~~ — dropped: <note
|
|
854
|
+
note is normalised to `- [x] ~~<item>~~ — dropped: <note>`;
|
|
855
|
+
- an unticked owner check or pre-release step of an archived roadmap, or an open row, whose text carries a carry
|
|
856
|
+
marker (`→ roadmap-<slug>`, `carried to <roadmap>`) naming a roadmap that exists (queued, archived or the live one)
|
|
857
|
+
is ticked `- [x] <text> — carried to <path>` (a row becomes `carried (to <path>)`); the sweep shows such an entry
|
|
858
|
+
with that roadmap as its evidence. A marker whose roadmap does not exist stays a failure.
|
|
804
859
|
|
|
805
860
|
A row whose move or deletion the history does not show, and a live index, are left alone and named. A shallow clone
|
|
806
861
|
works on the commits it holds and names what lies past its edge. Everything else is a judgement case.
|
|
@@ -815,7 +870,12 @@ and later roadmaps that mention the item. Each entry has a class. `evidence`: th
|
|
|
815
870
|
no direct evidence, but later work made it obsolete (for an owner check or open row of an archived roadmap, a later
|
|
816
871
|
roadmap was closed and a release shipped after it, or the same item ID or file area appears in a later archived change;
|
|
817
872
|
for a Progress item, a later phase of the same plan is ticked); its evidence names that roadmap, release or change, and
|
|
818
|
-
the agent closes it as `obsolete: superseded by <ref>` itself, never forwards it.
|
|
873
|
+
the agent closes it as `obsolete: superseded by <ref>` itself, never forwards it. Post-merge steps that git history
|
|
874
|
+
cannot prove (a release after the merge, `close #N`, the Dependabot pull requests) are asked of the forge through `gh`
|
|
875
|
+
when it is reachable (a GitHub remote and credentials): a release published on or after the merge date, the state of
|
|
876
|
+
each `#N`, the open Dependabot pull requests; when every check holds the entry is `evidence` with those pointers.
|
|
877
|
+
`forge`: the same steps when the forge cannot be reached from where the sweep runs (or with `--no-forge`); an agent
|
|
878
|
+
checks them with `gh` before anything goes to the owner. `owner`: only for what is still
|
|
819
879
|
meaningful today, a decision about future work, a secret, account or connector, or a step outside the repository whose
|
|
820
880
|
effect the agent cannot see; the entry says which (`owner_reason`) and what the sweep looked for (`tried`). The
|
|
821
881
|
`softure-doctor` skill ("Sweep history to zero") tells an agent how to work it: every entry is settled with its evidence
|
|
@@ -833,7 +893,10 @@ is the sweep to zero.
|
|
|
833
893
|
A project that has never written `state.json` gets a note, not a failure. **Adopting projects run the doctor in a CI
|
|
834
894
|
job named `context-doctor`**, with no paths filter and no condition, so documentation-only changes are checked too and
|
|
835
895
|
an outside reader finds the result by that name: the check run `context-doctor` on the main branch's head says whether
|
|
836
|
-
the project's context contract is green (`portfolio --source api` reads it).
|
|
896
|
+
the project's context contract is green (`portfolio --source api` reads it). In GitHub Actions the doctor also leaves
|
|
897
|
+
its failure codes on that check run: the first annotation, titled `context-doctor failure codes`, lists every code with
|
|
898
|
+
its count (`archived-change-progress (3), state-stale (1)`), one annotation per failure follows (as many as GitHub
|
|
899
|
+
keeps), and the job summary holds the same table. Keep the job name, whatever the rest of
|
|
837
900
|
the workflow looks like. The installer prints the job until a workflow under `.github/workflows/` runs the doctor, and
|
|
838
901
|
asks to rename it while the job that runs it has another name:
|
|
839
902
|
|
|
@@ -865,7 +928,8 @@ where `repo` is `owner/name`, a git URL or a local path. One row per project:
|
|
|
865
928
|
`project | active roadmap X/N | queued | open changes | owner queue | last release | doctor`. The doctor runs on the
|
|
866
929
|
same tree; a project without `state.json` yet gets one built in memory (marked `*`). `--source api` reads only
|
|
867
930
|
`state.json` through `gh api` and runs no doctor; its doctor column is the `context-doctor` check run on the main
|
|
868
|
-
branch's head (`ok`, `failing
|
|
931
|
+
branch's head (`ok`, `failing` with the doctor's failure codes from that run's annotations, `pending`, or `missing` when
|
|
932
|
+
the project has no job by that name). **Last release comes from the forge** when it can: the latest GitHub
|
|
869
933
|
release through `gh api` (both modes, for a GitHub repository; a local checkout counts when its `origin` is on GitHub),
|
|
870
934
|
else the highest `v*` tag (git mode), else `state.json` → `last_release`, which only records what a closed roadmap
|
|
871
935
|
wrote and is shown labelled: `v1.4.0 (roadmap, 2026-10-02)`. `--json` gives `last_release`, `last_release_date` and
|
|
@@ -877,6 +941,10 @@ A project that adopted the package before the doctor existed usually fails on hi
|
|
|
877
941
|
status values, archive indexes that link moved files, unticked Progress items and owner checks in roadmaps closed
|
|
878
942
|
long ago. The history is put right, not hidden. One pass per repository, in this order:
|
|
879
943
|
|
|
944
|
+
0. **Name the project once.** Set `project` in `context/workflow.json` (the name the project calls itself), or let
|
|
945
|
+
`npx softure-skills state` pin the repository name there, and commit it. Without it `state.json` → `project`
|
|
946
|
+
depends on how each checkout was cloned (§12.1).
|
|
947
|
+
|
|
880
948
|
1. **Mechanical fixes.** Update the package, then `npx softure-skills doctor --fix` (review the printed edits) and
|
|
881
949
|
`npx softure-skills doctor --fix --write`. Commit: `docs(context): mechanical history fixes (doctor --fix)`.
|
|
882
950
|
2. **The sweep, worked by an agent.** `npx softure-skills doctor --sweep --json`, settled entry by entry as the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softure-ai/skills",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"description": "SOFTURE agent skills: a spec-driven delivery workflow (shape → prd → roadmap → plan → implement → review) plus parallel worktree orchestration",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
package/rules/AGENTS.md
CHANGED
|
@@ -86,7 +86,8 @@ step the owner has to undo.
|
|
|
86
86
|
trade-off), ask with a recommendation instead of deciding silently.
|
|
87
87
|
- **Owner-word issues** (label `owner-word`, WORKFLOW §8.6): at the start of a session, list the open
|
|
88
88
|
ones in this project's repository and show them to the owner first, with what each would start. Act
|
|
89
|
-
on one only after the owner's word in this conversation; then comment what was done and close it.
|
|
89
|
+
on one only after the owner's word in this conversation; then comment what was done and close it. One that names
|
|
90
|
+
an `owner_queue` entry (`<!-- owner-word: {"entry": …} -->`) is settled on that entry, citing the issue (§8.6).
|
|
90
91
|
- Rules of autonomous projects (standing merge consent, coordinators, report cadences) do not apply
|
|
91
92
|
here, even when a memory or another session suggests them.
|
|
92
93
|
|
|
@@ -346,7 +347,11 @@ word in writing, equal to the same sentence in the main chat: one decision, its
|
|
|
346
347
|
on it like an order in the chat: a roadmap to start goes to a roadmap thread (`--promote`), a release
|
|
347
348
|
word is recorded where the release rules look for it (the roadmap header's `Release:` order, quoted with
|
|
348
349
|
the issue link), a "no" or "later" is recorded in the roadmap (`## Owner decisions and checks` or the
|
|
349
|
-
item's status).
|
|
350
|
+
item's status). An issue whose body carries `<!-- owner-word: {"entry": "<id>", "answer": "yes|no|later"} -->`
|
|
351
|
+
answers the `owner_queue` entry with that `id` in `context/state.json`: settle that entry in its `source` file and cite
|
|
352
|
+
the issue (`yes`: carry it out and tick it `— done: #N`; `no`: tick it `— declined: #N` and record what follows;
|
|
353
|
+
`later`: leave it open with `(later: #N)`); an `entry` no longer in the queue gets a comment saying so (WORKFLOW §8.6).
|
|
354
|
+
Then it comments what it did (thread, PR, merge SHA, roadmap line), closes the issue as
|
|
350
355
|
completed, and names it in the next report. An issue it cannot act on (unclear, contradicts `change.md`
|
|
351
356
|
or a standing order) gets one comment with the question and stays open; the question also goes to the
|
|
352
357
|
owner in the main chat. Owner-word issues are not work items: they never get a thread of their own
|
package/scripts/install.mjs
CHANGED
|
@@ -92,6 +92,19 @@ function runSubcommand(name, args) {
|
|
|
92
92
|
return result.status ?? 1;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
// Fixes the repository-derived `project` in context/workflow.json the first time it is derived, so
|
|
96
|
+
// context/state.json no longer depends on how the checkout was cloned (`owner/REPO` vs `owner/repo`).
|
|
97
|
+
// Returns the action line, or null when there is nothing to do (no context/, a named project, no python3).
|
|
98
|
+
function pinProject(projectRoot, workflowConfig, options) {
|
|
99
|
+
if (workflowConfig.project || !fs.existsSync(path.join(projectRoot, "context"))) return null;
|
|
100
|
+
if (options.isDryRun) return null;
|
|
101
|
+
const result = spawnSync("python3", [path.join(DOCTOR_SCRIPTS, "context_state.py"), "pin-project", "--root", projectRoot],
|
|
102
|
+
{ encoding: "utf8", timeout: 15000 });
|
|
103
|
+
if (result.error || result.status !== 0) return null;
|
|
104
|
+
const line = result.stdout.trim();
|
|
105
|
+
return line ? line : null;
|
|
106
|
+
}
|
|
107
|
+
|
|
95
108
|
// How the project's GitHub workflows run the doctor: "named" (in a job whose id or name is CI_JOB),
|
|
96
109
|
// "unnamed" (somewhere else), or "none".
|
|
97
110
|
function doctorInCi(projectRoot) {
|
|
@@ -279,6 +292,9 @@ function install(options) {
|
|
|
279
292
|
}
|
|
280
293
|
}
|
|
281
294
|
|
|
295
|
+
const pinAction = pinProject(projectRoot, workflowConfig, options);
|
|
296
|
+
if (pinAction) actions.push(pinAction);
|
|
297
|
+
|
|
282
298
|
const [labelAction, hasLabel] = ensureOwnerWordLabel(projectRoot, previous, options);
|
|
283
299
|
if (labelAction) actions.push(labelAction);
|
|
284
300
|
|
|
@@ -306,8 +322,8 @@ function install(options) {
|
|
|
306
322
|
const prefix = options.isDryRun ? "[softure-skills] (dry run)" : "[softure-skills]";
|
|
307
323
|
for (const action of actions) console.log(`${prefix} ${action}`);
|
|
308
324
|
console.log(`${prefix} ${PACKAGE.name}@${PACKAGE.version} -> ${projectRoot}`);
|
|
309
|
-
if (fs.existsSync(path.join(projectRoot, WORKFLOW_CONFIG_PATH)) && !
|
|
310
|
-
console.log(`${prefix} ${WORKFLOW_CONFIG_PATH}: add "project": "<the name the project calls itself>" (context/state.json
|
|
325
|
+
if (fs.existsSync(path.join(projectRoot, WORKFLOW_CONFIG_PATH)) && !readWorkflowConfig(projectRoot).project) {
|
|
326
|
+
console.log(`${prefix} ${WORKFLOW_CONFIG_PATH}: add "project": "<the name the project calls itself>" (context/state.json takes it from the active roadmap until then; softure-init asks for it)`);
|
|
311
327
|
}
|
|
312
328
|
const ci = doctorInCi(projectRoot);
|
|
313
329
|
if (ci === "none") {
|
package/scripts/portfolio.py
CHANGED
|
@@ -30,9 +30,11 @@ repository, in both modes; a local checkout counts when its `origin` is on GitHu
|
|
|
30
30
|
`v*` tag (git mode), else the value a closed roadmap recorded in `state.json`, labelled `(roadmap)`.
|
|
31
31
|
`SOFTURE_GH` names another `gh` binary.
|
|
32
32
|
|
|
33
|
-
`--owner` prints only the owner queue across all projects, oldest first
|
|
33
|
+
`--owner` prints only the owner queue across all projects, oldest first, with each entry's `id` (an owner-word issue
|
|
34
|
+
names the entry it answers by that id, WORKFLOW §8.6). `--json` prints the same data
|
|
34
35
|
for another tool (`last_release` is the version; `last_release_source` is `release`, `tag` or `roadmap`;
|
|
35
|
-
with `--source api`, `doctor_check` is the check run's status
|
|
36
|
+
with `--source api`, `doctor_check` is the check run's status, `doctor_check_url` its page and `doctor_check_codes`
|
|
37
|
+
the doctor's failure codes from the run's annotations; the table shows them after `failing`). Exit 1 when a project could not be read (its row says why); nothing is ever written
|
|
36
38
|
outside a temporary folder.
|
|
37
39
|
"""
|
|
38
40
|
from __future__ import annotations
|
|
@@ -57,6 +59,7 @@ GITHUB_RE = re.compile(r"github\.com[:/]([\w.-]+/[\w.-]+?)(?:\.git)?/?$")
|
|
|
57
59
|
SEMVER_RE = re.compile(r"^v?(\d+)\.(\d+)\.(\d+)$")
|
|
58
60
|
# The CI job every adopting project runs the doctor in (WORKFLOW.md §12.2); its check run carries this name.
|
|
59
61
|
DOCTOR_CHECK = "context-doctor"
|
|
62
|
+
CODES_TITLE = "context-doctor failure codes" # the doctor's annotation that lists its failure codes
|
|
60
63
|
PASSING = ("success", "neutral", "skipped")
|
|
61
64
|
|
|
62
65
|
|
|
@@ -168,7 +171,20 @@ def doctor_check(slug: str, branch: str | None) -> dict:
|
|
|
168
171
|
status = "pending"
|
|
169
172
|
else:
|
|
170
173
|
status = "ok" if run.get("conclusion") in PASSING else "failing"
|
|
171
|
-
|
|
174
|
+
codes = failure_codes(slug, run) if status == "failing" else []
|
|
175
|
+
return {"status": status, "url": run.get("html_url"), "codes": codes}
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
def failure_codes(slug: str, run: dict) -> list[str]:
|
|
179
|
+
"""The doctor's failure codes of a failing check run, from its `context-doctor failure codes` annotation."""
|
|
180
|
+
if not run.get("id") or not (run.get("output") or {}).get("annotations_count", 1):
|
|
181
|
+
return []
|
|
182
|
+
annotations = gh_json(f"repos/{slug}/check-runs/{run['id']}/annotations")
|
|
183
|
+
for annotation in annotations if isinstance(annotations, list) else []:
|
|
184
|
+
if annotation.get("title") == CODES_TITLE:
|
|
185
|
+
return [part.strip().split(" (")[0] for part in (annotation.get("message") or "").split(",")
|
|
186
|
+
if part.strip()]
|
|
187
|
+
return []
|
|
172
188
|
|
|
173
189
|
|
|
174
190
|
def pick_release(forge: dict | None, tag: dict | None, state: dict | None) -> dict:
|
|
@@ -262,6 +278,7 @@ def read_api(project: dict) -> dict:
|
|
|
262
278
|
check = doctor_check(slug, project.get("branch"))
|
|
263
279
|
return {"branch": project.get("branch") or "default", "state": state, "state_source": source,
|
|
264
280
|
"doctor": None, "doctor_check": check["status"], "doctor_check_url": check["url"],
|
|
281
|
+
"doctor_check_codes": check.get("codes") or [],
|
|
265
282
|
**release_fields(release)}
|
|
266
283
|
|
|
267
284
|
|
|
@@ -296,6 +313,8 @@ def collect(projects: list[dict], source: str) -> list[dict]:
|
|
|
296
313
|
def check_cell(row: dict) -> str:
|
|
297
314
|
"""The doctor column of a row read through the API: the `context-doctor` check run, else `n/a`."""
|
|
298
315
|
check = row.get("doctor_check")
|
|
316
|
+
if check == "failing" and row.get("doctor_check_codes"):
|
|
317
|
+
return f"failing: {', '.join(row['doctor_check_codes'])}"
|
|
299
318
|
return check if check and check != "unknown" else "n/a"
|
|
300
319
|
|
|
301
320
|
|
|
@@ -363,9 +382,10 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
363
382
|
print(json.dumps({"generated_at": generated, "projects": rows}, indent=2, ensure_ascii=False))
|
|
364
383
|
elif flags["--owner"]:
|
|
365
384
|
entries = owner_entries(rows)
|
|
366
|
-
print(table(["since", "project", "kind", "what", "source"],
|
|
385
|
+
print(table(["since", "project", "kind", "what", "source", "id"],
|
|
367
386
|
[[e.get("since") or "—", e["project"], e["kind"], e["text"],
|
|
368
|
-
e["source"].replace("context/", "")] for e in entries])
|
|
387
|
+
e["source"].replace("context/", ""), e.get("id") or "—"] for e in entries])
|
|
388
|
+
if entries else "Nothing waits for the owner.")
|
|
369
389
|
else:
|
|
370
390
|
print(table(["project", "active roadmap X/N", "queued", "open changes", "owner queue", "last release", "doctor"],
|
|
371
391
|
[summary_cells(row) for row in rows]))
|
|
@@ -38,7 +38,9 @@ backlog), §5.2 (closing a roadmap), §6 (Progress). Two scripts next to this fi
|
|
|
38
38
|
|
|
39
39
|
- **CI of every adopting project**, documentation-only changes included: `npx softure-skills doctor` in a job
|
|
40
40
|
named `context-doctor`, with no paths filter and no condition (the installer prints the job; WORKFLOW §12.2).
|
|
41
|
-
Keep the name: outside readers look for that check run on the main branch's head
|
|
41
|
+
Keep the name: outside readers look for that check run on the main branch's head; in GitHub Actions the doctor
|
|
42
|
+
writes its failure codes there as annotations (the first, `context-doctor failure codes`, lists them all) and as
|
|
43
|
+
the job summary. A project with history adds it after the rollout (WORKFLOW §12.4):
|
|
42
44
|
`--fix --write`, the sweep to zero, the owner's short list, then the CI job. Drift happens in the documents, so a CI that skips doc-only
|
|
43
45
|
changes misses it.
|
|
44
46
|
- **`softure-archive`** (on the main branch) and **`softure-roadmap`** (record, `--queue`, `--promote`,
|
|
@@ -68,7 +70,7 @@ Each problem is one line `FAIL <code> <path>: <what>`. Fix the file it names, ne
|
|
|
68
70
|
## Mechanical repairs: `--fix`
|
|
69
71
|
|
|
70
72
|
`doctor.py --fix` prints every edit it would make and the failures left after them; `--fix --write`
|
|
71
|
-
applies them. It writes only under `context/`, and a second run changes nothing.
|
|
73
|
+
applies them. It writes only under `context/`, and a second run changes nothing. Four shapes are
|
|
72
74
|
mechanical:
|
|
73
75
|
|
|
74
76
|
- `archived-change-status`: the archived `change.md` gets `status: archived`, and the old value is kept
|
|
@@ -77,7 +79,11 @@ mechanical:
|
|
|
77
79
|
path when git history shows where it moved (renames followed across several moves); a file deleted on
|
|
78
80
|
purpose (git shows the deletion, no rename) is marked `(removed in <sha>)` with the deleting commit;
|
|
79
81
|
- a dropped Progress item of an archived plan (unticked, but struck through or carrying an explicit
|
|
80
|
-
dropped/cancelled/not-applicable note) is normalised to `- [x] ~~<item>~~ — dropped: <note
|
|
82
|
+
dropped/cancelled/not-applicable note) is normalised to `- [x] ~~<item>~~ — dropped: <note>`;
|
|
83
|
+
- a carried entry of an archived roadmap: an unticked owner check or pre-release step, or an open row, whose
|
|
84
|
+
text carries a carry marker (`→ roadmap-<slug>`, `carried to <roadmap>`) naming a roadmap that exists
|
|
85
|
+
(queued, archived or the live one) is ticked `- [x] <text> — carried to <path>` (a row becomes
|
|
86
|
+
`carried (to <path>)`). A marker whose roadmap does not exist is left alone and named: it stays a failure.
|
|
81
87
|
|
|
82
88
|
It skips, and names, every row it cannot settle from history (a live index, a target whose move or
|
|
83
89
|
deletion the history does not show). A shallow clone works on the commits it holds and names what lies
|
|
@@ -103,6 +109,8 @@ The evidence it looks for:
|
|
|
103
109
|
| `archived-roadmap-summary` | the merge (or squash) commit of the item's change on the main line; the last SHA of its archived plan |
|
|
104
110
|
| `archived-roadmap-open-items` | the item's archived change folder, its merge commit, the release that contains it, later roadmaps that mention it |
|
|
105
111
|
| `archived-roadmap-open-checks` | the same for the item the check names, plus the first release after the close (for pre-release steps) |
|
|
112
|
+
| carried entries | a check or row with a carry marker whose roadmap exists: that roadmap (`--fix --write` ticks it) |
|
|
113
|
+
| post-merge steps | a release after the merge, `close #N`, the Dependabot pull requests: asked of the forge through `gh` (the first release published on or after the merge date, the state of `#N`, open Dependabot pull requests); class `forge` when the forge cannot be reached (`--no-forge` skips it) |
|
|
106
114
|
| anything else | the file to fix (`index-missing-file`: where git history says the file went, or that it never existed) |
|
|
107
115
|
|
|
108
116
|
Work the list in one change per repository (`docs(context): settle history to zero`):
|
|
@@ -121,7 +129,11 @@ Work the list in one change per repository (`docs(context): settle history to ze
|
|
|
121
129
|
superseded by <release / roadmap / change>` (a row: `dropped (obsolete: superseded by <ref>)`).
|
|
122
130
|
Never forward it to the owner: a screenshot review of a page rebuilt since, or "after the release,
|
|
123
131
|
re-run X" for a release long gone, has no answer the owner could give.
|
|
124
|
-
3.
|
|
132
|
+
3. **`forge` entries are yours, not the owner's.** Check each with `gh` before anything goes to the owner:
|
|
133
|
+
`gh release list` (a release published after the merge), `gh issue view <N>` / `gh pr view <N>`,
|
|
134
|
+
`gh pr list --author app/dependabot`. Tick it with what the forge shows (`— done: v1.5.0`,
|
|
135
|
+
`— done: #12 closed`); only a step the forge shows not done, and only the owner can do, goes on.
|
|
136
|
+
4. **Only true owner items stay open, in one place.** An entry is the owner's when the evidence does
|
|
125
137
|
not settle it, nothing later superseded it, and only the owner can: a decision about future work
|
|
126
138
|
that is still open, a secret, account or connector, or a step outside the repository (a production
|
|
127
139
|
setting, a real device) whose effect the agent cannot see. Before forwarding an `unsettled` entry,
|
|
@@ -129,8 +141,8 @@ Work the list in one change per repository (`docs(context): settle history to ze
|
|
|
129
141
|
live roadmap's `## Owner decisions and checks` (or an `owner-word` issue, WORKFLOW §8.6) and tick
|
|
130
142
|
the archived line `— carried to <path | #N>`. Never carry a check whose work the evidence shows done,
|
|
131
143
|
and never tick a decision on the owner's behalf.
|
|
132
|
-
|
|
133
|
-
|
|
144
|
+
5. Regenerate the state (`context_state.py write`) and re-run `doctor.py` until it exits 0. Commit.
|
|
145
|
+
6. Report: failures per code before and after, and **one short list for the owner**: `ID | what the
|
|
134
146
|
owner decides or does | where it lives now`. Nothing else is left open.
|
|
135
147
|
|
|
136
148
|
An entry the agent cannot settle and that is not the owner's (the evidence is ambiguous) is named in
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"open_changes", "owner_queue", "last_release"],
|
|
9
9
|
"additionalProperties": false,
|
|
10
10
|
"properties": {
|
|
11
|
-
"schema_version": { "type": "integer", "enum": [1] },
|
|
12
|
-
"project": { "type": "string", "description": "workflow.json `project`, else the active roadmap's `project`, else the repository name (origin's URL, else the folder); never null" },
|
|
11
|
+
"schema_version": { "type": "integer", "enum": [1, 2], "description": "2 adds owner_queue[].id; a reader of version 1 files treats id as absent" },
|
|
12
|
+
"project": { "type": "string", "description": "workflow.json `project`, else the active roadmap's `project`, else the repository name (origin's URL, else the folder; GITHUB_REPOSITORY's spelling in CI; pinned in workflow.json by the first write that derives it; compared without letter case); never null" },
|
|
13
13
|
"mode": { "type": "string", "enum": ["manual", "autonomous"] },
|
|
14
14
|
"main_branch": { "type": ["string", "null"] },
|
|
15
15
|
"updated_at": { "type": "string", "description": "UTC ISO 8601; changes only when the content does" },
|
|
@@ -104,6 +104,7 @@
|
|
|
104
104
|
"required": ["kind", "source", "item", "since", "text"],
|
|
105
105
|
"additionalProperties": false,
|
|
106
106
|
"properties": {
|
|
107
|
+
"id": { "type": "string", "description": "stable id of the entry (schema_version 2): set when the entry first appears, kept on every rewrite, also when only its wording changed or its heading moved within the file; absent in version 1 files" },
|
|
107
108
|
"kind": { "type": "string", "enum": ["word", "decision", "step", "secret"] },
|
|
108
109
|
"source": { "type": "string", "description": "file, then `#` and the heading" },
|
|
109
110
|
"item": { "type": ["string", "null"], "description": "roadmap item ID, when the entry names one" },
|