@nusoft/nuos-build-catalogue 0.9.0 → 0.10.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.
Files changed (90) hide show
  1. package/dist/cli.d.ts +13 -0
  2. package/dist/cli.js +472 -0
  3. package/dist/commands/create.d.ts +70 -0
  4. package/dist/commands/create.js +341 -0
  5. package/dist/commands/format.d.ts +19 -0
  6. package/dist/commands/format.js +89 -0
  7. package/dist/commands/handlers.d.ts +35 -0
  8. package/dist/commands/handlers.js +132 -0
  9. package/dist/commands/init.d.ts +41 -0
  10. package/dist/commands/init.js +289 -0
  11. package/dist/commands/prompt.d.ts +44 -0
  12. package/dist/commands/prompt.js +100 -0
  13. package/dist/commands/write.d.ts +39 -0
  14. package/dist/commands/write.js +247 -0
  15. package/dist/embedder/ollama.d.ts +54 -0
  16. package/dist/embedder/ollama.js +164 -0
  17. package/dist/embedder/openai.d.ts +21 -0
  18. package/dist/embedder/openai.js +56 -0
  19. package/dist/embedder/select.d.ts +9 -0
  20. package/dist/embedder/select.js +27 -0
  21. package/dist/embedder/stub.d.ts +15 -0
  22. package/dist/embedder/stub.js +40 -0
  23. package/dist/embedder/types.d.ts +21 -0
  24. package/dist/embedder/types.js +6 -0
  25. package/dist/embedder/vertex.d.ts +41 -0
  26. package/dist/embedder/vertex.js +94 -0
  27. package/dist/indexer/chunk.d.ts +20 -0
  28. package/dist/indexer/chunk.js +196 -0
  29. package/dist/indexer/crawl.d.ts +20 -0
  30. package/dist/indexer/crawl.js +66 -0
  31. package/dist/indexer/metadata.d.ts +21 -0
  32. package/dist/indexer/metadata.js +126 -0
  33. package/dist/indexer/upsert.d.ts +26 -0
  34. package/dist/indexer/upsert.js +152 -0
  35. package/dist/migrate/parsers.d.ts +17 -0
  36. package/dist/migrate/parsers.js +123 -0
  37. package/dist/migrate/run.d.ts +22 -0
  38. package/dist/migrate/run.js +142 -0
  39. package/dist/migrate/store.d.ts +20 -0
  40. package/dist/migrate/store.js +52 -0
  41. package/dist/migrate/types.d.ts +57 -0
  42. package/dist/migrate/types.js +13 -0
  43. package/dist/regenerate/check.d.ts +11 -0
  44. package/dist/regenerate/check.js +97 -0
  45. package/dist/regenerate/diff.d.ts +18 -0
  46. package/dist/regenerate/diff.js +38 -0
  47. package/dist/regenerate/types.d.ts +52 -0
  48. package/dist/regenerate/types.js +14 -0
  49. package/dist/runtime/ac-parse.d.ts +63 -0
  50. package/dist/runtime/ac-parse.js +196 -0
  51. package/dist/runtime/markdown-edit.d.ts +53 -0
  52. package/dist/runtime/markdown-edit.js +101 -0
  53. package/dist/runtime/markdown-render.d.ts +27 -0
  54. package/dist/runtime/markdown-render.js +209 -0
  55. package/dist/runtime/mis-adapter.d.ts +35 -0
  56. package/dist/runtime/mis-adapter.js +364 -0
  57. package/dist/runtime/runtime.d.ts +20 -0
  58. package/dist/runtime/runtime.js +39 -0
  59. package/dist/search/format.d.ts +6 -0
  60. package/dist/search/format.js +23 -0
  61. package/dist/search/query.d.ts +29 -0
  62. package/dist/search/query.js +71 -0
  63. package/dist/store/open.d.ts +14 -0
  64. package/dist/store/open.js +16 -0
  65. package/package.json +5 -3
  66. package/templates/protocols/end-of-session.md +19 -0
  67. package/templates/protocols/persona-new.md +43 -0
  68. package/templates/protocols/start-of-session.md +19 -0
  69. package/templates/protocols/wu-new.md +52 -0
  70. package/templates/starter-kit/CLAUDE.md +73 -0
  71. package/templates/starter-kit/README.md +116 -0
  72. package/templates/starter-kit/docs/build/END-OF-SESSION.md +62 -0
  73. package/templates/starter-kit/docs/build/START-OF-SESSION.md +33 -0
  74. package/templates/starter-kit/docs/build/STATE.md +47 -0
  75. package/templates/starter-kit/docs/build/decisions/D001-template.md +38 -0
  76. package/templates/starter-kit/docs/build/decisions/_index.md +30 -0
  77. package/templates/starter-kit/docs/build/maps/01-template.md +126 -0
  78. package/templates/starter-kit/docs/build/maps/_index.md +63 -0
  79. package/templates/starter-kit/docs/build/open-questions/_index.md +26 -0
  80. package/templates/starter-kit/docs/build/personas/001-template.md +68 -0
  81. package/templates/starter-kit/docs/build/personas/_index.md +77 -0
  82. package/templates/starter-kit/docs/build/risks/_index.md +28 -0
  83. package/templates/starter-kit/docs/build/sessions/0000-00-00-template.md +47 -0
  84. package/templates/starter-kit/docs/build/sessions/_index.md +27 -0
  85. package/templates/starter-kit/docs/build/work-units/001-template.md +82 -0
  86. package/templates/starter-kit/docs/build/work-units/_index.md +34 -0
  87. package/templates/starter-kit/docs/contracts/_index.md +26 -0
  88. package/templates/starter-kit/docs/guides/_index.md +26 -0
  89. package/templates/starter-kit/docs/philosophy/_index.md +26 -0
  90. package/templates/starter-kit/methodfile.json +54 -0
