@zelari/core 0.7.12 → 0.7.14

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 (138) hide show
  1. package/dist/agents/councilApi.d.ts +135 -0
  2. package/dist/agents/councilApi.d.ts.map +1 -1
  3. package/dist/agents/councilApi.js +520 -7
  4. package/dist/agents/councilApi.js.map +1 -1
  5. package/dist/agents/roles.d.ts.map +1 -1
  6. package/dist/agents/roles.js +11 -3
  7. package/dist/agents/roles.js.map +1 -1
  8. package/dist/agents/toolSchemas.d.ts.map +1 -1
  9. package/dist/agents/toolSchemas.js +32 -3
  10. package/dist/agents/toolSchemas.js.map +1 -1
  11. package/dist/core/AgentHarness.d.ts +21 -0
  12. package/dist/core/AgentHarness.d.ts.map +1 -1
  13. package/dist/core/AgentHarness.js +153 -0
  14. package/dist/core/AgentHarness.js.map +1 -1
  15. package/dist/core/tools/builtin/filesystem.d.ts.map +1 -1
  16. package/dist/core/tools/builtin/filesystem.js +4 -2
  17. package/dist/core/tools/builtin/filesystem.js.map +1 -1
  18. package/dist/council/completion/buildCompletion.d.ts +23 -0
  19. package/dist/council/completion/buildCompletion.d.ts.map +1 -0
  20. package/dist/council/completion/buildCompletion.js +75 -0
  21. package/dist/council/completion/buildCompletion.js.map +1 -0
  22. package/dist/council/completion/index.d.ts +3 -0
  23. package/dist/council/completion/index.d.ts.map +1 -0
  24. package/dist/council/completion/index.js +3 -0
  25. package/dist/council/completion/index.js.map +1 -0
  26. package/dist/council/completion/types.d.ts +38 -0
  27. package/dist/council/completion/types.d.ts.map +1 -0
  28. package/dist/council/completion/types.js +2 -0
  29. package/dist/council/completion/types.js.map +1 -0
  30. package/dist/council/index.d.ts +4 -0
  31. package/dist/council/index.d.ts.map +1 -1
  32. package/dist/council/index.js +4 -0
  33. package/dist/council/index.js.map +1 -1
  34. package/dist/council/lessons/index.d.ts +7 -0
  35. package/dist/council/lessons/index.d.ts.map +1 -0
  36. package/dist/council/lessons/index.js +7 -0
  37. package/dist/council/lessons/index.js.map +1 -0
  38. package/dist/council/lessons/io.d.ts +5 -0
  39. package/dist/council/lessons/io.d.ts.map +1 -0
  40. package/dist/council/lessons/io.js +30 -0
  41. package/dist/council/lessons/io.js.map +1 -0
  42. package/dist/council/lessons/isAnswerLeak.d.ts +7 -0
  43. package/dist/council/lessons/isAnswerLeak.d.ts.map +1 -0
  44. package/dist/council/lessons/isAnswerLeak.js +26 -0
  45. package/dist/council/lessons/isAnswerLeak.js.map +1 -0
  46. package/dist/council/lessons/recallLessons.d.ts +8 -0
  47. package/dist/council/lessons/recallLessons.d.ts.map +1 -0
  48. package/dist/council/lessons/recallLessons.js +56 -0
  49. package/dist/council/lessons/recallLessons.js.map +1 -0
  50. package/dist/council/lessons/recordFailure.d.ts +7 -0
  51. package/dist/council/lessons/recordFailure.d.ts.map +1 -0
  52. package/dist/council/lessons/recordFailure.js +86 -0
  53. package/dist/council/lessons/recordFailure.js.map +1 -0
  54. package/dist/council/lessons/signatures.d.ts +6 -0
  55. package/dist/council/lessons/signatures.d.ts.map +1 -0
  56. package/dist/council/lessons/signatures.js +31 -0
  57. package/dist/council/lessons/signatures.js.map +1 -0
  58. package/dist/council/lessons/types.d.ts +27 -0
  59. package/dist/council/lessons/types.d.ts.map +1 -0
  60. package/dist/council/lessons/types.js +2 -0
  61. package/dist/council/lessons/types.js.map +1 -0
  62. package/dist/council/modeBanners.d.ts +24 -1
  63. package/dist/council/modeBanners.d.ts.map +1 -1
  64. package/dist/council/modeBanners.js +31 -4
  65. package/dist/council/modeBanners.js.map +1 -1
  66. package/dist/council/scope/extractTaskScope.d.ts +35 -0
  67. package/dist/council/scope/extractTaskScope.d.ts.map +1 -0
  68. package/dist/council/scope/extractTaskScope.js +174 -0
  69. package/dist/council/scope/extractTaskScope.js.map +1 -0
  70. package/dist/council/scope/index.d.ts +3 -0
  71. package/dist/council/scope/index.d.ts.map +1 -0
  72. package/dist/council/scope/index.js +3 -0
  73. package/dist/council/scope/index.js.map +1 -0
  74. package/dist/council/scope/nfrSpecWarn.d.ts +6 -0
  75. package/dist/council/scope/nfrSpecWarn.d.ts.map +1 -0
  76. package/dist/council/scope/nfrSpecWarn.js +21 -0
  77. package/dist/council/scope/nfrSpecWarn.js.map +1 -0
  78. package/dist/council/verification/autofix.d.ts +12 -0
  79. package/dist/council/verification/autofix.d.ts.map +1 -0
  80. package/dist/council/verification/autofix.js +41 -0
  81. package/dist/council/verification/autofix.js.map +1 -0
  82. package/dist/council/verification/citeVerify.d.ts +13 -0
  83. package/dist/council/verification/citeVerify.d.ts.map +1 -0
  84. package/dist/council/verification/citeVerify.js +73 -0
  85. package/dist/council/verification/citeVerify.js.map +1 -0
  86. package/dist/council/verification/completion.d.ts +19 -0
  87. package/dist/council/verification/completion.d.ts.map +1 -0
  88. package/dist/council/verification/completion.js +50 -0
  89. package/dist/council/verification/completion.js.map +1 -0
  90. package/dist/council/verification/degraded.d.ts +26 -0
  91. package/dist/council/verification/degraded.d.ts.map +1 -0
  92. package/dist/council/verification/degraded.js +35 -0
  93. package/dist/council/verification/degraded.js.map +1 -0
  94. package/dist/council/verification/honesty.d.ts +6 -0
  95. package/dist/council/verification/honesty.d.ts.map +1 -0
  96. package/dist/council/verification/honesty.js +28 -0
  97. package/dist/council/verification/honesty.js.map +1 -0
  98. package/dist/council/verification/implementationDelivery.d.ts +26 -0
  99. package/dist/council/verification/implementationDelivery.d.ts.map +1 -0
  100. package/dist/council/verification/implementationDelivery.js +70 -0
  101. package/dist/council/verification/implementationDelivery.js.map +1 -0
  102. package/dist/council/verification/index.d.ts +15 -0
  103. package/dist/council/verification/index.d.ts.map +1 -0
  104. package/dist/council/verification/index.js +15 -0
  105. package/dist/council/verification/index.js.map +1 -0
  106. package/dist/council/verification/inlineJsAutofix.d.ts +8 -0
  107. package/dist/council/verification/inlineJsAutofix.d.ts.map +1 -0
  108. package/dist/council/verification/inlineJsAutofix.js +85 -0
  109. package/dist/council/verification/inlineJsAutofix.js.map +1 -0
  110. package/dist/council/verification/microGate.d.ts +18 -0
  111. package/dist/council/verification/microGate.d.ts.map +1 -0
  112. package/dist/council/verification/microGate.js +81 -0
  113. package/dist/council/verification/microGate.js.map +1 -0
  114. package/dist/council/verification/motionAutofix.d.ts +8 -0
  115. package/dist/council/verification/motionAutofix.d.ts.map +1 -0
  116. package/dist/council/verification/motionAutofix.js +160 -0
  117. package/dist/council/verification/motionAutofix.js.map +1 -0
  118. package/dist/council/verification/parseCssMotion.d.ts +22 -0
  119. package/dist/council/verification/parseCssMotion.d.ts.map +1 -0
  120. package/dist/council/verification/parseCssMotion.js +142 -0
  121. package/dist/council/verification/parseCssMotion.js.map +1 -0
  122. package/dist/council/verification/runChecks.d.ts +10 -0
  123. package/dist/council/verification/runChecks.d.ts.map +1 -0
  124. package/dist/council/verification/runChecks.js +254 -0
  125. package/dist/council/verification/runChecks.js.map +1 -0
  126. package/dist/council/verification/synthesisAudit.d.ts +14 -0
  127. package/dist/council/verification/synthesisAudit.d.ts.map +1 -0
  128. package/dist/council/verification/synthesisAudit.js +106 -0
  129. package/dist/council/verification/synthesisAudit.js.map +1 -0
  130. package/dist/council/verification/tiers.d.ts +8 -0
  131. package/dist/council/verification/tiers.d.ts.map +1 -0
  132. package/dist/council/verification/tiers.js +46 -0
  133. package/dist/council/verification/tiers.js.map +1 -0
  134. package/dist/council/verification/types.d.ts +53 -0
  135. package/dist/council/verification/types.d.ts.map +1 -0
  136. package/dist/council/verification/types.js +5 -0
  137. package/dist/council/verification/types.js.map +1 -0
  138. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"citeVerify.d.ts","sourceRoot":"","sources":["../../../src/council/verification/citeVerify.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAK1D,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,uDAAuD;AACvD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,CAcxD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,uBAAuB,EAAE,CA+C3B"}
