@ryuenn3123/agentic-senior-core 3.0.10 → 3.0.11

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-04-20T12:33:22.759Z",
2
+ "generatedAt": "2026-04-20T12:42:37.832Z",
3
3
  "reportName": "memory-continuity-benchmark",
4
4
  "schemaVersion": "1.0.0",
5
5
  "passed": true,
package/.cursorrules CHANGED
@@ -1,6 +1,6 @@
1
1
  # AGENTIC-SENIOR-CORE DYNAMIC GOVERNANCE RULESET
2
2
 
3
- Generated by Agentic-Senior-Core CLI v3.0.10
3
+ Generated by Agentic-Senior-Core CLI v3.0.11
4
4
  Timestamp: 2026-04-18T00:00:00.000Z
5
5
  Selected profile: beginner
6
6
  Selected policy file: .agent-context/policies/llm-judge-threshold.json
package/.windsurfrules CHANGED
@@ -1,6 +1,6 @@
1
1
  # AGENTIC-SENIOR-CORE DYNAMIC GOVERNANCE RULESET
2
2
 
3
- Generated by Agentic-Senior-Core CLI v3.0.10
3
+ Generated by Agentic-Senior-Core CLI v3.0.11
4
4
  Timestamp: 2026-04-18T00:00:00.000Z
5
5
  Selected profile: beginner
6
6
  Selected policy file: .agent-context/policies/llm-judge-threshold.json
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryuenn3123/agentic-senior-core",
3
- "version": "3.0.10",
3
+ "version": "3.0.11",
4
4
  "type": "module",
5
5
  "description": "Force your AI Agent to code like a Staff Engineer, not a Junior.",