@@ -0,0 +1,82 @@
1
+ # Work Unit 001 — [Outcome-bounded title, e.g., "Bookshop event booking flow" or "Bootstrap the Postgres schema"]
2
+
3
+ | Field | Value |
4
+ | --- | --- |
5
+ | Status | 🟡 in flight |
6
+ | Depends on | none |
7
+ | Blocks | [WUs that cannot start until this lands] |
8
+ | Implements | [the decision or pattern this realises] |
9
+ | Owner | [name or "—"] |
10
+ | Estimated effort | [days or "small/medium/large"] |
11
+ | Repo | [where the implementation lands] |
12
+
13
+ ## Persona
14
+
15
+ [Link to the P-NNN persona this outcome serves — e.g., `[P001 — Returning bookshop customer](../personas/P001-returning-customer.md)`. For paired outcomes, link both personas. For infrastructure WUs (build, publish, hardening), write `N/A — infrastructure WU.`]
16
+
17
+ ## Trigger
18
+
19
+ [The real-world event that makes this outcome necessary. Not "the user clicks the booking button" — that is a UI interaction. The trigger is what happened *before* they opened the platform: "the customer saw an event announcement on social media and wants to reserve a place", "the SENCo received an email that a child has been placed on the SEN register". For infrastructure WUs, write `N/A — infrastructure WU.`]
20
+
21
+ ## Outcome
22
+
23
+ [One paragraph. The single sentence test: *what will be true when this is done that is not true now?* That sentence is the outcome.]
24
+
25
+ ## Walkthrough
26
+
27
+ [Numbered steps from the persona's perspective — what they do and what they see. Include failure paths via the five injection points: (1) what if the persona cannot complete this step in one sitting? (2) what if the information they need is incorrect or missing? (3) what if the system itself fails? (4) what if the persona makes a mistake? (5) what if they realise immediately afterwards they used the wrong information?
28
+
29
+ For infrastructure WUs, write `N/A — infrastructure WU.`]
30
+
31
+ 1. [Persona action; system response; including any failure handling that lives at this step]
32
+ 2. ...
33
+
34
+ ## Acceptance criteria
35
+
36
+ When this WU is `✅ merged / shipped`:
37
+
38
+ 1. [Concrete, observable, checkable criterion — phrased as an inspection that passes or fails. Each criterion must be evaluable by a person looking at the running system, not inferred from technical state.]
39
+ 2. ...
40
+
41
+ The auditor's-question test applies: *can a third-party reader read these and confirm "yes, this is shipped" by inspection alone?*
42
+
43
+ The four quality traps apply when reviewing acceptance criteria: vagueness (could this be implemented in more than one way that satisfies the wording?); technical language (does this describe implementation rather than behaviour?); happy-path-only (have failure paths been covered?); kitchen-sink (does this WU try to do more than one thing?).
44
+
45
+ ## Contracts produced
46
+
47
+ [What this WU makes available to other WUs once it lands, in domain language. Not database schemas, not API endpoints — facts about the world that the system now knows. Examples:
48
+
49
+ - "A confirmed booking record, linked to a specific customer and a specific event"
50
+ - "A verified customer account: name, email, login credentials, saved payment method"
51
+ - "A published event with capacity, price, and date"
52
+
53
+ For infrastructure WUs, list the technical artefacts: "A `@nusoft/nuwiki@0.1.4` published privately on npm with caret-range trifecta deps".]
54
+
55
+ ## Contracts consumed
56
+
57
+ [What must already exist before this WU can run. Each entry should map to another WU's `Contracts produced` field. If something this WU consumes is not produced by any WU in the plan, that is a planning gap — file it as an open question or a new WU before this one starts.]
58
+
59
+ ## Approach
60
+
61
+ [Two or three short paragraphs. Not a design doc; just enough that an LLM teammate or a fresh operator can see how the work breaks down. If "design twice" applies (any non-trivial architectural choice), produce two fundamentally different designs in the Notes section before generating implementation.]
62
+
63
+ ## What this WU does NOT do
64
+
65
+ - [Things deliberately deferred to later WUs]
66
+ - [Things that look in-scope but are not]
67
+
68
+ ## Forward-compatibility commitments
69
+
70
+ [If this WU's shape decisions affect later WUs, name them here. Future WUs depend on these surviving.]
71
+
72
+ ## Notes / log
73
+
74
+ ### {{TODAY}} — session 1
75
+ [What was attempted, what worked, what did not, what was learned, what is next.]
76
+
77
+ ## Pointers
78
+
79
+ - [Link to the decision this implements, if any]
80
+ - [Link to the persona(s) this serves]
81
+ - [Links to dependent WUs (those this consumes from, those this blocks)]
82
+ - [Links to relevant module-level contracts in `docs/contracts/`]
@@ -0,0 +1,34 @@
1
+ # Work Units
2
+
3
+ > Concrete, buildable pieces of work. Each work unit has an outcome, acceptance criteria, dependencies, and a status. Work units are the unit of progress; the catalogue's compounding value comes from accumulated WU notes.
4
+
5
+ ## Index
6
+
7
+ | WU | Title | Status | Depends on | Notes |
8
+ | --- | --- | --- | --- | --- |
9
+ | 001 | [first WU title] | 🟡 in flight | — | First work unit |
10
+
11
+ ## Status legend
12
+
13
+ - 🔵 **proposed** — written down, not yet started
14
+ - 🟡 **in flight** — actively being worked on
15
+ - 🟣 **built / awaiting review** — implementation done, review pending
16
+ - ✅ **merged / shipped** — complete and integrated
17
+ - 🔴 **blocked** — cannot proceed; see notes for blocker
18
+
19
+ ## Deferred / proposed-with-trigger work units
20
+
21
+ A work unit can be `🔵 proposed` in three flavours:
22
+
23
+ - **proposed-ready** — eligible to activate at next priority review
24
+ - **proposed-deferred-with-trigger** — committed, awaiting a checkable condition (state the condition in the WU itself)
25
+ - **proposed-blocked-on-question** — cannot activate until an open question resolves; link to the Q-NNN
26
+
27
+ The quarterly catalogue review walks each deferred WU and re-evaluates its trigger.
28
+
29
+ ## How to add a work unit
30
+
31
+ 1. Copy `001-template.md` to `NNN-short-title-with-dashes.md` (next available number)
32
+ 2. Fill in the template
33
+ 3. Add a row to the table above
34
+ 4. If the WU resolves an open question, link it; if the WU was created in response to a decision, link the decision
@@ -0,0 +1,26 @@
1
+ # Contracts
2
+
3
+ > Type-stable surfaces — what each part of {{PROJECT_NAME}} promises to its consumers. Where decisions justify *why* and philosophy frames the spirit, contracts specify *what is true at the boundary*. A contract is what an integrator (human or LLM) reads to know how to interact with this part of the system.
4
+
5
+ ## When to write a contract
6
+
7
+ Not on day one. Contracts come when stable surfaces emerge — when something has been built, tested, and is being depended on by other parts of the system or other projects.
8
+
9
+ Premature contracts ossify the wrong shape. Late contracts allow drift. The signal a contract is needed: a downstream consumer is asking *"what does X actually guarantee?"* and the answer is not in any single place.
10
+
11
+ ## Index
12
+
13
+ | Contract | Surface | Status |
14
+ | --- | --- | --- |
15
+ | _none yet_ | | |
16
+
17
+ ## Pattern
18
+
19
+ Each contract document:
20
+ - Names the surface
21
+ - Lists the type-stable promises (what shape inputs come in, what shape outputs go out, what side effects fire)
22
+ - Specifies the conformance gate (the test or check that proves a candidate implementation honours the contract)
23
+ - Lists what is *not* covered (so consumers don't depend on incidentals)
24
+ - Records the contract's version (semver if it's published)
25
+
26
+ Contracts are change-controlled. Breaking a contract requires a decision (D-NNN) and a downstream-impact note.
@@ -0,0 +1,26 @@
1
+ # Guides
2
+
3
+ > The persuasion layer. Where decisions are committed-to, contracts are typed, and philosophy is committed-architectural-spirit, **guides are written to persuade**. They explain {{PROJECT_NAME}} to investors, customers, partners, regulators, and domain experts. They are the artefact you send when you need a non-technical reader to understand and care.
4
+
5
+ ## When to write a guide
6
+
7
+ When you need to persuade somebody. Not before. A guide written without an audience and a goal is academic. A guide written *for an audience* against a known goal is the most leveraged writing you can do — it is the artefact that opens conversations, closes deals, and aligns stakeholders.
8
+
9
+ The catalogue's other layers are the source material. A guide is the curated, audience-tuned read.
10
+
11
+ ## Index
12
+
13
+ | Guide | Audience | Topic |
14
+ | --- | --- | --- |
15
+ | _none yet_ | | |
16
+
17
+ ## Pattern
18
+
19
+ Each guide:
20
+ - States the audience explicitly (one or two reader personas)
21
+ - States the goal — what should the reader do or believe after reading?
22
+ - Stays in the language of the audience (no jargon the audience doesn't already use)
23
+ - Cites the catalogue (decisions, contracts, philosophy) as evidence
24
+ - Is dated — guides go stale; the date tells the reader whether they're reading current
25
+
26
+ A guide is not eternal. When the underlying truth shifts, the guide gets revised or retired. Catalogue decisions persist; guides are seasonal.
@@ -0,0 +1,26 @@
1
+ # Philosophy
2
+
3
+ > The architectural commitments of {{PROJECT_NAME}}, in narrative form. Where decisions (D-NNN) are point-in-time choices, philosophy documents are *the story of why the project is shaped this way at all*. They are read by anyone integrating with the project, by investors, and by future operators trying to understand the spirit of the system.
4
+
5
+ ## When to write a philosophy document
6
+
7
+ Not on day one. Philosophy emerges as decisions accumulate. By around D010 — perhaps D020 — patterns are visible across decisions: a recurring concern, a consistent prioritisation, an architectural commitment that was never written down because every decision implied it.
8
+
9
+ That is when a philosophy doc becomes worth writing. One short narrative-form document per cross-cutting commitment. Examples from NuOS: *separation of personal data and AI inference*, *intent-typed boundaries*, *PII isolation*.
10
+
11
+ ## Index
12
+
13
+ | Doc | Topic |
14
+ | --- | --- |
15
+ | _none yet — philosophy emerges as decisions accumulate_ | |
16
+
17
+ ## Pattern
18
+
19
+ Each philosophy doc:
20
+ - Names the commitment in present tense
21
+ - Gives the historical context — what was wrong with the alternatives
22
+ - States the architectural implications
23
+ - Lists the decisions that implement it
24
+ - Lists the contracts and surfaces it constrains
25
+
26
+ Philosophy docs are the *upstream* of decisions. A new decision should be checkable against the philosophy: is this consistent with the project's commitments? If not, either the decision is wrong or the philosophy needs revisiting.
@@ -0,0 +1,54 @@
1
+ {
2
+ "$schema": "https://nusoft.dev/schemas/methodfile/v1.json",
3
+ "method": {
4
+ "version": "1.0",
5
+ "lastValidatedAt": "{{TODAY}}"
6
+ },
7
+ "project": {
8
+ "name": "{{PROJECT_NAME}}",
9
+ "tagline": "{{PROJECT_TAGLINE}}",
10
+ "domain": "{{PROJECT_DOMAIN}}"
11
+ },
12
+ "catalogue": {
13
+ "root": "docs/build/",
14
+ "registers": {
15
+ "decisions": "decisions/",
16
+ "workUnits": "work-units/",
17
+ "sessions": "sessions/",
18
+ "risks": "risks/",
19
+ "openQuestions": "open-questions/"
20
+ },
21
+ "snapshot": "STATE.md",
22
+ "protocols": {
23
+ "startOfSession": "START-OF-SESSION.md",
24
+ "endOfSession": "END-OF-SESSION.md"
25
+ },
26
+ "supportingLayers": {
27
+ "philosophy": "../philosophy/",
28
+ "contracts": "../contracts/",
29
+ "guides": "../guides/"
30
+ }
31
+ },
32
+ "harness": {
33
+ "wired": false,
34
+ "runtime": {
35
+ "nuvector": null,
36
+ "nuflow": null,
37
+ "nuwiki": null
38
+ },
39
+ "packs": {
40
+ "method": null
41
+ },
42
+ "documentTypes": []
43
+ },
44
+ "domain": {
45
+ "type": "standard",
46
+ "confidentialityRequired": false,
47
+ "auditRetentionMonths": 0
48
+ },
49
+ "ecology": {
50
+ "role": "{{PROJECT_ROLE}}",
51
+ "parentCatalogue": null,
52
+ "siblingCatalogues": []
53
+ }
54
+ }