@@ -0,0 +1,73 @@
1
+ import { existsSync, readFileSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ const CITE_RE = /(?:^|[\s|])([A-Za-z0-9_./-]+\.(?:html|css|js|ts|tsx|jsx|md|json)):(?:L)?(\d{1,6})\b/gi;
4
+ /** Extract path:line citations from synthesis text. */
5
+ export function extractCitations(text) {
6
+ const out = [];
7
+ const seen = new Set();
8
+ let m;
9
+ CITE_RE.lastIndex = 0;
10
+ while ((m = CITE_RE.exec(text)) !== null) {
11
+ const file = (m[1] ?? '').replace(/^\.\//, '');
12
+ const line = Number.parseInt(m[2] ?? '0', 10);
13
+ const key = `${file}:${line}`;
14
+ if (!file || line < 1 || seen.has(key))
15
+ continue;
16
+ seen.add(key);
17
+ out.push({ file, line, raw: m[0].trim() });
18
+ }
19
+ return out;
20
+ }
21
+ /**
22
+ * Verify that cited path:line references exist and the line is non-empty.
23
+ */
24
+ export function verifyCitations(projectRoot, synthesisText) {
25
+ if (!synthesisText?.trim())
26
+ return [];
27
+ const results = [];
28
+ for (const cite of extractCitations(synthesisText)) {
29
+ const abs = join(projectRoot, cite.file);
30
+ if (!existsSync(abs)) {
31
+ results.push({
32
+ id: 'synthesis.cite-invalid',
33
+ severity: 'error',
34
+ ok: false,
35
+ tier: 'grep',
36
+ file: cite.file,
37
+ line: cite.line,
38
+ message: `Citation ${cite.file}:L${cite.line} — file not found`,
39
+ evidence: cite.raw,
40
+ });
41
+ continue;
42
+ }
43
+ const lines = readFileSync(abs, 'utf8').split(/\r?\n/);
44
+ if (cite.line > lines.length) {
45
+ results.push({
46
+ id: 'synthesis.cite-invalid',
47
+ severity: 'error',
48
+ ok: false,
49
+ tier: 'grep',
50
+ file: cite.file,
51
+ line: cite.line,
52
+ message: `Citation ${cite.file}:L${cite.line} — line out of range (file has ${lines.length} lines)`,
53
+ evidence: cite.raw,
54
+ });
55
+ continue;
56
+ }
57
+ const content = lines[cite.line - 1] ?? '';
58
+ if (!content.trim()) {
59
+ results.push({
60
+ id: 'synthesis.cite-invalid',
61
+ severity: 'error',
62
+ ok: false,
63
+ tier: 'grep',
64
+ file: cite.file,
65
+ line: cite.line,
66
+ message: `Citation ${cite.file}:L${cite.line} — line is empty`,
67
+ evidence: cite.raw,
68
+ });
69
+ }
70
+ }
71
+ return results;
72
+ }
73
+ //# sourceMappingURL=citeVerify.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"citeVerify.js","sourceRoot":"","sources":["../../../src/council/verification/citeVerify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,MAAM,OAAO,GACX,uFAAuF,CAAC;AAQ1F,uDAAuD;AACvD,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,GAAG,GAAc,EAAE,CAAC;IAC1B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,IAAI,CAAyB,CAAC;IAC9B,OAAO,CAAC,SAAS,GAAG,CAAC,CAAC;IACtB,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QACzC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAC/C,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,EAAE,CAAC,CAAC;QAC9C,MAAM,GAAG,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,KAAK,CAAC,MAAM,EAAE,CAAC;YAC7B,OAAO,CAAC,IAAI,CAAC;gBACX,EAAE,EAAE,wBAAwB;gBAC5B,QAAQ,EAAE,OAAO;gBACjB,EAAE,EAAE,KAAK;gBACT,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,OAAO,EAAE,YAAY,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,kCAAkC,KAAK,CAAC,MAAM,SAAS;gBACnG,QAAQ,EAAE,IAAI,CAAC,GAAG;aACnB,CAAC,CAAC;YACH,SAAS;QACX,CAAC;QACD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QAC3C,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;YACpB,OAAO,CAAC,IAAI,CAAC;gBACX,EAAE,EAAE,wBAAwB;gBAC5B,QAAQ,EAAE,OAAO;gBACjB,EAAE,EAAE,KAAK;gBACT,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,OAAO,EAAE,YAAY,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,kBAAkB;gBAC9D,QAAQ,EAAE,IAAI,CAAC,GAAG;aACnB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Implementation-mode completion gate — Lucifero must verify writes with tools.
3
+ */
4
+ export interface ImplementationCompletionCheck {
5
+ ok: boolean;
6
+ /** Tool(s) to advertise on forced retry (first executable wins). */
7
+ missing: string[];
8
+ reason?: string;
9
+ }
10
+ /** Escape hatch for dev / tests. */
11
+ export declare function isVerifyToolCheckSkipped(): boolean;
12
+ /**
13
+ * True when at least one verify tool ran after the last write/edit in the turn.
14
+ */
15
+ export declare function checkImplementationCompletion(emittedToolNames: readonly string[]): ImplementationCompletionCheck;
16
+ /** Pick the first verify tool the runtime can execute for retry. */
17
+ export declare function resolveVerifyRetryTool(executableTools: ReadonlySet<string> | null): string | null;
18
+ export declare function buildImplementationVerifyRetryPrompt(toolName: string): string;
19
+ //# sourceMappingURL=completion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"completion.d.ts","sourceRoot":"","sources":["../../../src/council/verification/completion.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,MAAM,WAAW,6BAA6B;IAC5C,EAAE,EAAE,OAAO,CAAC;IACZ,oEAAoE;IACpE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,oCAAoC;AACpC,wBAAgB,wBAAwB,IAAI,OAAO,CAElD;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAC3C,gBAAgB,EAAE,SAAS,MAAM,EAAE,GAClC,6BAA6B,CAyB/B;AAED,oEAAoE;AACpE,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,GAC1C,MAAM,GAAG,IAAI,CAKf;AAED,wBAAgB,oCAAoC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAK7E"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Implementation-mode completion gate — Lucifero must verify writes with tools.
3
+ */
4
+ const WRITE_TOOLS = new Set(['write_file', 'edit_file']);
5
+ const VERIFY_TOOLS = new Set(['grep_content', 'bash']);
6
+ /** Escape hatch for dev / tests. */
7
+ export function isVerifyToolCheckSkipped() {
8
+ return process.env.ZELARI_VERIFY_SKIP_TOOL === '1';
9
+ }
10
+ /**
11
+ * True when at least one verify tool ran after the last write/edit in the turn.
12
+ */
13
+ export function checkImplementationCompletion(emittedToolNames) {
14
+ if (isVerifyToolCheckSkipped()) {
15
+ return { ok: true, missing: [] };
16
+ }
17
+ let lastWriteIdx = -1;
18
+ for (let i = 0; i < emittedToolNames.length; i++) {
19
+ if (WRITE_TOOLS.has(emittedToolNames[i])) {
20
+ lastWriteIdx = i;
21
+ }
22
+ }
23
+ if (lastWriteIdx === -1) {
24
+ return { ok: true, missing: [] };
25
+ }
26
+ const afterWrite = emittedToolNames.slice(lastWriteIdx + 1);
27
+ if (afterWrite.some((t) => VERIFY_TOOLS.has(t))) {
28
+ return { ok: true, missing: [] };
29
+ }
30
+ return {
31
+ ok: false,
32
+ missing: ['grep_content'],
33
+ reason: 'No grep_content or bash after last write_file/edit_file',
34
+ };
35
+ }
36
+ /** Pick the first verify tool the runtime can execute for retry. */
37
+ export function resolveVerifyRetryTool(executableTools) {
38
+ if (!executableTools)
39
+ return 'grep_content';
40
+ if (executableTools.has('grep_content'))
41
+ return 'grep_content';
42
+ if (executableTools.has('bash'))
43
+ return 'bash';
44
+ return null;
45
+ }
46
+ export function buildImplementationVerifyRetryPrompt(toolName) {
47
+ return (`You wrote files but did not run ${toolName} or bash to verify them. ` +
48
+ `Call ${toolName} NOW on your changed HTML (search @keyframes, transition, classList.add). No prose.`);
49
+ }
50
+ //# sourceMappingURL=completion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"completion.js","sourceRoot":"","sources":["../../../src/council/verification/completion.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC;AACzD,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC;AASvD,oCAAoC;AACpC,MAAM,UAAU,wBAAwB;IACtC,OAAO,OAAO,CAAC,GAAG,CAAC,uBAAuB,KAAK,GAAG,CAAC;AACrD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,6BAA6B,CAC3C,gBAAmC;IAEnC,IAAI,wBAAwB,EAAE,EAAE,CAAC;QAC/B,OAAO,E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mC,QAAQ,2BAA2B;QACtE,QAAQ,QAAQ,qFAAqF,CACtG,CAAC;AACJ,CAAC"}
@@ -0,0 +1,26 @@
1
+ import type { VerificationCheckResult } from './types.js';
2
+ export declare const DEGRADED_RUN_BANNER = "DEGRADED_RUN";
3
+ export interface DegradedRunInput {
4
+ chairmanErrored?: boolean;
5
+ councilAborted?: boolean;
6
+ /**
7
+ * Total project-file writes (write_file/edit_file) this run — implementer
8
+ * agnostic. Named `lucifer*` for history; implementation runs now have a
9
+ * single implementer (specialists are read-only), so "0 writes" reliably
10
+ * means nobody implemented, not merely that the chairman didn't.
11
+ */
12
+ luciferWriteCount?: number;
13
+ synthesisText?: string;
14
+ runMode?: 'implementation' | 'design-phase';
15
+ }
16
+ export interface DegradedRunResult {
17
+ degraded: boolean;
18
+ reasons: string[];
19
+ }
20
+ /**
21
+ * Detect council runs that should not be treated as a clean hand-off.
22
+ */
23
+ export declare function detectDegradedRun(input: DegradedRunInput): DegradedRunResult;
24
+ /** Warn when a degraded run omits the mandatory banner in synthesis. */
25
+ export declare function auditDegradedBanner(synthesisText: string | undefined, degraded: boolean): VerificationCheckResult[];
26
+ //# sourceMappingURL=degraded.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"degraded.d.ts","sourceRoot":"","sources":["../../../src/council/verification/degraded.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1D,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAElD,MAAM,WAAW,gBAAgB;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC;CAC7C;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAKD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,iBAAiB,CAY5E;AAED,wEAAwE;AACxE,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,QAAQ,EAAE,OAAO,GAChB,uBAAuB,EAAE,CAU3B"}
@@ -0,0 +1,35 @@
1
+ export const DEGRADED_RUN_BANNER = 'DEGRADED_RUN';
2
+ const DONE_CLAIM_RE = /\b(pronto\s+al\s+commit|complet[oa]|hand[- ]?off|implementat[oi]|tutto\s+fatto)\b/i;
3
+ /**
4
+ * Detect council runs that should not be treated as a clean hand-off.
5
+ */
6
+ export function detectDegradedRun(input) {
7
+ if (input.runMode === 'design-phase') {
8
+ return { degraded: false, reasons: [] };
9
+ }
10
+ const reasons = [];
11
+ if (input.chairmanErrored)
12
+ reasons.push('chairman errored');
13
+ if (input.councilAborted)
14
+ reasons.push('council aborted');
15
+ const writes = input.luciferWriteCount ?? 0;
16
+ if (DONE_CLAIM_RE.test(input.synthesisText ?? '') && writes === 0) {
17
+ reasons.push('synthesis claims done but no files were written');
18
+ }
19
+ return { degraded: reasons.length > 0, reasons };
20
+ }
21
+ /** Warn when a degraded run omits the mandatory banner in synthesis. */
22
+ export function auditDegradedBanner(synthesisText, degraded) {
23
+ if (!degraded || !synthesisText?.trim())
24
+ return [];
25
+ if (synthesisText.includes(DEGRADED_RUN_BANNER))
26
+ return [];
27
+ return [{
28
+ id: 'synthesis.degraded-banner',
29
+ severity: 'warn',
30
+ ok: false,
31
+ tier: 'grep',
32
+ message: `Degraded council run must include ${DEGRADED_RUN_BANNER} banner in synthesis`,
33
+ }];
34
+ }
35
+ //# sourceMappingURL=degraded.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"degraded.js","sourceRoot":"","sources":["../../../src/council/verification/degraded.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,m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
+ import type { VerificationCheckResult } from './types.js';
2
+ /**
3
+ * Flag synthesis text that asserts verification without citing evidence.
4
+ */
5
+ export declare function lintSynthesisHonesty(synthesisText: string | undefined): VerificationCheckResult[];
6
+ //# sourceMappingURL=honesty.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"honesty.d.ts","sourceRoot":"","sources":["../../../src/council/verification/honesty.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAQ1D;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,uBAAuB,EAAE,CAqBjG"}
@@ -0,0 +1,28 @@
1
+ const UNVERIFIED_CLAIM_RE = /\b(verificat[oi]|confermat[oi]|nessuna\s+regressione|pronto\s+al\s+commit|✓|Lighthouse\s*≥|axe\s+(clean|pulito)|CLS\s*[<≤])\b/i;
2
+ const EVIDENCE_MARKERS_RE = /\b(path:|L\d+|evidence:|verification-report|\.zelari\/|bash:|grep_|wc\s+-c)\b/i;
3
+ /**
4
+ * Flag synthesis text that asserts verification without citing evidence.
5
+ */
6
+ export function lintSynthesisHonesty(synthesisText) {
7
+ if (!synthesisText?.trim()) {
8
+ return [];
9
+ }
10
+ const hasClaim = UNVERIFIED_CLAIM_RE.test(synthesisText);
11
+ const hasEvidence = EVIDENCE_MARKERS_RE.test(synthesisText) ||
12
+ /##\s+Verification\s+status/i.test(synthesisText);
13
+ if (!hasClaim) {
14
+ return [];
15
+ }
16
+ if (hasEvidence) {
17
+ return [];
18
+ }
19
+ return [{
20
+ id: 'synthesis.honesty',
21
+ severity: 'error',
22
+ ok: false,
23
+ tier: 'grep',
24
+ message: 'Synthesis asserts verification (✓/verificato/regressione/Lighthouse) without Evidence table or report reference',
25
+ evidence: synthesisText.slice(0, 200),
26
+ }];
27
+ }
28
+ //# sourceMappingURL=honesty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"honesty.js","sourceRoot":"","sources":["../../../src/council/verification/honesty.ts"],"names":[],"mappings":"AAEA,MAAM,mBAAmB,GACvB,gIAAgI,CAAC;AAEnI,MAAM,mBAAmB,GACvB,gFAAgF,CAAC;AAEnF;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,aAAiC;IACpE,IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,EAAE,CAAC;QAC3B,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,QAAQ,GAAG,mBAAmB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACzD,MAAM,WAAW,GAAG,mBAAmB,CAAC,IAAI,CAAC,aAAa,CAAC;QACzD,6BAA6B,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACpD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,CAAC;YACN,EAAE,EAAE,mBAAmB;YACvB,QAAQ,EAAE,OAAO;YACjB,EAAE,EAAE,KAAK;YACT,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,iHAAiH;YAC1H,QAAQ,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC;SACtC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,26 @@
1
+ import type { VerificationCheckResult } from './types.js';
2
+ /** Lucifero must emit at least one mutating tool in implementation mode. */
3
+ export declare const IMPLEMENTATION_WRITE_REQUIREMENTS: readonly [{
4
+ readonly name: "write_file";
5
+ readonly min: 1;
6
+ }, {
7
+ readonly name: "edit_file";
8
+ readonly min: 1;
9
+ }];
10
+ export interface ImplementationDeliveryCheck {
11
+ ok: boolean;
12
+ missing: string[];
13
+ reason?: string;
14
+ }
15
+ /**
16
+ * True when at least one write_file/edit_file succeeded (not merely emitted).
17
+ * edit_file counts only when occurrencesReplaced > 0.
18
+ */
19
+ export declare function checkImplementationDelivery(successfulWriteCount: number, emittedWriteTools: number): ImplementationDeliveryCheck;
20
+ /** Blocking verify failures the chairman can fix on disk (exclude synthesis meta). */
21
+ export declare function filterDeliveryBlockingFails(results: VerificationCheckResult[]): VerificationCheckResult[];
22
+ export declare function buildImplementationWriteRetryPrompt(userMessage: string): string;
23
+ /** Imperative fix prompt from deterministic verify FAILs (post-write delivery loop). */
24
+ export declare function buildDeliveryFixPrompt(blocking: VerificationCheckResult[], userMessage: string): string;
25
+ export declare function countEmittedWriteTools(emittedToolNames: readonly string[]): number;
26
+ //# sourceMappingURL=implementationDelivery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"implementationDelivery.d.ts","sourceRoot":"","sources":["../../../src/council/verification/implementationDelivery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAI1D,4EAA4E;AAC5E,eAAO,MAAM,iCAAiC;;;;;;EAGpC,CAAC;AAEX,MAAM,WAAW,2BAA2B;IAC1C,EAAE,EAAE,OAAO,CAAC;IACZ,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,oBAAoB,EAAE,MAAM,EAC5B,iBAAiB,EAAE,MAAM,GACxB,2BAA2B,CAiB7B;AAED,sFAAsF;AACtF,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,uBAAuB,EAAE,GACjC,uBAAuB,EAAE,CAO3B;AAED,wBAAgB,mCAAmC,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAY/E;AAED,wFAAwF;AACxF,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,uBAAuB,EAAE,EACnC,WAAW,EAAE,MAAM,GAClB,MAAM,CA0BR;AAED,wBAAgB,sBAAsB,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAElF"}
@@ -0,0 +1,70 @@
1
+ const WRITE_TOOLS = new Set(['write_file', 'edit_file']);
2
+ /** Lucifero must emit at least one mutating tool in implementation mode. */
3
+ export const IMPLEMENTATION_WRITE_REQUIREMENTS = [
4
+ { name: 'write_file', min: 1 },
5
+ { name: 'edit_file', min: 1 },
6
+ ];
7
+ /**
8
+ * True when at least one write_file/edit_file succeeded (not merely emitted).
9
+ * edit_file counts only when occurrencesReplaced > 0.
10
+ */
11
+ export function checkImplementationDelivery(successfulWriteCount, emittedWriteTools) {
12
+ if (successfulWriteCount > 0) {
13
+ return { ok: true, missing: [] };
14
+ }
15
+ if (emittedWriteTools > 0) {
16
+ return {
17
+ ok: false,
18
+ missing: ['edit_file'],
19
+ reason: 'write_file/edit_file ran but no file changed (oldString mismatch or empty write)',
20
+ };
21
+ }
22
+ return {
23
+ ok: false,
24
+ missing: ['write_file', 'edit_file'],
25
+ reason: 'Implementation mode requires at least one successful write_file or edit_file',
26
+ };
27
+ }
28
+ /** Blocking verify failures the chairman can fix on disk (exclude synthesis meta). */
29
+ export function filterDeliveryBlockingFails(results) {
30
+ return results.filter((r) => !r.ok &&
31
+ r.severity === 'error' &&
32
+ !r.id.startsWith('synthesis.'));
33
+ }
34
+ export function buildImplementationWriteRetryPrompt(userMessage) {
35
+ const goal = userMessage.trim().slice(0, 500);
36
+ return (`IMPLEMENTATION INCOMPLETE — no file was successfully modified on disk.\n` +
37
+ `User goal: ${goal || '(see council context)'}\n\n` +
38
+ `You MUST implement the requested changes NOW using write_file or edit_file.\n` +
39
+ `Rules:\n` +
40
+ `- read_file the target before edit_file if oldString might have drifted\n` +
41
+ `- Use native tool_call (preferred) or a valid ---TOOLS--- JSON block\n` +
42
+ `- No prose, no verification table — only tool calls until a write succeeds\n` +
43
+ `- Motion: animate ONLY transform and opacity in @keyframes/transitions`);
44
+ }
45
+ /** Imperative fix prompt from deterministic verify FAILs (post-write delivery loop). */
46
+ export function buildDeliveryFixPrompt(blocking, userMessage) {
47
+ const lines = blocking.map((r) => {
48
+ const file = r.file ? ` (${r.file})` : '';
49
+ return ` - ${r.id}${file}: ${r.message}`;
50
+ });
51
+ const goal = userMessage.trim().slice(0, 300);
52
+ const hints = [];
53
+ if (blocking.some((r) => r.id === 'inline-js.budget')) {
54
+ hints.push('inline-js.budget: trim the inline <script> by ~1.5KB — remove verbose comments, ' +
55
+ 'drop optional JS (tilt/aurora cursor), shorten selectors; keep reveal IO + nav spy');
56
+ }
57
+ if (blocking.some((r) => r.id.startsWith('motion.'))) {
58
+ hints.push('motion.*: @keyframes and transition may use ONLY transform and opacity — ' +
59
+ 'grep forbidden props and replace with compositor-safe equivalents');
60
+ }
61
+ return (`Deterministic verification still FAILs after your implementation turn. ` +
62
+ `Fix ONLY these blocking issues — do not add features:\n${lines.join('\n')}\n\n` +
63
+ (goal ? `Original user goal (context): ${goal}\n\n` : '') +
64
+ (hints.length > 0 ? `Hints:\n${hints.map((h) => `- ${h}`).join('\n')}\n\n` : '') +
65
+ `Use read_file then edit_file on the listed files. No verification table — tool calls only.`);
66
+ }
67
+ export function countEmittedWriteTools(emittedToolNames) {
68
+ return emittedToolNames.filter((t) => WRITE_TOOLS.has(t)).length;
69
+ }
70
+ //# sourceMappingURL=implementationDelivery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"implementationDelivery.js","sourceRoot":"","sources":["../../../src/council/verification/implementationDelivery.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC;AAEzD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,iCAAiC,GAAG;IAC/C,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,EAAE;IAC9B,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,EAAE;CACrB,CAAC;AAQX;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CACzC,oBAA4B,EAC5B,iBAAyB;IAEzB,IAAI,oBAAoB,GAAG,CAAC,EAAE,CAAC;QAC7B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0,0 +1,15 @@
1
+ export * from './types.js';
2
+ export * from './runChecks.js';
3
+ export * from './honesty.js';
4
+ export * from './parseCssMotion.js';
5
+ export * from './tiers.js';
6
+ export * from './citeVerify.js';
7
+ export * from './synthesisAudit.js';
8
+ export * from './microGate.js';
9
+ export * from './completion.js';
10
+ export * from './implementationDelivery.js';
11
+ export * from './degraded.js';
12
+ export * from './autofix.js';
13
+ export * from './motionAutofix.js';
14
+ export * from './inlineJsAutofix.js';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/council/verification/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,15 @@
1
+ export * from './types.js';
2
+ export * from './runChecks.js';
3
+ export * from './honesty.js';
4
+ export * from './parseCssMotion.js';
5
+ export * from './tiers.js';
6
+ export * from './citeVerify.js';
7
+ export * from './synthesisAudit.js';
8
+ export * from './microGate.js';
9
+ export * from './completion.js';
10
+ export * from './implementationDelivery.js';
11
+ export * from './degraded.js';
12
+ export * from './autofix.js';
13
+ export * from './motionAutofix.js';
14
+ export * from './inlineJsAutofix.js';
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/council/verification/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { VerificationReport } from './types.js';
2
+ /** Deterministic inline &lt;script&gt; budget fix when LLM delivery fails. */
3
+ export declare function applyInlineJsAutofix(projectRoot: string, report: VerificationReport): {
4
+ applied: boolean;
5
+ filesChanged: string[];
6
+ fixes: string[];
7
+ };
8
+ //# sourceMappingURL=inlineJsAutofix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inlineJsAutofix.d.ts","sourceRoot":"","sources":["../../../src/council/verification/inlineJsAutofix.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AA6DrD,8EAA8E;AAC9E,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,kBAAkB,GACzB;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAsC/D"}
@@ -0,0 +1,85 @@
1
+ import { readFileSync, writeFileSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ import { DEFAULT_NFR_SPEC } from './runChecks.js';
4
+ const SCRIPT_RE = /<script[^>]*>([\s\S]*?)<\/script>/i;
5
+ /** Strip comments and excess whitespace from inline script bodies. */
6
+ function minifyInlineJs(js) {
7
+ let out = js.replace(/\/\*[\s\S]*?\*\//g, '');
8
+ out = out
9
+ .split('\n')
10
+ .map((line) => line.replace(/\/\/.*$/, '').trimEnd())
11
+ .filter((line) => line.trim().length > 0)
12
+ .join('\n');
13
+ return out.replace(/\n{2,}/g, '\n');
14
+ }
15
+ /** Drop optional v0.4 interaction blocks when budget still exceeded. */
16
+ function dropOptionalJsBlocks(js) {
17
+ return js
18
+ .replace(/\/\*\s*={3,}[^*]*v0\.4[^*]*\*\/[\s\S]*?(?=\/\*\s*={3,}|const openAllFaq|window\.addEventListener\('beforeprint')/i, '')
19
+ .replace(/if\s*\(\s*!reduceMotion\s*\)\s*\{[\s\S]*?tiltEls\.forEach[\s\S]*?\}\s*\}/, '')
20
+ .replace(/const hero = document\.querySelector\('\.hero'\);[\s\S]*?aurora\.style\.transition = ''[\s\S]*?\}\s*,\s*600\);\s*\}/, '')
21
+ .replace(/const flowObserver = new IntersectionObserver[\s\S]*?flowObserver\.observe\(flowEl\);\s*/, '');
22
+ }
23
+ function dropPaddingLiterals(js) {
24
+ return js.replace(/const\s+\w+\s*=\s*["'][^"']{400,}["']\s*;?/g, '');
25
+ }
26
+ function trimScriptBlock(js, maxBytes) {
27
+ const original = js;
28
+ let next = js;
29
+ for (let pass = 0; pass < 4; pass++) {
30
+ let step = minifyInlineJs(next);
31
+ if (Buffer.byteLength(step, 'utf8') > maxBytes) {
32
+ step = dropOptionalJsBlocks(step);
33
+ step = minifyInlineJs(step);
34
+ }
35
+ if (Buffer.byteLength(step, 'utf8') > maxBytes) {
36
+ step = dropPaddingLiterals(step);
37
+ step = minifyInlineJs(step);
38
+ }
39
+ if (step === next)
40
+ break;
41
+ next = step;
42
+ if (Buffer.byteLength(next, 'utf8') <= maxBytes)
43
+ break;
44
+ }
45
+ return { js: next, changed: next !== original };
46
+ }
47
+ /** Deterministic inline &lt;script&gt; budget fix when LLM delivery fails. */
48
+ export function applyInlineJsAutofix(projectRoot, report) {
49
+ const fails = report.results.filter((r) => !r.ok && r.id === 'inline-js.budget' && r.file);
50
+ if (fails.length === 0) {
51
+ return { applied: false, filesChanged: [], fixes: [] };
52
+ }
53
+ const maxBytes = DEFAULT_NFR_SPEC.inlineJs?.maxBytes ?? 5120;
54
+ const filesChanged = [];
55
+ const fixes = [];
56
+ for (const r of fails) {
57
+ const rel = r.file ?? 'index.html';
58
+ const abs = join(projectRoot, rel);
59
+ let html;
60
+ try {
61
+ html = readFileSync(abs, 'utf8');
62
+ }
63
+ catch {
64
+ continue;
65
+ }
66
+ const m = SCRIPT_RE.exec(html);
67
+ if (!m)
68
+ continue;
69
+ const before = m[1] ?? '';
70
+ const { js: after, changed } = trimScriptBlock(before, maxBytes);
71
+ const afterBytes = Buffer.byteLength(after, 'utf8');
72
+ if (!changed || afterBytes > maxBytes)
73
+ continue;
74
+ const nextHtml = html.replace(SCRIPT_RE, `<script>${after}</script>`);
75
+ writeFileSync(abs, nextHtml, 'utf8');
76
+ filesChanged.push(rel);
77
+ fixes.push(`${rel}: trimmed inline script ${Buffer.byteLength(before, 'utf8')}→${afterBytes} bytes`);
78
+ }
79
+ return {
80
+ applied: filesChanged.length > 0,
81
+ filesChanged,
82
+ fixes,
83
+ };
84
+ }
85
+ //# sourceMappingURL=inlineJsAutofix.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inlineJsAutofix.js","sourceRoot":"","sources":["../../../src/council/verification/inlineJsAutofix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,SAAS,GAAG,oCAAoC,CAAC;AAEvD,sEAAsE;AACtE,SAAS,cAAc,CAAC,EAAU;IAChC,IAAI,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;IAC9C,GAAG,GAAG,GAAG;SACN,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EA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QACX,CAAC;QACD,MAAM,CAAC,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/B,IAAI,CAAC,CAAC;YAAE,SAAS;QACjB,MAAM,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC1B,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,eAAe,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACjE,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACpD,IAAI,CAAC,OAAO,IAAI,UAAU,GAAG,QAAQ;YAAE,SAAS;QAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,WAAW,KAAK,WAAW,CAAC,CAAC;QACtE,aAAa,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QACrC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACvB,KAAK,CAAC,IAAI,CACR,GAAG,GAAG,2BAA2B,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,UAAU,QAAQ,CACzF,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,YAAY,CAAC,MAAM,GAAG,CAAC;QAChC,YAAY;QACZ,KAAK;KACN,CAAC;AACJ,CAAC"}
@@ -0,0 +1,18 @@
1
+ export interface MicroGateWarning {
2
+ id: string;
3
+ message: string;
4
+ file: string;
5
+ line?: number;
6
+ }
7
+ /**
8
+ * Quick subset of Gate A on a single file (HTML). Used for inline WARN after writes.
9
+ */
10
+ export declare function runMicroVerificationOnFile(projectRoot: string, relPath: string, zelariRoot?: string): MicroGateWarning[];
11
+ export declare function parseProjectRootFromWorkspaceContext(ctx: string): string | null;
12
+ /** Run micro-gate when Lucifero writes a target HTML file. */
13
+ export declare function runChairmanMicroGate(input: {
14
+ projectRoot: string;
15
+ relPath: string;
16
+ zelariRoot?: string;
17
+ }): MicroGateWarning[];
18
+ //# sourceMappingURL=microGate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"microGate.d.ts","sourceRoot":"","sources":["../../../src/council/verification/microGate.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AA8BD;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,MAAM,GAClB,gBAAgB,EAAE,CAgCpB;AAED,wBAAgB,oCAAoC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG/E;AAED,8DAA8D;AAC9D,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,gBAAgB,EAAE,CAQrB"}