@nac3/forge-cli 1.9.2 → 1.11.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.
Files changed (107) hide show
  1. package/dist/chat/doctrine_digest.d.ts.map +1 -1
  2. package/dist/chat/doctrine_digest.js +15 -0
  3. package/dist/chat/doctrine_digest.js.map +1 -1
  4. package/dist/chat/panel.d.ts.map +1 -1
  5. package/dist/chat/panel.js +13363 -12980
  6. package/dist/chat/panel.js.map +1 -1
  7. package/dist/chat/server.d.ts.map +1 -1
  8. package/dist/chat/server.js +86 -10
  9. package/dist/chat/server.js.map +1 -1
  10. package/dist/chat/sizing_section.d.ts +9 -0
  11. package/dist/chat/sizing_section.d.ts.map +1 -0
  12. package/dist/chat/sizing_section.js +73 -0
  13. package/dist/chat/sizing_section.js.map +1 -0
  14. package/dist/chat/tools/app_backend_dispatch.d.ts.map +1 -1
  15. package/dist/chat/tools/app_backend_dispatch.js +46 -0
  16. package/dist/chat/tools/app_backend_dispatch.js.map +1 -1
  17. package/dist/chat/tools/config_write.d.ts +2 -3
  18. package/dist/chat/tools/config_write.d.ts.map +1 -1
  19. package/dist/chat/tools/config_write.js +3 -13
  20. package/dist/chat/tools/config_write.js.map +1 -1
  21. package/dist/chat/tools/pending.d.ts +8 -0
  22. package/dist/chat/tools/pending.d.ts.map +1 -1
  23. package/dist/chat/tools/pending.js +26 -0
  24. package/dist/chat/tools/pending.js.map +1 -1
  25. package/dist/chat/tools/shell.d.ts +5 -0
  26. package/dist/chat/tools/shell.d.ts.map +1 -1
  27. package/dist/chat/tools/shell.js +60 -0
  28. package/dist/chat/tools/shell.js.map +1 -1
  29. package/dist/chat/tools/sizing.d.ts +66 -0
  30. package/dist/chat/tools/sizing.d.ts.map +1 -0
  31. package/dist/chat/tools/sizing.js +171 -0
  32. package/dist/chat/tools/sizing.js.map +1 -0
  33. package/dist/chat/tools.d.ts.map +1 -1
  34. package/dist/chat/tools.js +25 -2
  35. package/dist/chat/tools.js.map +1 -1
  36. package/dist/commands/clarify.d.ts.map +1 -1
  37. package/dist/commands/clarify.js +163 -1
  38. package/dist/commands/clarify.js.map +1 -1
  39. package/dist/commands/pending.d.ts.map +1 -1
  40. package/dist/commands/pending.js +9 -0
  41. package/dist/commands/pending.js.map +1 -1
  42. package/dist/commands/triage.d.ts +61 -7
  43. package/dist/commands/triage.d.ts.map +1 -1
  44. package/dist/commands/triage.js +106 -13
  45. package/dist/commands/triage.js.map +1 -1
  46. package/dist/core/forge_profile.d.ts +11 -1
  47. package/dist/core/forge_profile.d.ts.map +1 -1
  48. package/dist/core/forge_profile.js +39 -1
  49. package/dist/core/forge_profile.js.map +1 -1
  50. package/dist/core/operate_guard.d.ts +3 -0
  51. package/dist/core/operate_guard.d.ts.map +1 -1
  52. package/dist/core/operate_guard.js +13 -0
  53. package/dist/core/operate_guard.js.map +1 -1
  54. package/dist/docs/doctrine/gates.md +33 -21
  55. package/dist/docs/doctrine/sizing.md +182 -0
  56. package/dist/nac3/backend_tools.d.ts +14 -0
  57. package/dist/nac3/backend_tools.d.ts.map +1 -1
  58. package/dist/nac3/backend_tools.js +31 -1
  59. package/dist/nac3/backend_tools.js.map +1 -1
  60. package/dist/nac3/internal_manifest.d.ts.map +1 -1
  61. package/dist/nac3/internal_manifest.js +172 -5
  62. package/dist/nac3/internal_manifest.js.map +1 -1
  63. package/dist/pending/commit_files.d.ts +3 -0
  64. package/dist/pending/commit_files.d.ts.map +1 -0
  65. package/dist/pending/commit_files.js +42 -0
  66. package/dist/pending/commit_files.js.map +1 -0
  67. package/dist/pending/store.d.ts +12 -0
  68. package/dist/pending/store.d.ts.map +1 -1
  69. package/dist/pending/store.js +66 -0
  70. package/dist/pending/store.js.map +1 -1
  71. package/dist/pending/types.d.ts +50 -0
  72. package/dist/pending/types.d.ts.map +1 -1
  73. package/dist/pending/types.js.map +1 -1
  74. package/dist/sizing/model.d.ts +200 -0
  75. package/dist/sizing/model.d.ts.map +1 -0
  76. package/dist/sizing/model.js +423 -0
  77. package/dist/sizing/model.js.map +1 -0
  78. package/dist/sizing/store.d.ts +114 -0
  79. package/dist/sizing/store.d.ts.map +1 -0
  80. package/dist/sizing/store.js +235 -0
  81. package/dist/sizing/store.js.map +1 -0
  82. package/dist/tasks/supervisor.d.ts +21 -0
  83. package/dist/tasks/supervisor.d.ts.map +1 -1
  84. package/dist/tasks/supervisor.js +39 -3
  85. package/dist/tasks/supervisor.js.map +1 -1
  86. package/dist/version.d.ts +1 -1
  87. package/dist/version.d.ts.map +1 -1
  88. package/dist/version.js +1 -1
  89. package/dist/version.js.map +1 -1
  90. package/dist/workflow/definitions.js +1 -1
  91. package/dist/workflow/definitions.js.map +1 -1
  92. package/dist/workflow/state.d.ts +28 -0
  93. package/dist/workflow/state.d.ts.map +1 -1
  94. package/dist/workflow/state.js.map +1 -1
  95. package/docs/doctrine/gates.md +33 -21
  96. package/docs/doctrine/sizing.md +182 -0
  97. package/package.json +117 -117
  98. package/src/i18n/catalogs/ar.json +1 -0
  99. package/src/i18n/catalogs/de.json +1 -0
  100. package/src/i18n/catalogs/en.json +1 -0
  101. package/src/i18n/catalogs/es.json +1 -0
  102. package/src/i18n/catalogs/fr.json +1 -0
  103. package/src/i18n/catalogs/hi.json +1 -0
  104. package/src/i18n/catalogs/it.json +1 -0
  105. package/src/i18n/catalogs/ja.json +1 -0
  106. package/src/i18n/catalogs/pt.json +1 -0
  107. package/src/i18n/catalogs/zh.json +1 -0
