pi-aia-asf 0.4.0 → 0.6.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/CHANGELOG.md CHANGED
@@ -7,6 +7,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.6.0] - 2026-08-28
11
+
12
+ ### Added
13
+
14
+ - **06c Rule 9 — Documents are code: refactor them when they outgrow
15
+ editability** (new mandatory rule, Ai Applied tenet): when a document starts
16
+ causing writing/editing issues (edit-tool matching failures, truncation,
17
+ multi-topic bloat, every change touching the same big file), it is time to
18
+ refactor it — split by topic, keep the parent as an index/map, keep
19
+ cross-references exact, preserve content (Rule 8 applied to documents),
20
+ verify, and refactor before it hurts rather than after.
21
+ - **Wiring**: 06c "Where this applies" (Phase 6 + Phase 7), 06c anti-patterns
22
+ (letting a document grow until edits break; wall-of-prose SKILL.md), SKILL.md
23
+ Phase 6 note, Phase 7 modularity DoD (documents too), SKILL.md anti-pattern,
24
+ and the reference index (now 9 rules).
25
+
26
+ ## [0.5.0] - 2026-08-28
27
+
28
+ ### Added
29
+
30
+ - **06b Rule 15 — bound every long-running operation** (new mandatory QA rule):
31
+ state the expected duration before running any long command (package installs,
32
+ platform/test-harness startup, browser/daemon launches, full suites); ALWAYS
33
+ wrap it in a hard timeout (`timeout N …` / tool timeout parameter); exceeding
34
+ the bound is a bug signal — kill and diagnose the root cause; if the bound
35
+ proves too short, raise it deliberately with a reason. Rooted in the user
36
+ report of package hangs lasting up to 50,000 seconds with the agent waiting
37
+ idle. Added to the Rule 10 definition-of-done checklist.
38
+ - **SKILL.md discipline rule 6 — Bounded waits — ALWAYS** (renumbered rules
39
+ 7–10): the same rule at the phase level, with the 50,000-second hang as the
40
+ anti-example.
41
+ - **07-release.md**: "Verify first" step now requires every long-running
42
+ verification command to have run under an explicit timeout with a stated
43
+ expected duration.
44
+
10
45
  ## [0.4.0] - 2026-08-28
11
46
 
12
47
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-aia-asf",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Ai Applied Agentic Software Factory — codifies the full software development flow: intake, research, spec capture, adversarial analysis, planning with approval gates, test-first implementation, and release. Requires pi-vigilant, pi-smart-web-search, pi-smart-fetch, pi-aia-browser, and pi-intercom.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -180,7 +180,10 @@ Keep the plan **implementation-ready**: any competent engineer (or agent) can ex
180
180
  > SSOT); no hardcoding (config-driven); **testable outside the host then integrated
181
181
  > verbatim** (same modules in tests and production); refactor what is too complex to
182
182
  > understand; layered with clear boundaries and an architecture writeup; full I/O debug
183
- > logging with replay; nothing breaks existing functionality.
183
+ > logging with replay; nothing breaks existing functionality. **Documents are code too
184
+ > (Rule 9): when a document outgrows editability (failing edits, truncation, multi-topic
185
+ > bloat), split it by topic and keep the parent as an index — never let it grow until
186
+ > editing breaks.**
184
187
 
185
188
  > **Read `references/06d-delegation.md` before delegating.** Work may be delegated two ways:
