@warpgogol/forge 9.2.3 → 9.3.1
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/CHANGELOG.md +33 -0
- package/bin/cli.ts +3 -2
- package/dist/bin/cli.js +3 -2
- package/dist/bin/cli.js.map +1 -1
- package/dist/os/adr/handlers/implement-stamp.d.ts +6 -0
- package/dist/os/adr/handlers/implement-stamp.d.ts.map +1 -1
- package/dist/os/adr/handlers/implement-stamp.js +23 -15
- package/dist/os/adr/handlers/implement-stamp.js.map +1 -1
- package/dist/os/checks/handlers/counters-journal.d.ts.map +1 -1
- package/dist/os/checks/handlers/counters-journal.js +9 -1
- package/dist/os/checks/handlers/counters-journal.js.map +1 -1
- package/dist/os/core/core.module.d.ts.map +1 -1
- package/dist/os/core/core.module.js +27 -36
- package/dist/os/core/core.module.js.map +1 -1
- package/dist/os/core/lock-holder.d.ts +32 -0
- package/dist/os/core/lock-holder.d.ts.map +1 -0
- package/dist/os/core/lock-holder.js +81 -0
- package/dist/os/core/lock-holder.js.map +1 -0
- package/dist/os/core/stamp-lock.d.ts +30 -0
- package/dist/os/core/stamp-lock.d.ts.map +1 -0
- package/dist/os/core/stamp-lock.js +112 -0
- package/dist/os/core/stamp-lock.js.map +1 -0
- package/dist/os/flow/digest.d.ts +19 -0
- package/dist/os/flow/digest.d.ts.map +1 -1
- package/dist/os/flow/digest.js +33 -4
- package/dist/os/flow/digest.js.map +1 -1
- package/dist/os/flow/flow.module.d.ts.map +1 -1
- package/dist/os/flow/flow.module.js +61 -6
- package/dist/os/flow/flow.module.js.map +1 -1
- package/dist/os/flow/handlers/flow-cut.d.ts +8 -0
- package/dist/os/flow/handlers/flow-cut.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-cut.js +91 -5
- package/dist/os/flow/handlers/flow-cut.js.map +1 -1
- package/dist/os/flow/handlers/flow-digest.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-digest.js +6 -0
- package/dist/os/flow/handlers/flow-digest.js.map +1 -1
- package/dist/os/flow/handlers/flow-discard.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-discard.js +17 -13
- package/dist/os/flow/handlers/flow-discard.js.map +1 -1
- package/dist/os/flow/handlers/flow-fix.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-fix.js +99 -10
- package/dist/os/flow/handlers/flow-fix.js.map +1 -1
- package/dist/os/flow/handlers/flow-integrate.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-integrate.js +32 -15
- package/dist/os/flow/handlers/flow-integrate.js.map +1 -1
- package/dist/os/flow/handlers/flow-publication-retire.d.ts +17 -0
- package/dist/os/flow/handlers/flow-publication-retire.d.ts.map +1 -0
- package/dist/os/flow/handlers/flow-publication-retire.js +132 -0
- package/dist/os/flow/handlers/flow-publication-retire.js.map +1 -0
- package/dist/os/flow/handlers/flow-push.d.ts +7 -0
- package/dist/os/flow/handlers/flow-push.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-push.js +106 -15
- package/dist/os/flow/handlers/flow-push.js.map +1 -1
- package/dist/os/flow/locks.d.ts +6 -1
- package/dist/os/flow/locks.d.ts.map +1 -1
- package/dist/os/flow/locks.js +53 -23
- package/dist/os/flow/locks.js.map +1 -1
- package/dist/os/flow/publication-order.d.ts +25 -0
- package/dist/os/flow/publication-order.d.ts.map +1 -0
- package/dist/os/flow/publication-order.js +75 -0
- package/dist/os/flow/publication-order.js.map +1 -0
- package/dist/os/flow/publish.d.ts +18 -0
- package/dist/os/flow/publish.d.ts.map +1 -1
- package/dist/os/flow/publish.js +58 -2
- package/dist/os/flow/publish.js.map +1 -1
- package/dist/os/flow/registry.d.ts +1 -1
- package/dist/os/flow/registry.d.ts.map +1 -1
- package/dist/os/flow/registry.js +2 -1
- package/dist/os/flow/registry.js.map +1 -1
- package/dist/os/flow/release-tags.d.ts +1 -0
- package/dist/os/flow/release-tags.d.ts.map +1 -1
- package/dist/os/flow/release-tags.js +5 -4
- package/dist/os/flow/release-tags.js.map +1 -1
- package/dist/os/flow/scripts.d.ts +1 -1
- package/dist/os/flow/scripts.d.ts.map +1 -1
- package/dist/os/flow/scripts.js +6 -1
- package/dist/os/flow/scripts.js.map +1 -1
- package/dist/os/flow/task-files.d.ts +11 -0
- package/dist/os/flow/task-files.d.ts.map +1 -0
- package/dist/os/flow/task-files.js +51 -0
- package/dist/os/flow/task-files.js.map +1 -0
- package/dist/os/flow/tests/helpers.d.ts +4 -1
- package/dist/os/flow/tests/helpers.d.ts.map +1 -1
- package/dist/os/flow/tests/helpers.js +9 -5
- package/dist/os/flow/tests/helpers.js.map +1 -1
- package/dist/os/mission/handlers/archive.d.ts.map +1 -1
- package/dist/os/mission/handlers/archive.js +30 -74
- package/dist/os/mission/handlers/archive.js.map +1 -1
- package/dist/os/mission/lockfile.d.ts +21 -0
- package/dist/os/mission/lockfile.d.ts.map +1 -0
- package/dist/os/mission/lockfile.js +76 -0
- package/dist/os/mission/lockfile.js.map +1 -0
- package/dist/os/mission/mission.module.d.ts.map +1 -1
- package/dist/os/mission/mission.module.js +2 -1
- package/dist/os/mission/mission.module.js.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp.d.ts +6 -0
- package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp.js +24 -19
- package/dist/os/rfc/handlers/implement-stamp.js.map +1 -1
- package/dist/os/system/handlers/outbox-validate.d.ts +8 -0
- package/dist/os/system/handlers/outbox-validate.d.ts.map +1 -0
- package/dist/os/system/handlers/outbox-validate.js +102 -0
- package/dist/os/system/handlers/outbox-validate.js.map +1 -0
- package/dist/os/system/handlers/system-map-validate.d.ts +13 -0
- package/dist/os/system/handlers/system-map-validate.d.ts.map +1 -0
- package/dist/os/system/handlers/system-map-validate.js +78 -0
- package/dist/os/system/handlers/system-map-validate.js.map +1 -0
- package/dist/os/system/handlers/system-outbox-scan.d.ts +10 -0
- package/dist/os/system/handlers/system-outbox-scan.d.ts.map +1 -0
- package/dist/os/system/handlers/system-outbox-scan.js +195 -0
- package/dist/os/system/handlers/system-outbox-scan.js.map +1 -0
- package/dist/os/system/handlers/system-task-collect.d.ts +13 -0
- package/dist/os/system/handlers/system-task-collect.d.ts.map +1 -0
- package/dist/os/system/handlers/system-task-collect.js +238 -0
- package/dist/os/system/handlers/system-task-collect.js.map +1 -0
- package/dist/os/system/handlers/system-task-create.d.ts +32 -0
- package/dist/os/system/handlers/system-task-create.d.ts.map +1 -0
- package/dist/os/system/handlers/system-task-create.js +216 -0
- package/dist/os/system/handlers/system-task-create.js.map +1 -0
- package/dist/os/system/handlers/system-task-dispatch.d.ts +14 -0
- package/dist/os/system/handlers/system-task-dispatch.d.ts.map +1 -0
- package/dist/os/system/handlers/system-task-dispatch.js +290 -0
- package/dist/os/system/handlers/system-task-dispatch.js.map +1 -0
- package/dist/os/system/handlers/system-task-move.d.ts +12 -0
- package/dist/os/system/handlers/system-task-move.d.ts.map +1 -0
- package/dist/os/system/handlers/system-task-move.js +217 -0
- package/dist/os/system/handlers/system-task-move.js.map +1 -0
- package/dist/os/system/handlers/system-task-status.d.ts +20 -0
- package/dist/os/system/handlers/system-task-status.d.ts.map +1 -0
- package/dist/os/system/handlers/system-task-status.js +139 -0
- package/dist/os/system/handlers/system-task-status.js.map +1 -0
- package/dist/os/system/handlers/system-versionset-record.d.ts +12 -0
- package/dist/os/system/handlers/system-versionset-record.d.ts.map +1 -0
- package/dist/os/system/handlers/system-versionset-record.js +332 -0
- package/dist/os/system/handlers/system-versionset-record.js.map +1 -0
- package/dist/os/system/index.d.ts +6 -0
- package/dist/os/system/index.d.ts.map +1 -0
- package/dist/os/system/index.js +18 -0
- package/dist/os/system/index.js.map +1 -0
- package/dist/os/system/outbox-schema.d.ts +30 -0
- package/dist/os/system/outbox-schema.d.ts.map +1 -0
- package/dist/os/system/outbox-schema.js +29 -0
- package/dist/os/system/outbox-schema.js.map +1 -0
- package/dist/os/system/repo.d.ts +64 -0
- package/dist/os/system/repo.d.ts.map +1 -0
- package/dist/os/system/repo.js +364 -0
- package/dist/os/system/repo.js.map +1 -0
- package/dist/os/system/scenario-schemas.d.ts +26 -0
- package/dist/os/system/scenario-schemas.d.ts.map +1 -0
- package/dist/os/system/scenario-schemas.js +53 -0
- package/dist/os/system/scenario-schemas.js.map +1 -0
- package/dist/os/system/schemas.d.ts +63 -0
- package/dist/os/system/schemas.d.ts.map +1 -0
- package/dist/os/system/schemas.js +83 -0
- package/dist/os/system/schemas.js.map +1 -0
- package/dist/os/system/system.module.d.ts +3 -0
- package/dist/os/system/system.module.d.ts.map +1 -0
- package/dist/os/system/system.module.js +429 -0
- package/dist/os/system/system.module.js.map +1 -0
- package/dist/os/system/task-schemas.d.ts +108 -0
- package/dist/os/system/task-schemas.d.ts.map +1 -0
- package/dist/os/system/task-schemas.js +152 -0
- package/dist/os/system/task-schemas.js.map +1 -0
- package/dist/os/system/task-store.d.ts +41 -0
- package/dist/os/system/task-store.d.ts.map +1 -0
- package/dist/os/system/task-store.js +142 -0
- package/dist/os/system/task-store.js.map +1 -0
- package/dist/os/system/tests/helpers.d.ts +30 -0
- package/dist/os/system/tests/helpers.d.ts.map +1 -0
- package/dist/os/system/tests/helpers.js +178 -0
- package/dist/os/system/tests/helpers.js.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +5 -4
- package/dist/src/index.js.map +1 -1
- package/os/adr/handlers/implement-stamp-lock.test.ts +90 -0
- package/os/adr/handlers/implement-stamp.ts +29 -20
- package/os/checks/handlers/counters-journal.test.ts +10 -0
- package/os/checks/handlers/counters-journal.ts +8 -1
- package/os/core/core.module.ts +32 -36
- package/os/core/lock-holder.ts +88 -0
- package/os/core/stamp-lock.ts +142 -0
- package/os/flow/digest.ts +46 -4
- package/os/flow/flow.module.ts +62 -6
- package/os/flow/handlers/flow-cut.ts +118 -5
- package/os/flow/handlers/flow-digest.ts +6 -0
- package/os/flow/handlers/flow-discard.ts +22 -13
- package/os/flow/handlers/flow-fix.ts +116 -10
- package/os/flow/handlers/flow-integrate.ts +31 -15
- package/os/flow/handlers/flow-publication-retire.ts +156 -0
- package/os/flow/handlers/flow-push.ts +128 -13
- package/os/flow/locks.ts +75 -25
- package/os/flow/publication-order.ts +99 -0
- package/os/flow/publish.ts +73 -2
- package/os/flow/registry.ts +5 -2
- package/os/flow/release-tags.ts +5 -4
- package/os/flow/scripts.ts +12 -5
- package/os/flow/task-files.ts +59 -0
- package/os/flow/tests/flow-cut-prepare.test.ts +298 -0
- package/os/flow/tests/flow-cut.test.ts +5 -1
- package/os/flow/tests/flow-publication-retire.test.ts +191 -0
- package/os/flow/tests/flow-push-supersede.test.ts +221 -0
- package/os/flow/tests/flow-task-files.test.ts +59 -0
- package/os/flow/tests/helpers.ts +9 -5
- package/os/flow/tests/locks.test.ts +219 -0
- package/os/flow/tests/publication-order.test.ts +102 -0
- package/os/flow/tests/scripts.test.ts +13 -0
- package/os/mission/handlers/archive.test.ts +97 -52
- package/os/mission/handlers/archive.ts +31 -76
- package/os/mission/lockfile.ts +84 -0
- package/os/mission/mission.module.ts +2 -1
- package/os/rfc/handlers/implement-stamp-lock.test.ts +133 -0
- package/os/rfc/handlers/implement-stamp.ts +30 -24
- package/os/system/handlers/outbox-validate.ts +120 -0
- package/os/system/handlers/system-map-validate.ts +107 -0
- package/os/system/handlers/system-outbox-scan.ts +320 -0
- package/os/system/handlers/system-task-collect.ts +305 -0
- package/os/system/handlers/system-task-create.ts +271 -0
- package/os/system/handlers/system-task-dispatch.ts +387 -0
- package/os/system/handlers/system-task-move.ts +353 -0
- package/os/system/handlers/system-task-status.ts +176 -0
- package/os/system/handlers/system-versionset-record.ts +476 -0
- package/os/system/index.ts +47 -0
- package/os/system/outbox-schema.ts +47 -0
- package/os/system/repo.ts +451 -0
- package/os/system/scenario-schemas.ts +62 -0
- package/os/system/schemas.ts +102 -0
- package/os/system/system.module.ts +449 -0
- package/os/system/task-schemas.ts +190 -0
- package/os/system/task-store.ts +184 -0
- package/os/system/tests/helpers.ts +189 -0
- package/os/system/tests/outbox-validate.test.ts +92 -0
- package/os/system/tests/system-map-validate.test.ts +321 -0
- package/os/system/tests/system-outbox-scan.test.ts +273 -0
- package/os/system/tests/system-profile.test.ts +90 -0
- package/os/system/tests/system-task-collect.test.ts +293 -0
- package/os/system/tests/system-task-dispatch.test.ts +279 -0
- package/os/system/tests/system-task-status.test.ts +153 -0
- package/os/system/tests/system-task.test.ts +330 -0
- package/os/system/tests/system-versionset.test.ts +314 -0
- package/package.json +33 -1
- package/profiles/forge-shell.yaml +1 -2
- package/profiles/knowledge.yaml +1 -1
- package/profiles/system.yaml +650 -0
- package/profiles/typescript.yaml +0 -1
- package/skills/fo/fo-outbox/SKILL.md +71 -0
- package/skills/fo/fo-system-dispatch/SKILL.md +65 -0
- package/skills/fo/fo-task-run/SKILL.md +75 -0
- package/src/index.ts +11 -4
- package/src/tests/fixtures/agents-generate-business-before.txt +6 -0
- package/src/tests/profile-flow-hooks.test.ts +15 -0
- package/src/tests/profile-schema.test.ts +2 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fo-outbox
|
|
3
|
+
description: Write a dependency-contract request entry in docs/outbox/ so the system can match the need to an offering product. Use when a product needs a contract without naming the provider.
|
|
4
|
+
invocation: user
|
|
5
|
+
category: fo
|
|
6
|
+
concerns: document-only
|
|
7
|
+
dependsOn: []
|
|
8
|
+
languagePolicy: ref(PREFERENCES.md)
|
|
9
|
+
triggerPhrases: ["request a contract", "add an outbox entry", "I need something another product provides"]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<!--
|
|
13
|
+
<MODULE_CONTRACT>
|
|
14
|
+
<purpose>fo-outbox skill — author a forge outbox entry in docs/outbox/<id>.yaml that records what this product needs from a contract without naming who serves it.</purpose>
|
|
15
|
+
<non-goals>
|
|
16
|
+
<item>Do not decide which product serves the contract — the system matches needs to offers.</item>
|
|
17
|
+
</non-goals>
|
|
18
|
+
</MODULE_CONTRACT>
|
|
19
|
+
-->
|
|
20
|
+
|
|
21
|
+
# fo-outbox
|
|
22
|
+
|
|
23
|
+
Before starting, read `PREFERENCES.md` at the repository root. If the file is missing or `aiLanguage` is unset, ask the operator once and create the file using the `my-preferences` skill semantics.
|
|
24
|
+
|
|
25
|
+
Use this skill inside a **product repository** when the work needs a contract another product may offer — a shared schema, a data feed, a capability — and the product must not name the provider.
|
|
26
|
+
|
|
27
|
+
An outbox entry is an ordinary tracked file, reviewed and committed with the rest of the product's work.
|
|
28
|
+
|
|
29
|
+
## The rule
|
|
30
|
+
|
|
31
|
+
An entry names **a contract and nothing else**:
|
|
32
|
+
|
|
33
|
+
- never the system the product belongs to;
|
|
34
|
+
- never the product that might serve it;
|
|
35
|
+
- never a repository, checkout path or remote URL.
|
|
36
|
+
|
|
37
|
+
If the need truly has no candidate contract, say so in `why` — do not invent a contract id.
|
|
38
|
+
|
|
39
|
+
## Steps
|
|
40
|
+
|
|
41
|
+
### 1. Pick the next free id
|
|
42
|
+
|
|
43
|
+
List `docs/outbox/` (create the directory when absent) and take the lowest unused `OB-NNNN` number. The filename stem IS the entry id — `docs/outbox/OB-0003.yaml` must declare `id: OB-0003`.
|
|
44
|
+
|
|
45
|
+
### 2. Write the entry
|
|
46
|
+
|
|
47
|
+
```yaml
|
|
48
|
+
schema: forge/outbox@1
|
|
49
|
+
id: OB-0003
|
|
50
|
+
contract: <contract-id>
|
|
51
|
+
need: <one line: what you need from the contract>
|
|
52
|
+
why: <one line: why the product needs it>
|
|
53
|
+
state: open
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
- `contract` — the contract id exactly as published (check the project's contract registry or catalog if one exists).
|
|
57
|
+
- `need` — the concrete ask: e.g. "consume events in format X" or "a versioned read surface for Y".
|
|
58
|
+
- `why` — the business reason; the system copies it into the proposed task's history.
|
|
59
|
+
- `state` — `open` while the need stands; a product session later flips it to `served` or `withdrawn`.
|
|
60
|
+
|
|
61
|
+
### 3. Validate
|
|
62
|
+
|
|
63
|
+
Run the project's outbox validator (e.g. `forge outbox.validate` where registered, or `werkstatt run outbox.validate`). It must exit 0 — fix OUTBOX-01/02 diagnostics before committing.
|
|
64
|
+
|
|
65
|
+
### 4. Commit with the product work
|
|
66
|
+
|
|
67
|
+
The entry is tracked like any source file — include it in the change that needs it, on the product's governed branch. The system's next scan reads only what reached `develop`; uncommitted or unintegrated entries stay invisible by design.
|
|
68
|
+
|
|
69
|
+
## After the scan
|
|
70
|
+
|
|
71
|
+
A matched entry becomes a **proposed task** for the offering product. The operator fills the dispatch brief and moves it to `ready` — nothing dispatches automatically. When your own task report carries `outbox:` entries pointing at needs you served, the collection path records them.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fo-system-dispatch
|
|
3
|
+
description: Run a task end to end inside a system repository — read the queue, scan product outboxes, write self-contained briefs, move tasks to ready, dispatch, and collect reports.
|
|
4
|
+
invocation: user
|
|
5
|
+
category: fo
|
|
6
|
+
concerns: document-only
|
|
7
|
+
dependsOn: []
|
|
8
|
+
languagePolicy: ref(PREFERENCES.md)
|
|
9
|
+
triggerPhrases: ["dispatch a system task", "run the system queue", "move a task to ready and dispatch it"]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<!--
|
|
13
|
+
<MODULE_CONTRACT>
|
|
14
|
+
<purpose>fo-system-dispatch skill — drive one task through the system queue: status → brief → ready → dispatch → collect, asking the operator only for a parked task or a needs-decision report.</purpose>
|
|
15
|
+
<non-goals>
|
|
16
|
+
<item>Do not work in a product repository — the system agent reads queues and writes briefs, never product code.</item>
|
|
17
|
+
</non-goals>
|
|
18
|
+
</MODULE_CONTRACT>
|
|
19
|
+
-->
|
|
20
|
+
|
|
21
|
+
# fo-system-dispatch
|
|
22
|
+
|
|
23
|
+
Before starting, read `PREFERENCES.md` at the repository root. If the file is missing or `aiLanguage` is unset, ask the operator once and create the file using the `my-preferences` skill semantics.
|
|
24
|
+
|
|
25
|
+
Use this skill inside a **system repository** — the one holding `system/system.yaml`. A system session never opens a product checkout; the product's own session does the work.
|
|
26
|
+
|
|
27
|
+
## Steps
|
|
28
|
+
|
|
29
|
+
### 1. Read the queue
|
|
30
|
+
|
|
31
|
+
Run `system.task.status`. It joins every task file with its product-side registry and journal evidence — one picture per task: state, branch, and what the product last reported.
|
|
32
|
+
|
|
33
|
+
### 2. Create tasks
|
|
34
|
+
|
|
35
|
+
Operator-initiated work starts as `system.task.create --product <p> --slug <s> --title <t> --kind <adoption|change|…>` — including the adoption tasks the operator's runbook hands this skill. Then run `system.outbox.scan` (add `--create` to materialize matched entries as `proposed` tasks). A scan is read-only without `--create`; unmatched, forbidden or unresolvable entries surface as SYSTEM-OUTBOX diagnostics (schema-invalid entries as OUTBOX-01/02), never silent drops.
|
|
36
|
+
|
|
37
|
+
### 3. Write a self-contained brief
|
|
38
|
+
|
|
39
|
+
For each `proposed` task you intend to dispatch, write `queue/briefs/<id>.md` so that a session which has never seen this repository can do the work. Frontmatter carries `schema: forge/dispatch-brief@1`, the task id, the product, a non-placeholder `goal`, and at least one `acceptance: [{claim, check}]` — all gated by the ready move. The body carries what to change, where to look, and how the session proves it. A brief that needs system context to parse is a failed brief.
|
|
40
|
+
|
|
41
|
+
### 4. Move to `ready`
|
|
42
|
+
|
|
43
|
+
Run `system.task.move --task <id> --to ready`. The ready gate checks the brief exists, binds to the task, and clears dependency and edge rules — fix what it reports instead of retrying.
|
|
44
|
+
|
|
45
|
+
### 5. Dispatch
|
|
46
|
+
|
|
47
|
+
Run `system.task.dispatch --task <id>`. Dispatch opens a task worktree inside the product checkout, plants `.forge/task/brief.md` there, and prints the worktree path to `cd` into — start that session yourself or hand the printed command to the operator. When `products.local.yaml` declares `launcher.argv`, the product session is invoked automatically.
|
|
48
|
+
|
|
49
|
+
A dispatch refusal is information: read the SYSTEM-TASK or FLOW-OPEN diagnostic, repair the cause (unmapped folder, forbidden edge, wedged flow), then dispatch again.
|
|
50
|
+
|
|
51
|
+
### 6. Collect
|
|
52
|
+
|
|
53
|
+
Later, run `system.task.collect --task <id>` after the product session reports. Collect maps the outcome: `done` → `integrated` (with the journal's integrate evidence), `needs-decision` → `reported`, `blocked` → `failed`. A `needs-decision` report's question goes to the operator verbatim — then follow through with `system.task.move`: `reported → ready` (with `--reason`) before re-dispatching, `failed → ready` directly, or `ready`/`failed → parked` (with `--reason`) to shelve.
|
|
54
|
+
|
|
55
|
+
A dispatched task with no report stays `dispatched` — `--mark-failed --reason "<why>"` is the operator's call after a session dies, not a cleanup habit.
|
|
56
|
+
|
|
57
|
+
### 7. Commit queue files in this repository
|
|
58
|
+
|
|
59
|
+
Task files, briefs and collected reports live under `queue/` in the system repository — commit them through this repository's own governed session path, never through a product.
|
|
60
|
+
|
|
61
|
+
## Rules
|
|
62
|
+
|
|
63
|
+
- **Never commit or integrate inside a product checkout.** Integration is the product session's own governed step.
|
|
64
|
+
- **A `needs-decision` report becomes one operator question** — relay it verbatim, do not answer it yourself.
|
|
65
|
+
- **Briefs are the whole contract.** If a brief would not let a cold session finish the task, rewrite the brief before dispatching.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fo-task-run
|
|
3
|
+
description: Execute a dispatched task inside a product worktree — read the planted brief, do the work with this repository's own gate, write the task report, then integrate.
|
|
4
|
+
invocation: user
|
|
5
|
+
category: fo
|
|
6
|
+
concerns: code-mutation
|
|
7
|
+
dependsOn: []
|
|
8
|
+
languagePolicy: ref(PREFERENCES.md)
|
|
9
|
+
triggerPhrases: ["run this task in the product", "execute the planted brief", "work this dispatched task"]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<!--
|
|
13
|
+
<MODULE_CONTRACT>
|
|
14
|
+
<purpose>fo-task-run skill — take a dispatched task from .forge/task/brief.md to .forge/task/report.yaml inside the product worktree, finishing with the product's own integrate step.</purpose>
|
|
15
|
+
<non-goals>
|
|
16
|
+
<item>Do not look for or touch the repository that sent the brief — the product session knows only its own worktree.</item>
|
|
17
|
+
</non-goals>
|
|
18
|
+
</MODULE_CONTRACT>
|
|
19
|
+
-->
|
|
20
|
+
|
|
21
|
+
# fo-task-run
|
|
22
|
+
|
|
23
|
+
Before starting, read `PREFERENCES.md` at the repository root. If the file is missing or `aiLanguage` is unset, ask the operator once and create the file using the `my-preferences` skill semantics.
|
|
24
|
+
|
|
25
|
+
Use this skill inside a **product worktree** that was opened for a task — it carries `.forge/task/brief.md` at its root. The brief is the whole contract: a session that needs outside context to parse it should stop and report `blocked`.
|
|
26
|
+
|
|
27
|
+
## Steps
|
|
28
|
+
|
|
29
|
+
### 1. Read the brief
|
|
30
|
+
|
|
31
|
+
Read `.forge/task/brief.md`. It names the task id, the product, what to change, and how the change is proven. Work only inside this worktree — the product's primary checkout stays untouched.
|
|
32
|
+
|
|
33
|
+
### 2. Do the work
|
|
34
|
+
|
|
35
|
+
Use this repository's own skills, conventions and commit path. The brief names its acceptance intent; translate it into the repository's own evidence — tests, validators, probes.
|
|
36
|
+
|
|
37
|
+
Record a new dependency need — a contract another product may offer — through `fo-outbox` as an ordinary tracked entry; never hardcode a provider.
|
|
38
|
+
|
|
39
|
+
### 3. Run the product's gate
|
|
40
|
+
|
|
41
|
+
Run the repository's own gate exactly as a human would before integrating. Evidence lives in this repository — do not invent a parallel one.
|
|
42
|
+
|
|
43
|
+
### 4. Write the report
|
|
44
|
+
|
|
45
|
+
Write `.forge/task/report.yaml`:
|
|
46
|
+
|
|
47
|
+
```yaml
|
|
48
|
+
schema: forge/task-report@1
|
|
49
|
+
task: T-NNNN
|
|
50
|
+
outcome: done | blocked | needs-decision
|
|
51
|
+
summary: <one paragraph: what happened>
|
|
52
|
+
commits: [<full hashes this work produced>]
|
|
53
|
+
gate: pass | fail | not-run
|
|
54
|
+
acceptance:
|
|
55
|
+
- claim: <what the brief asked>
|
|
56
|
+
evidence: <how it is proven>
|
|
57
|
+
outbox: [<entry ids this work served, if any>]
|
|
58
|
+
# question: <required when outcome is needs-decision — one question for the operator>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
- `outcome: done` goes with `gate: pass` — a report claiming done on a failing gate is dishonest, and collect will surface it to the operator.
|
|
62
|
+
- `outcome: needs-decision` requires `question:` — one question for the operator, verbatim-quotable.
|
|
63
|
+
- `gate: not-run` is honest when nothing ran; pair it with `blocked`, not `done`.
|
|
64
|
+
|
|
65
|
+
### 5. Integrate or stop
|
|
66
|
+
|
|
67
|
+
- Gate passed and report written → run this repository's `flow.integrate`. The task files survive teardown — the system collects them later.
|
|
68
|
+
- Gate cannot pass after two honest attempts → write `outcome: blocked`, leave the worktree as evidence, stop. Do not retry forever and do not merge anything yourself.
|
|
69
|
+
- The brief cannot be satisfied as written → `outcome: needs-decision` with the question.
|
|
70
|
+
|
|
71
|
+
## Rules
|
|
72
|
+
|
|
73
|
+
- **Integration stays the product's own `flow.integrate`** — nothing pushes, nothing merges behind the operator's back.
|
|
74
|
+
- **`.forge/task/` is scratch the worktree owns** — brief in, report out; do not commit it into the product's tracked tree.
|
|
75
|
+
- **Report honestly.** `blocked` is a first-class outcome; a wedged report helps nobody.
|
package/src/index.ts
CHANGED
|
@@ -6,10 +6,6 @@
|
|
|
6
6
|
</non-goals>
|
|
7
7
|
</MODULE_CONTRACT>
|
|
8
8
|
<CHANGE_SUMMARY>
|
|
9
|
-
<item>RFC-0374: initial public exports for forge package.</item>
|
|
10
|
-
<item>RFC-1097: step 6 — compass.migrate codemod run
|
|
11
|
-
|
|
12
|
-
Mechanical v1 to v2 header migration across the workspace: 942 files rewritten — CHANGE_SUMMARY windows collapsed into history, forbidden v1 blocks stripped, KEY_DECISIONS seeded from @ai-invariant comments (5 files) or TODO placeholders (103 files), blocks reordered to canonical order.</item>
|
|
13
9
|
<item>RFC-1097: sweep — packages/forge + services clean
|
|
14
10
|
|
|
15
11
|
Sweep batch 2: real KEY_DECISIONS on 10 files, expanded purposes (CONTRACT-02/PURPOSE-02), headers on mission/index + gen-upstreams, sanitizeItemText in summary.record (literal Compass tags corrupted history), excludedPaths for wrangler types, test-fixtures testPattern. forge+services now 0 diagnostics under --mode error.</item>
|
|
@@ -17,6 +13,9 @@ Sweep batch 2: real KEY_DECISIONS on 10 files, expanded purposes (CONTRACT-02/PU
|
|
|
17
13
|
|
|
18
14
|
Sweep batch 4: 73 Compass headers on headerless engine files (certification, component-runtime, isolation, evolution, testing), real KEY_DECISIONS on 75 files (kernel, cache, dht, swim, gitmesh, runtime), ~80 purpose expansions (CONTRACT-02/PURPOSE-02), non-goals on 13 CONTRACT-03 files, CS-07 history literal fix repo-wide (253 files). Policy: .template.ts/.template.astro excludedPaths. werkstatt-engine now 0 diagnostics.</item>
|
|
19
15
|
<item>RFC-1486: step 5 — forge-flow module registration + dual CLI/kernel wiring</item>
|
|
16
|
+
<item>RFC-1508: implement RFC-1508 — system profile, system map schemas and system.map.validate</item>
|
|
17
|
+
<item>RFC-1508: align rfc-1508 schemas with the normative contract after review r1</item>
|
|
18
|
+
<history>RFC-0374, RFC-1097</history>
|
|
20
19
|
</CHANGE_SUMMARY>
|
|
21
20
|
*/
|
|
22
21
|
|
|
@@ -199,6 +198,14 @@ export { createForgeNotesModule } from "../os/notes/notes.module.ts";
|
|
|
199
198
|
export { createForgeProgramModule } from "../os/program/program.module.ts";
|
|
200
199
|
export { forgePluginModule } from "../os/plugin/plugin.module.ts";
|
|
201
200
|
export { createForgeFlowModule } from "../os/flow/flow.module.ts";
|
|
201
|
+
export { createForgeSystemModule } from "../os/system/system.module.ts";
|
|
202
|
+
export {
|
|
203
|
+
assertSystemRepository,
|
|
204
|
+
edgeVerdict,
|
|
205
|
+
loadSystemMap,
|
|
206
|
+
validateSystemMap,
|
|
207
|
+
} from "../os/system/repo.ts";
|
|
208
|
+
export type { EdgeVerdict, SystemMap, SystemMapLoadResult } from "../os/system/repo.ts";
|
|
202
209
|
export type {
|
|
203
210
|
FlowBranchKind,
|
|
204
211
|
ParsedFlowBranch,
|
|
@@ -71,6 +71,7 @@ Treat these XML documents as the primary semantic layer for AI work and keep the
|
|
|
71
71
|
| fo-idea-status | fo | user | read-only |
|
|
72
72
|
| fo-knowledge-distill | fo | user | document-only |
|
|
73
73
|
| fo-memory-sync | fo | user | content-mutation |
|
|
74
|
+
| fo-outbox | fo | user | document-only |
|
|
74
75
|
| fo-qa | fo | user | document-only |
|
|
75
76
|
| fo-reproduce | fo | user | code-mutation |
|
|
76
77
|
| fo-review | fo | user | read-only |
|
|
@@ -78,6 +79,8 @@ Treat these XML documents as the primary semantic layer for AI work and keep the
|
|
|
78
79
|
| fo-session-save | fo | user | document-only |
|
|
79
80
|
| fo-spec-ingest | fo | user | document-only |
|
|
80
81
|
| fo-step-commit | fo | model | code-mutation |
|
|
82
|
+
| fo-system-dispatch | fo | user | document-only |
|
|
83
|
+
| fo-task-run | fo | user | code-mutation |
|
|
81
84
|
| fo-triage | fo | user | document-only |
|
|
82
85
|
| forge-bootstrap | meta | user | content-mutation |
|
|
83
86
|
| grilling | shared | user | read-only |
|
|
@@ -140,6 +143,7 @@ When the operator expresses an intent in natural language, the agent routes to t
|
|
|
140
143
|
| "show RFC and ADR status", "what is the status of this RFC", "list RFCs by status" | `fo-idea-status` |
|
|
141
144
|
| "distill knowledge", "compact skill knowledge", "knowledge lifecycle", "promote fix patterns" | `fo-knowledge-distill` |
|
|
142
145
|
| "sync memory from codex", "import external agent knowledge", "recall sessions from other tools", "sync memory from claude code" | `fo-memory-sync` |
|
|
146
|
+
| "request a contract", "add an outbox entry", "I need something another product provides" | `fo-outbox` |
|
|
143
147
|
| "I found a bug", "file a GitHub issue for this bug", "report a bug conversationally", "interactive QA session" | `fo-qa` |
|
|
144
148
|
| "reproduce the bug", "reproduce this defect", "prove it fails first", "reproduction-first", "подтверди дефект тестом" | `fo-reproduce` |
|
|
145
149
|
| "проверим всё ли сделали правильно", "проверь изменения", "review this session", "review this code diff", "check code against Forge standards" | `fo-review` |
|
|
@@ -147,6 +151,8 @@ When the operator expresses an intent in natural language, the agent routes to t
|
|
|
147
151
|
| "save this session", "enhance session transcript with annotations", "save session with quality checks" | `fo-session-save` |
|
|
148
152
|
| "ingest external specification", "vendor spec package into docs", "author spec skeleton" | `fo-spec-ingest` |
|
|
149
153
|
| "закоммитим", "commit after request", "auto-commit changes", "step commit" | `fo-step-commit` |
|
|
154
|
+
| "dispatch a system task", "run the system queue", "move a task to ready and dispatch it" | `fo-system-dispatch` |
|
|
155
|
+
| "run this task in the product", "execute the planted brief", "work this dispatched task" | `fo-task-run` |
|
|
150
156
|
| "triage this issue", "categorize incoming bug report", "triage external pull request", "process feature request" | `fo-triage` |
|
|
151
157
|
|
|
152
158
|
The agent uses judgment to calibrate routing — minor edits (typo fixes, small CSS changes) do not require skill invocation, while significant changes (new features, architectural decisions) do.
|
|
@@ -54,6 +54,15 @@ describe("RFC-1500: built-in profiles ship flow hooks (AC-4)", () => {
|
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
|
|
57
|
+
// forge validate exits 1 on a profile without artifacts, so such a gate
|
|
58
|
+
// would refuse every integration as soon as forge is installed.
|
|
59
|
+
it("integration-gate.sh runs forge validate only when the profile declares artifacts", () => {
|
|
60
|
+
const gate = files.find((f) => f.path === "hooks/integration-gate.sh");
|
|
61
|
+
expect(gate).toBeDefined();
|
|
62
|
+
const callsValidate = /\bforge validate\b/.test(gate!.content);
|
|
63
|
+
expect(callsValidate && (profile.artifacts ?? []).length === 0).toBe(false);
|
|
64
|
+
});
|
|
65
|
+
|
|
57
66
|
for (const hookPath of HOOK_PATHS) {
|
|
58
67
|
it(`${hookPath} starts with #!/bin/sh and parses with sh -n`, async () => {
|
|
59
68
|
const entry = files.find((f) => f.path === hookPath);
|
|
@@ -74,4 +83,10 @@ describe("RFC-1500: built-in profiles ship flow hooks (AC-4)", () => {
|
|
|
74
83
|
}
|
|
75
84
|
});
|
|
76
85
|
}
|
|
86
|
+
|
|
87
|
+
it("the system profile gates integrations on system.map.validate", () => {
|
|
88
|
+
const system = profiles.find((p) => p.id === "system");
|
|
89
|
+
const gate = system?.workspace.files.find((f) => f.path === "hooks/integration-gate.sh");
|
|
90
|
+
expect(gate?.content).toContain("pnpm exec forge system.map.validate");
|
|
91
|
+
});
|
|
77
92
|
});
|
|
@@ -9,6 +9,7 @@ Unit tests for profile schema covering its documented public contract and regres
|
|
|
9
9
|
</MODULE_CONTRACT>
|
|
10
10
|
<CHANGE_SUMMARY>
|
|
11
11
|
<item>RFC-0638: initial domain field tests — parsing, defaults, validation, backward compat.</item>
|
|
12
|
+
<item>RFC-1508: implement RFC-1508 — system profile, system map schemas and system.map.validate</item>
|
|
12
13
|
</CHANGE_SUMMARY>
|
|
13
14
|
*/
|
|
14
15
|
|
|
@@ -162,7 +163,7 @@ test("artifacts with missing required extensions field fails", () => {
|
|
|
162
163
|
|
|
163
164
|
test("all shipped profiles parse without changes", () => {
|
|
164
165
|
const profiles = listStackProfiles(FORGE_ROOT);
|
|
165
|
-
expect(profiles.length).toBe(
|
|
166
|
+
expect(profiles.length).toBe(7);
|
|
166
167
|
for (const profile of profiles) {
|
|
167
168
|
expect(profile.id).toBeDefined();
|
|
168
169
|
expect(profile.workspace.dirs.length).toBeGreaterThan(0);
|