6
6
  "bin": {
@@ -43,7 +43,6 @@
43
43
  "scripts": {
44
44
  "init": "node ./bin/agentic-senior-core.js init",
45
45
  "audit:frontend-usability": "node ./scripts/frontend-usability-audit.mjs",
46
- "audit:ui-design-judge": "node ./scripts/ui-design-judge.mjs",
47
46
  "audit:documentation-boundary": "node ./scripts/documentation-boundary-audit.mjs",
48
47
  "audit:context-triggered": "node ./scripts/context-triggered-audit.mjs",
49
48
  "audit:rules-guardian": "node ./scripts/rules-guardian-audit.mjs",
@@ -68,7 +68,8 @@ const REQUIRED_BOOTSTRAP_DESIGN_SNIPPETS = [
68
68
 
69
69
  const REQUIRED_UI_DESIGN_JUDGE_SNIPPETS = [
70
70
  'Advisory-first UI design contract judge.',
71
- 'Default mode is advisory: findings never block release. Strict mode is opt-in.',
71
+ 'Repo-internal workflow audit; no user-facing runtime modes.',
72
+ 'Runs only in advisory mode for this repository workflow.',
72
73
  'Do not reward generic SaaS defaults or popular template patterns.',
73
74
  'UI design judge only evaluates changed UI surfaces.',
74
75
  ];
@@ -6,30 +6,14 @@
6
6
  *
7
7
  * Advisory-first UI design contract judge.
8
8
  *
9
+ * Repo-internal workflow audit; no user-facing runtime modes.
9
10
  * Compares changed UI diffs against docs/design-intent.json and docs/DESIGN.md.
10
- * Default mode is advisory: findings never block release. Strict mode is opt-in.
11
- *
12
- * Usage:
13
- * node scripts/ui-design-judge.mjs
14
- * node scripts/ui-design-judge.mjs --dry-run
15
- * node scripts/ui-design-judge.mjs --strict
16
- *
17
- * Environment variables:
18
- * OPENAI_API_KEY / ANTHROPIC_API_KEY / GEMINI_API_KEY
19
- * UI_DESIGN_JUDGE_MODEL Override model for this script
20
- * LLM_JUDGE_MODEL Shared fallback model override
21
- * UI_DESIGN_JUDGE_MAX_DIFF_CHARS Max diff chars to send (default: 12000)
22
- * UI_DESIGN_JUDGE_OUTPUT_PATH Machine-readable report output path
23
- * UI_DESIGN_JUDGE_EMIT_JSON false disables report file emission
24
- * UI_DESIGN_JUDGE_MOCK_RESPONSE Test-only raw LLM response body
25
- * UI_DESIGN_JUDGE_CHANGED_FILES Optional comma/newline-separated changed file override
26
- * PR_DIFF Inject diff directly
27
- * GITHUB_BASE_SHA / GITHUB_HEAD_SHA
28
- * CI_MERGE_REQUEST_DIFF_BASE_SHA / CI_COMMIT_SHA
11
+ * Runs only in advisory mode for this repository workflow.
12
+ * Emits JSON to stdout for release-gate and CI consumption.
29
13
  */
30
14
 
31
15
  import { execSync } from 'node:child_process';
32
- import { existsSync, readFileSync, writeFileSync } from 'node:fs';
16
+ import { existsSync, readFileSync } from 'node:fs';
33
17
  import { resolve, dirname, extname } from 'node:path';
34
18
  import { fileURLToPath } from 'node:url';
35
19
 
@@ -39,13 +23,7 @@ const REPOSITORY_ROOT = resolve(__dirname, '..');
39
23
 
40
24
  const DESIGN_INTENT_PATH = resolve(REPOSITORY_ROOT, 'docs', 'design-intent.json');
41
25
  const DESIGN_GUIDE_PATH = resolve(REPOSITORY_ROOT, 'docs', 'DESIGN.md');
42
- const DEFAULT_MACHINE_REPORT_PATH = resolve(REPOSITORY_ROOT, '.agent-context', 'state', 'ui-design-judge-report.json');
43
- const MACHINE_REPORT_PATH = process.env.UI_DESIGN_JUDGE_OUTPUT_PATH || DEFAULT_MACHINE_REPORT_PATH;
44
- const SHOULD_EMIT_MACHINE_REPORT = process.env.UI_DESIGN_JUDGE_EMIT_JSON !== 'false';
45
- const MAX_DIFF_CHARS = parseInt(process.env.UI_DESIGN_JUDGE_MAX_DIFF_CHARS ?? '12000', 10);
46
- const IS_DRY_RUN = process.argv.includes('--dry-run');
47
- const IS_STRICT_MODE = process.argv.includes('--strict');
48
- const IS_ADVISORY_MODE = !IS_STRICT_MODE;
26
+ const MAX_DIFF_CHARS = 12000;
49
27
  const UI_FILE_EXTENSIONS = new Set(['.js', '.jsx', '.ts', '.tsx', '.vue', '.css', '.scss', '.sass']);
50
28
 
51
29
  /**
@@ -64,7 +42,7 @@ const UI_FILE_EXTENSIONS = new Set(['.js', '.jsx', '.ts', '.tsx', '.vue', '.css'
64
42
  * generatedAt: string,
65
43
  * auditName: string,
66
44
  * schemaVersion: string,
67
- * mode: 'advisory' | 'strict',
45
+ * mode: 'advisory',
68
46
  * advisoryOnly: boolean,
69
47
  * passed: boolean,
70
48
  * skipped: boolean,
@@ -177,13 +155,6 @@ function collectPullRequestDiff() {
177
155
  }
178
156
 
179
157
  function collectChangedFiles() {
180
- if (process.env.UI_DESIGN_JUDGE_CHANGED_FILES) {
181
- return process.env.UI_DESIGN_JUDGE_CHANGED_FILES
182
- .split(/[\r\n,]+/u)
183
- .map((filePath) => filePath.trim())
184
- .filter(Boolean);
185
- }
186
-
187
158
  if (process.env.PR_DIFF) {
188
159
  const filePathSet = new Set();
189
160
  for (const diffHeaderMatch of process.env.PR_DIFF.matchAll(/^diff --git a\/(.+?) b\/(.+)$/gm)) {
@@ -256,7 +227,7 @@ function loadDesignGuide() {
256
227
  return readFileSync(DESIGN_GUIDE_PATH, 'utf8');
257
228
  }
258
229
 
259
- function buildSystemPrompt(modeLabel) {
230
+ function buildSystemPrompt() {
260
231
  return [
261
232
  'You are a Principal UI/UX Design Reviewer.',
262
233
  'Compare the changed UI code against the provided design contract.',
@@ -265,7 +236,7 @@ function buildSystemPrompt(modeLabel) {
265
236
  'Do not reward generic SaaS defaults or popular template patterns.',
266
237
  'Do not penalize originality when the implementation still aligns with the contract.',
267
238
  'Only flag drift when there is a clear mismatch with the contract, accessibility non-negotiables, or cross-viewport adaptation rules.',
268
- `Current mode: ${modeLabel}. In advisory mode, findings are recommendations and should not be framed as release blockers unless blockingRecommended is clearly true.`,
239
+ 'This audit always runs in advisory mode for this repository workflow.',
269
240
  'Focus on color intent, typographic hierarchy, responsive re-layout, interaction behavior, and genericity drift.',
270
241
  'Return ONLY one JSON object on a single line prefixed with JSON_VERDICT:.',
271
242
  'Schema:',
@@ -302,7 +273,7 @@ function buildUserMessage(designIntentContent, designGuideContent, diffContent,
302
273
  }
303
274
 
304
275
  async function callOpenAiProvider(systemPrompt, userMessage) {
305
- const selectedModel = process.env.UI_DESIGN_JUDGE_MODEL ?? process.env.LLM_JUDGE_MODEL ?? 'gpt-4o-mini';
276
+ const selectedModel = process.env.LLM_JUDGE_MODEL ?? 'gpt-4o-mini';
306
277
  const apiResponse = await fetch('https://api.openai.com/v1/chat/completions', {
307
278
  method: 'POST',
308
279
  headers: {
@@ -330,7 +301,7 @@ async function callOpenAiProvider(systemPrompt, userMessage) {
330
301
  }
331
302
 
332
303
  async function callAnthropicProvider(systemPrompt, userMessage) {
333
- const selectedModel = process.env.UI_DESIGN_JUDGE_MODEL ?? process.env.LLM_JUDGE_MODEL ?? 'claude-3-5-haiku-latest';
304
+ const selectedModel = process.env.LLM_JUDGE_MODEL ?? 'claude-3-5-haiku-latest';
334
305
  const apiResponse = await fetch('https://api.anthropic.com/v1/messages', {
335
306
  method: 'POST',
336
307
  headers: {
@@ -356,7 +327,7 @@ async function callAnthropicProvider(systemPrompt, userMessage) {
356
327
  }
357
328
 
358
329
  async function callGeminiProvider(systemPrompt, userMessage) {
359
- const selectedModel = process.env.UI_DESIGN_JUDGE_MODEL ?? process.env.LLM_JUDGE_MODEL ?? 'gemini-2.0-flash';
330
+ const selectedModel = process.env.LLM_JUDGE_MODEL ?? 'gemini-2.0-flash';
360
331
  const apiKey = process.env.GEMINI_API_KEY ?? '';
361
332
  const endpointUrl = `https://generativelanguage.googleapis.com/v1beta/models/${selectedModel}:generateContent?key=${apiKey}`;
362
333
 
@@ -445,8 +416,8 @@ function buildReport(partialReport) {
445
416
  generatedAt: new Date().toISOString(),
446
417
  auditName: 'ui-design-judge',
447
418
  schemaVersion: '1.0',
448
- mode: IS_STRICT_MODE ? 'strict' : 'advisory',
449
- advisoryOnly: IS_ADVISORY_MODE,
419
+ mode: 'advisory',
420
+ advisoryOnly: true,
450
421
  passed: true,
451
422
  skipped: false,
452
423
  skipReason: null,
@@ -468,10 +439,6 @@ function buildReport(partialReport) {
468
439
  }
469
440
 
470
441
  function emitMachineReadableReport(machineReportPayload) {
471
- if (SHOULD_EMIT_MACHINE_REPORT) {
472
- writeFileSync(MACHINE_REPORT_PATH, `${JSON.stringify(machineReportPayload, null, 2)}\n`, 'utf8');
473
- }
474
-
475
442
  console.log(JSON.stringify(machineReportPayload, null, 2));
476
443
  }
477
444
 
@@ -508,28 +475,9 @@ async function main() {
508
475
  return;
509
476
  }
510
477
 
511
- const systemPrompt = buildSystemPrompt(IS_STRICT_MODE ? 'strict' : 'advisory');
478
+ const systemPrompt = buildSystemPrompt();
512
479
  const userMessage = buildUserMessage(designIntentContent, designGuideContent, rawDiff, changedUiFiles);
513
480
 
514
- if (IS_DRY_RUN) {
515
- emitMachineReadableReport(buildReport({
516
- provider: 'dry-run',
517
- contractPresent: true,
518
- summary: {
519
- changedUiFileCount: changedUiFiles.length,
520
- alignmentScore: null,
521
- driftCount: 0,
522
- blockingCandidateCount: 0,
523
- },
524
- notes: [
525
- 'Dry run enabled. No LLM provider call was made.',
526
- `System prompt chars: ${systemPrompt.length}`,
527
- `User message chars: ${userMessage.length}`,
528
- ],
529
- }));
530
- return;
531
- }
532
-
533
481
  const selectedProvider = selectAvailableProvider();
534
482
  if (!selectedProvider) {
535
483
  emitMachineReadableReport(buildReport({
@@ -541,7 +489,7 @@ async function main() {
541
489
  driftCount: 0,
542
490
  blockingCandidateCount: 0,
543
491
  },
544
- notes: ['No LLM provider configured. UI design judge skipped provider review and remained advisory.'],
492
+ notes: ['No LLM provider configured. UI design judge skipped provider review and stayed advisory.'],
545
493
  }));
546
494
  return;
547
495
  }
@@ -565,13 +513,8 @@ async function main() {
565
513
  blockingCandidateCount: 0,
566
514
  },
567
515
  notes: [`Provider call failed: ${providerErrorMessage}`],
568
- passed: IS_ADVISORY_MODE,
516
+ passed: true,
569
517
  }));
570
-
571
- if (IS_STRICT_MODE) {
572
- process.exit(1);
573
- }
574
-
575
518
  return;
576
519
  }
577
520
 
@@ -582,12 +525,11 @@ async function main() {
582
525
  const notes = Array.isArray(verdict?.notes)
583
526
  ? verdict.notes.map((note) => String(note))
584
527
  : [];
585
- const shouldFailInStrictMode = IS_STRICT_MODE && blockingCandidateCount > 0;
586
528
 
587
529
  const reportPayload = buildReport({
588
530
  provider: selectedProvider.providerName,
589
531
  contractPresent: true,
590
- passed: malformed ? IS_ADVISORY_MODE : !shouldFailInStrictMode,
532
+ passed: true,
591
533
  malformedVerdict: malformed,
592
534
  summary: {
593
535
  changedUiFileCount: changedUiFiles.length,
@@ -602,10 +544,6 @@ async function main() {
602
544
  });
603
545
 
604
546
  emitMachineReadableReport(reportPayload);
605
-
606
- if (IS_STRICT_MODE && (malformed || shouldFailInStrictMode)) {
607
- process.exit(1);
608
- }
609
547
  }
610
548
 
611
549
  main().catch((unexpectedError) => {
@@ -616,11 +554,7 @@ main().catch((unexpectedError) => {
616
554
  emitMachineReadableReport(buildReport({
617
555
  provider: 'none',
618
556
  providerError: true,
619
- passed: IS_ADVISORY_MODE,
557
+ passed: true,
620
558
  notes: [`Unexpected ui-design-judge failure: ${errorMessage}`],
621
559
  }));
622
-
623
- if (IS_STRICT_MODE) {
624
- process.exit(1);
625
- }
626
560
  });
@@ -291,7 +291,8 @@ const REQUIRED_UI_DESIGN_AUTOMATION_SNIPPETS = [
291
291
  path: 'scripts/ui-design-judge.mjs',
292
292
  snippets: [
293
293
  'Advisory-first UI design contract judge.',
294
- 'Default mode is advisory: findings never block release. Strict mode is opt-in.',
294
+ 'Repo-internal workflow audit; no user-facing runtime modes.',
295
+ 'Runs only in advisory mode for this repository workflow.',
295
296
  'Do not reward generic SaaS defaults or popular template patterns.',
296
297
  'UI design judge only evaluates changed UI surfaces.',
297
298
  ],
@@ -1,25 +0,0 @@
1
- {
2
- "generatedAt": "2026-04-20T12:33:27.082Z",
3
- "auditName": "ui-design-judge",
4
- "schemaVersion": "1.0",
5
- "mode": "advisory",
6
- "advisoryOnly": true,
7
- "passed": true,
8
- "skipped": true,
9
- "skipReason": "Design contract is missing or unreadable. Skipping UI design judge.",
10
- "provider": "none",
11
- "ciProvider": "github",
12
- "contractPresent": false,
13
- "summary": {
14
- "changedUiFileCount": 0,
15
- "alignmentScore": null,
16
- "driftCount": 0,
17
- "blockingCandidateCount": 0
18
- },
19
- "malformedVerdict": false,
20
- "providerError": false,
21
- "findings": [],
22
- "notes": [
23
- "docs/design-intent.json is required for contract-aware UI judging."
24
- ]
25
- }