186
189
  > **intercom** (message another live pi session that owns relevant context — always `list`
@@ -200,10 +203,11 @@ Execute the task list milestone by milestone. Discipline rules:
200
203
  3. **No scope creep**: if something new is discovered that changes specs, capture it, ask the user, and update the plan before implementing.
201
204
  4. **Descriptive commits**: `git commit -m "type: specific description of what and why"` (e.g. `fix: verify specs before rotation`). No vague messages, no placeholders.
202
205
  5. **Browser testing — MANDATORY for any web interface**: if the deliverable has a UI/website/web app, test it through `pi-aia-browser` (`browser_init`, `browser_navigate`, `browser_click`, `browser_type`, `browser_screenshot`, `browser_dom`, …) to replicate the user's real experience — not just curl/API checks. Verify: loads, key user journeys, responsive behavior, console errors. **Silent async paths included**: ingest through the real flow and wait for the enrichment to land (06b Rule 9).
203
- 6. **Let pi-vigilant do its job**: it will auto-continue after premature stops and verify specs at settle. When it asks for `update_spec_status` with evidence, do it.
204
- 7. **CHANGELOG discipline**: every user-visible change gets a CHANGELOG entry describing exactly what changed (no placeholder text).
205
- 8. **Challenge approved designs (M4)**: if a spec's literal reading creates product tension (e.g. feedback clusters under "Plan" when "Plan = plans"), stop and resolve it with the user before implementing — never implement blindly and call it delivered.
206
- 9. **Trace before claiming delivered (M5)**: the delivery log is a claim; the code is the evidence. Before marking anything ✅, trace the actual code path, confirm the output is consumed by a surface, and confirm the operator-facing outcome test passes.
206
+ 6. **Bounded waits — ALWAYS (06b Rule 15)**: before any long-running command (package install, platform/test-harness startup, browser/daemon launch, full suite), **state the expected duration explicitly** and wrap it in a **hard timeout** (`timeout N …` or the tool's `timeout` parameter) — never run unbounded. If it exceeds the bound: kill it, diagnose what it is blocking on, fix the root cause. If the bound proves too short, raise it deliberately with a reason — never silently extend, never remove the bound. A 50,000-second hang is a failure to investigate, not patience.
207
+ 7. **Let pi-vigilant do its job**: it will auto-continue after premature stops and verify specs at settle. When it asks for `update_spec_status` with evidence, do it.
208
+ 8. **CHANGELOG discipline**: every user-visible change gets a CHANGELOG entry describing exactly what changed (no placeholder text).
209
+ 9. **Challenge approved designs (M4)**: if a spec's literal reading creates product tension (e.g. feedback clusters under "Plan" when "Plan = plans"), stop and resolve it with the user before implementing — never implement blindly and call it delivered.
210
+ 10. **Trace before claiming delivered (M5)**: the delivery log is a claim; the code is the evidence. Before marking anything ✅, trace the actual code path, confirm the output is consumed by a surface, and confirm the operator-facing outcome test passes.
207
211
 
208
212
  ---
209
213
 
@@ -211,7 +215,7 @@ Execute the task list milestone by milestone. Discipline rules:
211
215
 
212
216
  Run the **Definition of Done checklist** in `references/06b-testing-qa.md` (Rule 10). Every box must hold.
213
217
 
214
- Also check the **modularity DoD** from `references/06c-code-quality.md` (Phase 7 section): no duplicated shared logic, no hardcoded config values, every module tested standalone with the same calls it gets in the host, architecture writeup exists, existing functionality still green.
218
+ Also check the **modularity DoD** from `references/06c-code-quality.md` (Phase 7 section): no duplicated shared logic, no hardcoded config values, every module tested standalone with the same calls it gets in the host, architecture writeup exists, existing functionality still green. **Documents too (06c Rule 9)**: no document so large that editing it is fragile — if a doc you worked on started causing edit failures/truncation, it was refactored (split by topic, parent kept as index, cross-references updated).
215
219
 
216
220
  **Large work:** run `/asf verify` — it mechanically validates the **spec-to-code traceability matrix** (M1): every `met` spec must carry `trace` (outcome → codePath → testFile + assertion), testFile must exist, assertion must appear in it. FAIL rows block delivery. **Verify ingested specs from external planning docs too** — the doc's ✅ markers are claims, not evidence.
217
221
 
@@ -255,6 +259,7 @@ Also check the **modularity DoD** from `references/06c-code-quality.md` (Phase 7
255
259
  - ❌ Escalation/fallback logic re-implemented per caller instead of one shared escalation path
256
260
  - ❌ Shipping a module that cannot run/test standalone outside the host
257
261
  - ❌ Refactoring without the architecture writeup (see `references/06c-code-quality.md`)
262
+ - ❌ Letting a document grow until edits start breaking instead of splitting it (06c Rule 9)
258
263
  - ❌ Running parallel subagents that touch the same file — edits are silently lost (see `references/06d-delegation.md`)
259
264
  - ❌ Trusting a subagent's exit code or self-report instead of verifying the actual code/test result
260
265
  - ❌ Re-deriving context another live session already has instead of asking it over intercom
@@ -273,6 +278,6 @@ Also check the **modularity DoD** from `references/06c-code-quality.md` (Phase 7
273
278
  - `references/05-plan.md` — PLAN.md template with examples (incl. spec-to-code traceability matrix)
274
279
  - `references/06-implementation.md` — coding discipline details (incl. M4 challenge designs, M5 trace before claiming)
275
280
  - `references/06b-testing-qa.md` — **mandatory testing & QA standard** (14 rules + definition of done)
276
- - `references/06c-code-quality.md` — **mandatory modularity & maintainability standard** (8 rules, SSOT, testable-standalone, single escalation path)
281
+ - `references/06c-code-quality.md` — **mandatory modularity & maintainability standard** (9 rules, SSOT, testable-standalone, single escalation path, documents-are-code)
277
282
  - `references/06d-delegation.md` — **intercom & subagents**: when to message another session, when to spawn isolated workers, the no-mutual-dependencies rule, and why exit codes lie
278
283
  - `references/07-release.md` — release workflow (versioning, CHANGELOG, tags, npm, CI/CD)
@@ -146,6 +146,7 @@ never arrives, the wiring is dead — that is a failed test.
146
146
  - [ ] **Consumed by a surface: every delivered feature's output is visible in the product (UI or API) — nothing ships as dead machinery**
147
147
  - [ ] **E2E behavioral test: every feature spec has a test through the real entry point asserting the operator-facing outcome**
148
148
  - [ ] Unverifiable specs → `partial` + asked the user (never self-certified)
149
+ - [ ] **Every long-running command ran under an explicit timeout with a stated expected duration (no unbounded waits)**
149
150
 
150
151
  ## Rule 11 — Report honestly
151
152
 
@@ -194,3 +195,24 @@ done — the wiring may be dead.
194
195
  - **Scale note:** mandatory for feature specs in **large/gated work**. For small
195
196
  work, required only when the change touches a surface/wiring; otherwise the
196
197
  standard test-first rules above suffice.
198
+
199
+ ## Rule 15 — Bound every long-running operation: state the expected duration, then enforce it
200
+
201
+ > **Real failure (user report):** package installs / platform startups / test
202
+ > harnesses hung for up to **50,000 seconds** while the agent waited, doing
203
+ > nothing. An unbounded wait is not patience — it is a silent stall.
204
+
205
+ - **State the expected duration before running.** "This install should take
206
+ ~2 min", "first platform startup ~10 min", "suite ~3 min". The expectation is
207
+ part of the command, not an afterthought.
208
+ - **ALWAYS wrap it in a hard timeout** — `timeout 300 …` for shell commands, an
209
+ explicit `timeout` parameter for tool calls. Never run unbounded.
210
+ - **Exceeding the bound is a bug signal, not a slow command.** Kill it and
211
+ diagnose immediately: what is it blocking on (network, lock, hung process,
212
+ missing dependency, waiting for input)? Fix the root cause.
213
+ - **If the bound proves too short, raise it deliberately** — state the new
214
+ expectation and the reason ("first-time platform startup needs 10 min;
215
+ bound raised to 900s"). Never silently extend, never remove the bound.
216
+ - **A hang that outlives its expected duration is a failure to investigate,**
217
+ not a wait to endure. If you cannot verify something within a bounded time,
218
+ say so explicitly (Rule 11) instead of waiting indefinitely.
@@ -141,6 +141,38 @@ existing functionality. Each rule below carries the lesson.
141
141
  - This is the SSOT/refactor safety net: refactoring restructures *structure*,
142
142
  never *behavior*.
143
143
 
144
+ ## Rule 9 — Documents are code: refactor them when they outgrow editability
145
+
146
+ > *"Whenever documents you work on become so big that they start causing
147
+ > writing / editing issues, it's time to refactor them."* — Ai Applied tenet
148
+
149
+ A document that is too big to edit safely is a **maintainability bug**, not a
150
+ fact of life. The same triggers that say "extract a module" for code say
151
+ "split this document" for docs:
152
+
153
+ - **Edit-tool failures**: `oldText` matching starts failing or needs huge
154
+ context; edits become fragile and overlapping.
155
+ - **Truncation**: the file approaches context limits; reads get cut off;
156
+ you can no longer see the whole document.
157
+ - **Multi-topic bloat**: one file covers several distinct subjects (e.g. a
158
+ SKILL.md that has grown into a wall of prose instead of a map).
159
+ - **Every change touches the same big file**: constant conflict risk, slow
160
+ review, no single place to look.
161
+
162
+ **The refactor pattern (documents):**
163
+
164
+ 1. **Split by topic** — one subject per document (like one responsibility per
165
+ module). Move detail into focused references; keep the parent as an
166
+ **index/map** that points to them.
167
+ 2. **Keep cross-references exact** — every pointer to the old content is
168
+ updated; nothing dangles.
169
+ 3. **Preserve content** — a doc refactor moves text, it does not rewrite or
170
+ drop it (Rule 8 applied to documents).
171
+ 4. **Verify** — re-read the split docs, confirm every referenced rule/topic
172
+ still exists and is reachable, and that the frontmatter/format stays valid.
173
+ 5. **Refactor before it hurts, not after** — if you notice edit friction
174
+ starting, that is the moment. Do not wait for a broken edit.
175
+
144
176
  ---
145
177
 
146
178
  ## Where this applies in ASF
@@ -152,11 +184,14 @@ existing functionality. Each rule below carries the lesson.
152
184
  their boundaries, the one-way dependencies, where shared truth lives, and
153
185
  how each module is tested standalone.
154
186
  - **Phase 6 (implementation)**: apply Rules 1–8 as you build; extract modules
155
- when triggers fire; write the architecture doc alongside the code.
187
+ when triggers fire; write the architecture doc alongside the code. Apply
188
+ Rule 9 to the documents you write: SKILL.md, references, PLAN.md, README —
189
+ split them when they outgrow editability.
156
190
  - **Phase 7 (verification)**: the DoD checklist includes: no duplicated shared
157
191
  logic (Rule 2), no hardcoded config values (Rule 3), every module tested
158
192
  standalone with the same calls (Rule 4), architecture doc written (Rule 6),
159
- existing functionality still green (Rule 8).
193
+ existing functionality still green (Rule 8). Documents: no doc so large that
194
+ editing it is fragile (Rule 9).
160
195
 
161
196
  ## Anti-patterns
162
197
 
@@ -168,3 +203,6 @@ existing functionality. Each rule below carries the lesson.
168
203
  - ❌ Refactoring "for fun" without the testability/debugging payoff
169
204
  - ❌ Shipping a module that cannot run outside the host
170
205
  - ❌ Skipping the architecture writeup ("the code is self-documenting")
206
+ - ❌ Letting a document grow until edits start breaking instead of splitting it
207
+ (Rule 9)
208
+ - ❌ A SKILL.md that is a wall of prose instead of a map to focused references
@@ -15,6 +15,7 @@ Publishing is **always the user's decision**. The factory prepares everything; t
15
15
  - typecheck / build passes
16
16
  - test suite green
17
17
  - all MUST specs `met` in pi-vigilant
18
+ - every long-running verification command ran under an explicit timeout with a stated expected duration (06b Rule 15) — no unbounded waits
18
19
  2. **Version bump** — semantic versioning:
19
20
  - `patch` (0.1.0 → 0.1.1): bug fixes
20
21
  - `minor` (0.1.0 → 0.2.0): new features, backward compatible