@@ -1,21 +1,33 @@
1
- # Unbreakable workflow gates
2
-
3
- Hard gates: you REFUSE to advance until the condition is met.
4
-
5
- G1: Phase I done without complexity tier decided
6
- G2: No minimum brain (LLM) key in vault
7
- G3: Phase III started without intent recorded
8
- G4: Phase IV approached without block-plan OK
9
- G5: Phase V started without explicit OK on the 3 spec docs
10
- G6: Phase V block declared complete with red tests
11
- G7: Phase VI deploy attempted without all required creds
12
- G8: Launch announced without green smoke check post-deploy
13
-
14
- Soft gates: alert the user, propose alternative, do NOT block:
15
-
16
- GS1: Simple tier asking for full RFP -> do it but flag overkill
17
- GS2: Full tier asking to skip arch -> refuse with justification
18
- GS3: No compliance picked but "produccion B2B" -> propose
19
- defaults
20
- GS4: Low cost budget but high volumetry -> propose
21
- optimisations
1
+ # Unbreakable workflow gates
2
+
3
+ Hard gates: you REFUSE to advance until the condition is met.
4
+
5
+ G1: Phase I done without complexity tier decided
6
+ G2: No minimum brain (LLM) key in vault
7
+ G3: Phase III started without intent recorded
8
+ G4: Phase IV approached without block-plan OK
9
+ G5: Phase V started without explicit OK on the 3 spec docs
10
+ G6: Phase V block declared complete with red tests
11
+ G7: Phase VI deploy attempted without all required creds
12
+ G8: Launch announced without green smoke check post-deploy
13
+ G9: Phase V (construction) started without an ADMISSIBLE sizing
14
+ record -- see docs/doctrine/sizing.md. The record is not a
15
+ formality: the chosen option per axis is re-validated against
16
+ its envelope on every read, so it stops passing when the
17
+ declared volumetry outgrows it. Enforced in code by
18
+ sizingGate() in src/sizing/store.ts, not by this list.
19
+ Also applies OUTSIDE a workflow once load_bearing_since is
20
+ set -- the ADIP-KIKAN case, where the persistence decision was
21
+ never taken in a design phase at all: a prototype in-memory
22
+ store became the production store by omission.
23
+
24
+ Soft gates: alert the user, propose alternative, do NOT block:
25
+
26
+ GS1: Simple tier asking for full RFP -> do it but flag overkill
27
+ GS2: Full tier asking to skip arch -> refuse with justification
28
+ GS3: No compliance picked but "produccion B2B" -> propose
29
+ defaults
30
+ GS4: Low cost budget but high volumetry -> propose
31
+ optimisations (the HARD half of this is G9: the sizing
32
+ record. GS4 is only about cost, never about whether the
33
+ architecture is admissible)
@@ -0,0 +1,182 @@
1
+ # Sizing doctrine -- fixed options, measured envelopes
2
+
3
+ This doctrine exists because the previous one was not enough.
4
+
5
+ `concurrency-scale.md` opens with *"Every application Forge designs MUST
6
+ be sized to its expected concurrency from day one. Scale is a
7
+ RELEVAMIENTO input, not an afterthought bolted on when the app falls
8
+ over."* That was already written when ADIP-KIKAN was built with its
9
+ entire working set resident in the Node heap, at a volumetry
10
+ (5.000 affiliates x 40 campaigns/year -> ~3,4M rows/year -> ~8 GB of
11
+ live heap per year against a 2-4 GB V8 ceiling) that hits a wall in
12
+ months.
13
+
14
+ So the lesson is not "write more doctrine". The lesson is that **prose is
15
+ advisory**. This doctrine describes a mechanism; the mechanism is the
16
+ code in `src/sizing/`.
17
+
18
+ ## The four holes the Kikan post mortem found
19
+
20
+ 1. **The wrong axis.** The only volumetry Forge asked for was PEAK
21
+ CONCURRENCY (`src/commands/triage.ts`), and only to pick a complexity
22
+ tier. Kikan has 100 concurrent users -- a low number -- and died of
23
+ ROW COUNT. Data volume x retention was never a question.
24
+ 2. **No hardware envelope.** None. No RAM, no runtime heap ceiling, no
25
+ disk. The architecture was chosen without knowing the machine -- and
26
+ the ceiling that actually kills a Node process is V8's
27
+ `heap_size_limit`, a property of the machine and runtime, not of the
28
+ business.
29
+ 3. **A free-form choice.** Forge invented an approach and wrote a
30
+ rationale. With no fixed option set carrying validity ranges, there
31
+ was nothing to violate.
32
+ 4. **A soft gate.** The only gate touching volumetry was `GS4`, and soft
33
+ gates do not block.
34
+
35
+ And the deepest one, which is really a fifth: **in Kikan the decision was
36
+ never taken.** There was no moment called "choose the persistence
37
+ architecture". The engine was written against a synchronous in-memory
38
+ store as a prototype, durability was bolted on later, and the choice was
39
+ made by omission in the commit that decided not to rewrite the engine. A
40
+ gate that only fires in the design phase would have missed it.
41
+
42
+ ## What you must do
43
+
44
+ ### 1. Ask for five things, never four
45
+
46
+ During relevamiento -- and before any change that makes a load-bearing
47
+ decision about state:
48
+
49
+ - **Entities and their cardinality.** "5.000 affiliates", "20.000
50
+ customers".
51
+ - **Event rate per entity per year.** "40 campaigns per affiliate per
52
+ year".
53
+ - **Rows per event, across EVERY table the event writes.** This is the
54
+ number people get wrong. In Kikan one campaign-affiliate event leaves
55
+ about 17 rows: a pending, three or four dispatch items, five messages,
56
+ as many traces, plus run events and a conversation. Not one row.
57
+ - **Retention per data CLASS.** Business data and trace data have
58
+ different retention rights, and this is the distinction Kikan never
59
+ made. `0 days` means forever, and forever means unbounded.
60
+ - **The hardware envelope**: `ram_mb`, `heap_cap_mb`, `disk_gb`,
61
+ `vcpus`. `heap_cap_mb` is the RUNTIME heap ceiling
62
+ (`node -e "console.log(require('v8').getHeapStatistics().heap_size_limit)"`),
63
+ **not** the RAM of the machine. Using RAM here is exactly what makes an
64
+ in-memory design look survivable.
65
+
66
+ `yf triage` asks the first three (and uses the row rate to pick the tier);
67
+ `yf clarify quantitative` asks the rest, derives, and records. In a chat
68
+ session, ask them yourself and call `yujin.sizing.record`.
69
+
70
+ Ask the owner. Do not invent the numbers. If the owner does not know,
71
+ propose a default, say out loud that it is a default, and record it --
72
+ the record keeps every revision, so a wrong assumption is findable
73
+ later instead of invisible.
74
+
75
+ ### 2. Let the numbers be derived, not argued
76
+
77
+ `yujin.sizing.show` derives, from those inputs: rows/year, rows at the
78
+ horizon, live rows after retention, the heap a resident set would take
79
+ and what share of the ceiling that is, and disk at the horizon. You do
80
+ not estimate these and you do not debate them.
81
+
82
+ ### 3. Pick one option per axis, from the fixed catalogue
83
+
84
+ Four axes. The option ids and their envelopes live in
85
+ `src/sizing/model.ts`; `yujin.sizing.show` prints the catalogue and
86
+ which options the current volumetry admits.
87
+
88
+ **`state_residency` -- where the working set lives**
89
+
90
+ | Option | Admissible when |
91
+ |---|---|
92
+ | `memory-only` | Zero users. A prototype nobody depends on |
93
+ | `memory-write-through` | Every data class bounded by retention AND the live set under 25% of the heap ceiling |
94
+ | `sql-async` | Always. The default |
95
+ | `sql-plus-narrow-cache` | Only with a `measured_hotspot` naming the measurement that justifies it |
96
+
97
+ 25% and not 80%: the heap also holds every request in flight, the
98
+ declarative catalog and V8's own slack, and mark-compact pauses grow with
99
+ the live set long before the ceiling is reached. The system becomes
100
+ unusable before it crashes.
101
+
102
+ **`pagination` -- how a page is produced**
103
+
104
+ | Option | Admissible when |
105
+ |---|---|
106
+ | `in-memory-slice` | Nothing unbounded AND under 100.000 rows at the horizon |
107
+ | `sql-limit-offset` | Always |
108
+ | `sql-keyset` | Always; the right default past a few hundred thousand rows |
109
+
110
+ A slice taken after materialising the collection protects the wire, not
111
+ the server. Kikan's own `paginacion.js` says so in a comment and does it
112
+ anyway.
113
+
114
+ **`retention` -- what bounds each class**
115
+
116
+ | Option | Admissible when |
117
+ |---|---|
118
+ | `retention-none` | Not with a resident working set, and only while projected disk stays under 25% |
119
+ | `retention-by-age` | At least one class declares a window |
120
+ | `retention-by-age-and-count` | Same as above (it is a superset); the row cap is what survives a spike |
121
+
122
+ A retention mechanism that ships inert (`max_days: 0`) is not retention.
123
+ Kikan shipped one and it deleted nothing for a year.
124
+
125
+ Consequence, and it is deliberate: with retention `0/0` the retention axis
126
+ has **no admissible option at all**, so a project cannot be sized until it
127
+ declares what bounds each data class. That is the Kikan lesson in one line.
128
+
129
+ **`write_concurrency` -- what makes a multi-step mutation atomic**
130
+
131
+ | Option | Admissible when |
132
+ |---|---|
133
+ | `implicit-single-thread` | Only with a synchronous resident store AND at most one concurrent user |
134
+ | `explicit-transactions` | Always |
135
+ | `unique-keys-and-upsert` | Always; the only correct fix for a check-then-act race |
136
+
137
+ The moment reads become asynchronous, every `findOne`-then-`insert`
138
+ becomes a race, and the guarantee that used to be free disappears
139
+ without anything in the code changing shape. Kikan has 27 of those
140
+ patterns and zero transactions.
141
+
142
+ ### 4. Record it, and accept the refusal
143
+
144
+ `yujin.sizing.record` persists the sizing **only if every choice is
145
+ inside its envelope**. A choice outside is refused and nothing is
146
+ written. The refusal carries the derived numbers, which axes failed, and
147
+ what would be admissible -- so fixing it is one more call, not a
148
+ negotiation.
149
+
150
+ The record is not a permit. `sizingGate()` re-validates it on every read,
151
+ so a sizing that was fine at 500 affiliates stops passing when the
152
+ declared number becomes 50.000.
153
+
154
+ ### 5. Re-check against reality
155
+
156
+ `yujin.sizing.check` takes real counts (a `COUNT(*)` per table, an infra
157
+ report) and re-runs the envelopes with the observed rate substituted in.
158
+ The answer is not "the estimate was 3x off"; it is "at the rate you
159
+ actually have, the architecture you chose is no longer admissible". Run
160
+ it whenever real numbers exist. This is what catches a bad sizing in
161
+ month 2 instead of month 12.
162
+
163
+ ### 6. The prototype trigger
164
+
165
+ When a surface stops being a prototype -- a test store becomes the
166
+ production store, an in-memory thing gets durability bolted on, a demo
167
+ starts holding real data -- set `load_bearing_since`. From then on the
168
+ gate applies outside any workflow.
169
+
170
+ This is the Kikan case, and it is the one a design-phase gate alone
171
+ cannot catch.
172
+
173
+ ## Proportionality
174
+
175
+ None of this is a licence to gold-plate. A twenty-user internal tool with
176
+ two tables sizes in one call and picks `sql-async` +
177
+ `sql-limit-offset` + `retention-by-age` + `explicit-transactions`, which
178
+ is the recommendation anyway. The cost of the gate for a small system is
179
+ one verb call; the cost of not having it was ADIP-KIKAN.
180
+
181
+ What the gate forbids is not ambition. It is choosing an architecture
182
+ without knowing the numbers, and then discovering them in production.
@@ -47,6 +47,16 @@ export interface BackendTool {
47
47
  /** Tool id (kebab-case or snake_case). Becomes `app.<id>` in the
48
48
  * synthetic NAC-3 verb namespace. */
49
49
  id: string;
50
+ /** PERFILES DE FRONTEND autorizados a invocarla (Pablo 2026-10-11).
51
+ *
52
+ * Es la misma autorizacion que el producto exige en su UI: si el ABM de
53
+ * plantillas solo lo abre un Administrador, la tool declara
54
+ * ["administrador"]. El asistente embebido NO puede operar algo que el
55
+ * humano que esta del otro lado no podria operar a mano, y eso se decide
56
+ * aca -- no en el prompt. Cuando el despliegue declara su
57
+ * `frontend_profile`, una tool sin `profiles` queda FUERA: el control es
58
+ * estricto, no permisivo por omision. */
59
+ profiles?: string[];
50
60
  /** Short user-facing label for stub + audit log. */
51
61
  label: string;
52
62
  /** Free-text description. */
@@ -85,5 +95,9 @@ export declare function parseBackendCatalogue(manifest: unknown): ParseResult;
85
95
  * missing OR no nac3_backend declared OR malformed. */
86
96
  export declare function loadBackendCatalogue(projectRoot: string): Promise<ParseResult>;
87
97
  export declare function buildBackendToolStub(tool: BackendTool): string;
98
+ /** Las tools que un despliegue con ESTE perfil de frontend puede invocar.
99
+ * Sin perfil declarado en el despliegue (maquina de desarrollo, sin puerta)
100
+ * se ven todas; con perfil declarado, solo las que lo nombran. */
101
+ export declare function toolsForFrontendProfile(tools: BackendTool[], frontendProfile: string | null | undefined): BackendTool[];
88
102
  export declare function buildBackendToolsSection(catalogue: BackendCatalogue): string;
89
103
  //# sourceMappingURL=backend_tools.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"backend_tools.d.ts","sourceRoot":"","sources":["../../src/nac3/backend_tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,YAAY,GAAG,OAAO,GAAG,cAAc,CAAC;AAE1F,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,eAAe,CAAC;IACtB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yDAAyD;IACzD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,aAAa,GACrB,cAAc,GACd,SAAS,GACT,mBAAmB,GACnB,aAAa,CAAC;AAElB,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN,cAAc,GACd,YAAY,GACZ,SAAS,CAAC;AAEd,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;QACzB,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;QA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IAAI,GAAG,SAAS,GACzC,WAAW,EAAE,CAIf;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,gBAAgB,GAAG,MAAM,CAU5E"}
@@ -117,8 +117,24 @@ function parseTool(raw, idx, errors) {
117
117
  }
118
118
  if (sideEffects.length === 0)
119
119
  sideEffects.push('external-api');
120
+ /* Perfiles de frontend: slugs simples, en minuscula. Una lista vacia se
121
+ * trata como ausente (nadie la declaro) y no como "todos". */
122
+ const profRaw = Array.isArray(r.profiles) ? r.profiles : [];
123
+ const profiles = [];
124
+ for (const x of profRaw) {
125
+ const v = typeof x === 'string' ? x.trim().toLowerCase() : '';
126
+ if (!v)
127
+ continue;
128
+ if (!/^[a-z][a-z0-9_.-]{0,39}$/.test(v)) {
129
+ errors.push(ctx + '.profiles: perfil invalido "' + String(x) + '" (slug a-z0-9_.-)');
130
+ continue;
131
+ }
132
+ if (profiles.indexOf(v) < 0)
133
+ profiles.push(v);
134
+ }
120
135
  return {
121
136
  id,
137
+ ...(profiles.length ? { profiles } : {}),
122
138
  label,
123
139
  description,
124
140
  endpoint,
@@ -253,7 +269,21 @@ export function buildBackendToolStub(tool) {
253
269
  const se = tool.side_effects.map(shortSideEffectTag).filter((s) => s !== '').join('');
254
270
  const tags = '[' + pol + (se ? se : '') + ']';
255
271
  const hint = buildArgsHint(tool.params_schema);
256
- return 'app.' + tool.id + ' ' + tags + ' ' + tool.label + ' args:' + hint;
272
+ /* El perfil exigido va en el stub: el cerebro tiene que saber de quien es
273
+ * la accion, no solo que existe. */
274
+ const prof = Array.isArray(tool.profiles) && tool.profiles.length
275
+ ? ' perfil:' + tool.profiles.join('|')
276
+ : '';
277
+ return 'app.' + tool.id + ' ' + tags + ' ' + tool.label + ' args:' + hint + prof;
278
+ }
279
+ /** Las tools que un despliegue con ESTE perfil de frontend puede invocar.
280
+ * Sin perfil declarado en el despliegue (maquina de desarrollo, sin puerta)
281
+ * se ven todas; con perfil declarado, solo las que lo nombran. */
282
+ export function toolsForFrontendProfile(tools, frontendProfile) {
283
+ const fp = String(frontendProfile || '').trim().toLowerCase();
284
+ if (!fp)
285
+ return tools.slice();
286
+ return tools.filter((t) => Array.isArray(t.profiles) && t.profiles.indexOf(fp) >= 0);
257
287
  }
258
288
  export function buildBackendToolsSection(catalogue) {
259
289
  if (catalogue.tools.length === 0)
@@ -1 +1 @@
1
- {"version":3,"file":"backend_tools.js","sourceRoot":"","sources":["../../src/nac3/backend_tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAqF7B,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;AACzE,MAAM,cAAc,GAAoB,CAAC,cAAc,EAAE,SAAS,EAAE,mBAAmB,EAAE,aAAa,CAAC,CAAC;AACxG,MAAM,kBAAkB,GAAwB,CAAC,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;AAClG,MAAM,gBAAgB,GAAsB,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;AAEtG,SAAS,QAAQ,CAAC,CAAU;IAC1B,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1D,CAAC;AAED,SAAS,aAAa,CAAC,GAAY,EAAE,GAAW,EAAE,MAAgB;IAChE,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QACpC,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,qCAAqC,CAAC,CAAC;QACzD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,CAAC,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ACrB,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,UAAU,CAAC;IACnB,YAAY,EAAE,cAAc,EAAE,CAAC;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB;;;4BAGwB;IACxB,YAAY,EAAE,OAAO,GAAG,QAAQ,CAAC;IACjC;;;;;;qCAMiC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB;AA2vGD,wBAAgB,QAAQ,IAAI,YAAY,CAOvC;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAGzD;AAED;gEACgE;AAChE,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAO9D;AAED;;;uDAGuD;AACvD,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI,CAgCzF;AAED;;sEAEsE;AACtE,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,SAAI,GAAG,MAAM,EAAE,CAO/D"}
@@ -1248,7 +1248,11 @@ const VERBS = [
1248
1248
  + 'tail -f, tunnel (npm/pnpm run dev|start|serve|watch, expo start, '
1249
1249
  + 'vite, next dev, nodemon, wrangler dev, docker compose up, ...) -- '
1250
1250
  + 'is REFUSED here; launch it with yujin.task.run so it survives the '
1251
- + 'turn. The server classifies risk (destructive/elevation/network/'
1251
+ + 'turn. REFUSED TOO: work that terminates but TAKES LONG (test suites, '
1252
+ + 'builds, installs, sleeps) -- inline it blocks the whole turn, so it '
1253
+ + 'goes through yujin.task.run and you read the result filtered with '
1254
+ + 'yujin.task.log({id, grep:[...]}) instead of a shell pipeline. '
1255
+ + 'The server classifies risk (destructive/elevation/network/'
1252
1256
  + 'safe); destructive/elevation/network always require approval. '
1253
1257
  + 'Output + timeout bounded by limits.shell.*. Audit-logged.',
1254
1258
  schema: {
@@ -1259,6 +1263,7 @@ const VERBS = [
1259
1263
  timeout_ms: { type: 'number', description: 'Override timeout. Capped by limits.shell.timeout_ms_max.' },
1260
1264
  env: { type: 'object', description: 'Extra env vars to inject on top of the whitelist.' },
1261
1265
  allow_long_running: { type: 'boolean', description: 'Escape hatch: run a non-terminating command in-turn anyway (rare). Default false -> use yujin.task.run instead.' },
1266
+ allow_heavy: { type: 'boolean', description: 'Escape hatch for the HEAVY guard (test suites, builds, installs, sleeps): run it in-turn anyway. Default false -> yujin.task.run + yujin.task.log({grep}) instead, which does not block the turn.' },
1262
1267
  },
1263
1268
  required: ['command'],
1264
1269
  },
@@ -2191,7 +2196,12 @@ const VERBS = [
2191
2196
  + 'chat server owns it, so it outlives the per-turn brain. Use this '
2192
2197
  + 'instead of running a long command inline when the work should '
2193
2198
  + 'keep going after you reply -- you (or the user) check on it later '
2194
- + 'with yujin.task.status / yujin.task.list. Returns a task id.',
2199
+ + 'with yujin.task.status / yujin.task.list. Returns a task id. '
2200
+ + 'ALSO use it for work that terminates but takes LONG (test suites, '
2201
+ + 'builds, installs): inline it blocks the whole turn. You do NOT need '
2202
+ + 'a shell pipeline to read the result -- yujin.task.log takes `grep`, '
2203
+ + 'so "run the suite and show me the failures" is task.run + '
2204
+ + 'task.log({id, grep:["not ok","FAIL"]}).',
2195
2205
  schema: {
2196
2206
  type: 'object',
2197
2207
  properties: {
@@ -2245,6 +2255,7 @@ const VERBS = [
2245
2255
  type: 'object',
2246
2256
  properties: {
2247
2257
  id: { type: 'string', description: 'Task id.', minLength: 1, maxLength: 80 },
2258
+ grep: { type: 'array', description: 'Literal substrings (OR, case-insensitive) to keep. The filtered tail replaces a shell pipeline: no need for | findstr. Pass ["not ok","FAIL","Error"] to see only the failures of a suite.' },
2248
2259
  lines: { type: 'number', description: 'How many trailing lines (default 40).' },
2249
2260
  },
2250
2261
  required: ['id'],
@@ -2622,6 +2633,144 @@ const VERBS = [
2622
2633
  visible: false,
2623
2634
  handler_side: 'server',
2624
2635
  },
2636
+ /* ---------------- yujin.sizing.* (G9: the design-phase sizing gate) ----------------
2637
+ *
2638
+ * Pablo, 2026-10-11, after the ADIP-KIKAN post mortem: the doctrine
2639
+ * (docs/doctrine/concurrency-scale.md) already demanded that every app be
2640
+ * sized, and Kikan was still built with its whole working set in the Node
2641
+ * heap. The volumetry Forge used to ask for was PEAK CONCURRENCY only, there
2642
+ * was no hardware envelope at all, the architecture choice was free-form, and
2643
+ * the only gate touching volumetry was SOFT. These verbs are the enforcement:
2644
+ * the numbers are derived, each option declares the envelope in which it is
2645
+ * admissible, and an option outside its envelope is REFUSED. See
2646
+ * docs/doctrine/sizing.md and src/sizing/model.ts. */
2647
+ {
2648
+ id: 'yujin.sizing.record',
2649
+ role: 'action',
2650
+ action: 'sizing_record',
2651
+ label: 'Registrar el dimensionamiento del sistema (G9)',
2652
+ description: 'Record the sizing of the system being built and pick ONE option per '
2653
+ + 'architecture axis. MANDATORY before construction starts (gate G9): '
2654
+ + 'without an admissible record the construction stage refuses to begin. '
2655
+ + 'Ask the owner for the numbers -- do NOT invent them -- and count '
2656
+ + 'rows_per_event over EVERY table an event writes, not just the main one '
2657
+ + '(in ADIP-KIKAN one campaign-affiliate event leaves ~17 rows). '
2658
+ + 'hardware.heap_cap_mb is the RUNTIME heap ceiling (Node: '
2659
+ + 'v8.getHeapStatistics().heap_size_limit), NOT the RAM of the machine: '
2660
+ + 'confusing the two is what makes an in-memory design look survivable. '
2661
+ + 'The four axes are state_residency, pagination, retention and '
2662
+ + 'write_concurrency; call yujin.sizing.show first to get the option '
2663
+ + 'catalogue and which ones this volumetry admits. A choice outside its '
2664
+ + 'envelope is REFUSED and nothing is written -- the result then carries '
2665
+ + 'the derived numbers, the failing axes and the admissible set, so the '
2666
+ + 'fix takes one more call. Re-record whenever the volumetry changes: the '
2667
+ + 'previous sizing is kept in revisions[].',
2668
+ schema: {
2669
+ type: 'object',
2670
+ properties: {
2671
+ entities: {
2672
+ type: 'array',
2673
+ description: 'Business entities and the event traffic they generate. Each item: '
2674
+ + '{ name: string, count: number (how many exist at the horizon), '
2675
+ + 'events_per_year: number, rows_per_event: number (rows the event '
2676
+ + 'leaves across ALL tables, not just the main one) }. Example for '
2677
+ + 'ADIP-KIKAN: [{"name":"afiliados","count":5000,'
2678
+ + '"events_per_year":40,"rows_per_event":17}].',
2679
+ },
2680
+ bytes_per_row: { type: 'number', description: 'Average retained bytes per row in the RUNTIME.' },
2681
+ trace_share: { type: 'number', description: 'Fraction of rows that are trace/log, 0..1. Default 0.5.' },
2682
+ retention: {
2683
+ type: 'object',
2684
+ description: '{ business_days: number, trace_days: number } -- days each data '
2685
+ + 'class is kept. 0 means FOREVER, which is exactly what makes a '
2686
+ + 'system unbounded. Business data (the conversation with the '
2687
+ + 'customer) and trace data (how the pipeline processed it) have '
2688
+ + 'different retention rights: that is the distinction ADIP-KIKAN '
2689
+ + 'never made.',
2690
+ },
2691
+ peak_concurrency: { type: 'number', description: 'Peak simultaneous users / requests.' },
2692
+ hardware: {
2693
+ type: 'object',
2694
+ description: '{ ram_mb: number, heap_cap_mb: number, disk_gb: number, vcpus: '
2695
+ + 'number }. heap_cap_mb is the RUNTIME heap ceiling (Node: '
2696
+ + 'require("v8").getHeapStatistics().heap_size_limit / 1048576), NOT '
2697
+ + 'the RAM of the machine -- confusing the two is what makes an '
2698
+ + 'in-memory design look survivable.',
2699
+ },
2700
+ horizon_years: { type: 'number', description: 'Years the sizing covers. 3 is a sane default.' },
2701
+ choices: {
2702
+ type: 'object',
2703
+ description: 'One option id per axis: { state_residency, pagination, retention, '
2704
+ + 'write_concurrency }. Get the valid ids from yujin.sizing.show. '
2705
+ + 'state_residency: memory-only | memory-write-through | sql-async | '
2706
+ + 'sql-plus-narrow-cache. pagination: in-memory-slice | '
2707
+ + 'sql-limit-offset | sql-keyset. retention: retention-none | '
2708
+ + 'retention-by-age | retention-by-age-and-count. write_concurrency: '
2709
+ + 'implicit-single-thread | explicit-transactions | '
2710
+ + 'unique-keys-and-upsert.',
2711
+ },
2712
+ note: { type: 'string', minLength: 1, maxLength: 500, description: 'What this sizing decides and why. Required.' },
2713
+ rationale: { type: 'string', maxLength: 4000 },
2714
+ measured_hotspot: { type: 'string', maxLength: 500, description: 'Required to choose a cache: name the MEASUREMENT that justifies it.' },
2715
+ load_bearing_since: { type: 'string', maxLength: 32, description: 'ISO date on which this stopped being a prototype. Once set, the gate applies outside any workflow.' },
2716
+ },
2717
+ required: ['entities', 'bytes_per_row', 'retention', 'peak_concurrency', 'hardware', 'horizon_years', 'choices', 'note'],
2718
+ },
2719
+ policy: 'approval-required',
2720
+ side_effects: ['filesystem'],
2721
+ visible: false,
2722
+ handler_side: 'server',
2723
+ },
2724
+ {
2725
+ id: 'yujin.sizing.show',
2726
+ role: 'query',
2727
+ action: 'sizing_show',
2728
+ label: 'Ver el dimensionamiento, los numeros derivados y el catalogo de opciones',
2729
+ description: 'Read the project sizing record: the declared inputs, the DERIVED numbers '
2730
+ + '(rows/year, live rows after retention, heap the resident set would take '
2731
+ + 'and what share of the ceiling that is, disk at the horizon), the gate '
2732
+ + 'state, and the full option catalogue per axis with which options this '
2733
+ + 'volumetry admits. Call this BEFORE yujin.sizing.record to see the valid '
2734
+ + 'option ids, and whenever you need to know why construction is blocked.',
2735
+ schema: {
2736
+ type: 'object',
2737
+ properties: {
2738
+ construction: { type: 'boolean', description: 'Evaluate the gate as if construction were starting. Default true.' },
2739
+ },
2740
+ required: [],
2741
+ },
2742
+ policy: 'unrestricted',
2743
+ side_effects: ['none'],
2744
+ visible: false,
2745
+ handler_side: 'server',
2746
+ },
2747
+ {
2748
+ id: 'yujin.sizing.check',
2749
+ role: 'action',
2750
+ action: 'sizing_check',
2751
+ label: 'Contrastar el dimensionamiento declarado contra lo medido',
2752
+ description: 'Compare a REAL measurement against the declared sizing and re-run the '
2753
+ + 'envelopes with the observed rate substituted in. The useful answer is '
2754
+ + 'not "the estimate was 3x off", it is "at the rate you actually have, '
2755
+ + 'the architecture you chose is no longer admissible". Run it whenever you '
2756
+ + 'have real counts (a COUNT(*) per table, an infra report): this is what '
2757
+ + 'catches a bad sizing in month 2 instead of month 12. `source` is '
2758
+ + 'required -- an unsourced number is a guess.',
2759
+ schema: {
2760
+ type: 'object',
2761
+ properties: {
2762
+ rows_total: { type: 'number', description: 'Rows actually counted.' },
2763
+ over_days: { type: 'number', description: 'Over how many days they accumulated.' },
2764
+ source: { type: 'string', minLength: 1, maxLength: 300, description: 'Where the numbers came from.' },
2765
+ bytes_per_row: { type: 'number', description: 'Measured retained bytes per row, when known.' },
2766
+ },
2767
+ required: ['rows_total', 'over_days', 'source'],
2768
+ },
2769
+ policy: 'unrestricted',
2770
+ side_effects: ['none'],
2771
+ visible: false,
2772
+ handler_side: 'server',
2773
+ },
2625
2774
  {
2626
2775
  id: 'yujin.pending.add',
2627
2776
  role: 'action',
@@ -2655,14 +2804,32 @@ const VERBS = [
2655
2804
  label: 'Cerrar item del pending registry (R8 modal)',
2656
2805
  description: 'Close an open pending item with a reason. Carries the '
2657
2806
  + 'closing commit SHA when present (post-commit hook is '
2658
- + 'the typical caller, but the chat can call too).',
2807
+ + 'the typical caller, but the chat can call too). '
2808
+ + 'With reason=shipped you MUST also leave the IMPLEMENTATION '
2809
+ + 'RECORD: `functional` (what the user can do now that they could '
2810
+ + 'not before, and how it behaves) and `use_cases` (the concrete '
2811
+ + 'cases now covered). That is what the Done tab shows next to the '
2812
+ + 'original request, and what lets another session -- or another '
2813
+ + 'agent -- understand what was delivered without reading the diff. '
2814
+ + 'Do NOT list the affected sources: when you pass `commit`, they '
2815
+ + 'are derived from the SHA (the repo knows them for certain). Use '
2816
+ + '`files` only for sources a later commit does not reflect. Same for '
2817
+ + 'the VERIFICATION: pass `tests_status` + `tests_summary` with how the '
2818
+ + 'suite went -- you just ran it and the repo does not record it -- and '
2819
+ + 'the test pieces inside the commit are recognised on their own.',
2659
2820
  schema: {
2660
2821
  type: 'object',
2661
2822
  properties: {
2662
2823
  id: { type: 'string', pattern: '^PND-\\d+$' },
2663
2824
  reason: { type: 'string', enum: ['shipped', 'obsoleted', 'duplicate', 'rejected'] },
2664
- commit: { type: 'string', description: 'Git SHA that delivered the close.', maxLength: 80 },
2665
- resolution: { type: 'string', description: 'How it was resolved -- the closing history summary (what was done across the evolutive/corrective cycle). Saved as a history entry.', maxLength: 4000 },
2825
+ commit: { type: 'string', description: 'Git SHA that delivered the close. The affected sources are derived from it.', maxLength: 80 },
2826
+ resolution: { type: 'string', description: 'How it was resolved -- the closing history summary (what was done across the evolutive/corrective cycle). Saved as a history entry AND as the technical summary of the implementation record.', maxLength: 4000 },
2827
+ functional: { type: 'string', description: 'FUNCTIONAL description of what was delivered: what the user can do now and how it behaves. Mandatory with reason=shipped -- it is not in the diff.', maxLength: 8000 },
2828
+ use_cases: { type: 'array', description: 'Concrete use cases now covered, one per entry.' },
2829
+ files: { type: 'array', description: 'Extra affected sources. Normally empty: with `commit` they come from the SHA.' },
2830
+ tests_status: { type: 'string', description: 'How the verification went: green (all passing) | red (something still failing) | partial (covered in part) | none (closed without tests -- valid, but say it).', enum: ['green', 'red', 'partial', 'none'] },
2831
+ tests_summary: { type: 'string', description: 'One line of detail: "forge-operate 49 passed", "4 suites, 1 skip". You just ran it; the repo does not store this.', maxLength: 2000 },
2832
+ tests_files: { type: 'array', description: 'Extra test pieces. Normally empty: the ones inside the commit are recognised automatically.' },
2666
2833
  },
2667
2834
  required: ['id', 'reason'],
2668
2835
  },