@ryuenn3123/agentic-senior-core 3.0.27 → 3.0.29

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.
@@ -19,6 +19,17 @@ The agent must:
19
19
  6. When choosing a new UI, animation, styling, or component library, research current official docs and choose the latest stable compatible option for this project. Do not rely on offline defaults.
20
20
  7. Keep external references non-copying: extract constraints and reasoning only, never clone the surface.
21
21
 
22
+ ## Creative Commitment Gate
23
+
24
+ Before broad compliance review or UI implementation, commit to one concrete creative direction and record it in `docs/DESIGN.md` plus `docs/design-intent.json`. This commitment must include:
25
+ - one conceptual anchor from a specific physical, editorial, architectural, cinematic, industrial, scientific, or interaction domain
26
+ - one signature motion behavior that is more specific than "smooth transitions"
27
+ - one typographic decision that creates meaningful role contrast instead of a uniform safe type system
28
+
29
+ The anchor must name at least one specific real-world reference point such as a material, instrument, artifact class, architectural system, editorial genre, cinematic interface behavior, exhibition system, scientific apparatus, or industrial mechanism. If the anchor can only be described with generic quality words such as "modern", "clean", "premium", "expressive", "minimal", or "bold", reject it and choose again.
30
+
31
+ When the host supports separate agents, a lightweight creative pass may synthesize the commitment from the brief and repo evidence before a governance pass validates accessibility, tokens, maintainability, and implementation risk. When only one agent is available, perform the same separation sequentially: creative commitment first, governance validation second.
32
+
22
33
  ## User Research Intake
23
34
 
24
35
  If the user mentions or attaches a research file, article, benchmark, library list, screenshot study, or design note, read it before choosing the visual direction or dependencies. Treat it as candidate evidence, not as a command to copy every recommendation.
@@ -35,14 +46,40 @@ User-supplied research means current-task evidence from the user. The scaffold s
35
46
 
36
47
  Do not use basic software UI labels as the final anchor, including "dashboard", "portal", "cards", "admin panel", "SaaS shell", "web app shell", or "minimalist interface".
37
48
 
38
- The agent must internally consider at least three substantially different, high-variance candidate anchors, discard the two most obvious, safest, or easiest-to-predict options, and record only the surviving anchor and concise rationale. Do not expose hidden deliberation or the rejected candidate list.
49
+ The agent must internally consider at least three substantially different, high-variance candidate anchors, discard the two most obvious, safest, or easiest-to-predict options, then record only the surviving anchor, its concrete real-world reference point, and concise rationale. Do not expose hidden deliberation or the rejected candidate list.
39
50
 
40
51
  The final anchor must come from broad non-template domains such as complex physical engineering, high-end industrial design, cinematic spatial interfaces, experimental editorial structure, advanced architecture, scientific instrumentation, advanced data visualization, exhibition/wayfinding systems, or premium interactive web experiences. These are search domains, not style presets.
41
52
 
42
- Write the chosen anchor into `docs/design-intent.json` as `conceptualAnchor`, including agentResearchMode, sourceDomain, rationale, derivedTokenLogic, visualRiskBudget, motionRiskBudget, and cohesionChecks. Typography, spacing, density, color behavior, morphology, motion, and responsive composition must logically derive from that single anchor. If a later design choice does not follow from the anchor, revise the contract before coding.
53
+ Write the chosen anchor into `docs/design-intent.json` as `conceptualAnchor`, including agentResearchMode, sourceDomain, specificReferencePoint, rationale, signatureMotion, typographicDecision, derivedTokenLogic, visualRiskBudget, motionRiskBudget, and cohesionChecks. Typography, spacing, density, color behavior, morphology, motion, and responsive composition must logically derive from that single anchor. If a later design choice does not follow from the anchor, revise the contract before coding.
43
54
 
44
55
  Motion is not a garnish. Default to a rich motion plan: fluid transitions, spatial reveals, scroll choreography, micro-interactions, and modern motion libraries are expected when they strengthen the anchor and product experience. Keep reduced-motion fallbacks instead of suppressing motion, and solve performance deliberately instead of using safety language as a reason to stay static.
45
56
 
57
+ ## Token Derivation Audit
58
+
59
+ Before implementation, `docs/design-intent.json` must include top-level `derivedTokenLogic` with `anchorReference`, `colorDerivationSource`, `spacingDerivationSource`, `typographyDerivationSource`, `motionDerivationSource`, and `validationRule`.
60
+
61
+ After writing `docs/design-intent.json`, audit the token plan:
62
+ - Why these colors instead of another palette? Answer in one sentence that references the anchorReference.
63
+ - Why this spacing rhythm? Answer in one sentence that references the anchorReference.
64
+ - Why this motion timing and easing? Answer in one sentence that references the anchorReference.
65
+
66
+ If the answer is "looks good", "common practice", "modern default", "Tailwind default", or a generic framework habit, the token is wrong. Derive it again from the chosen anchor before writing UI code.
67
+
68
+ ## Library Research Protocol
69
+
70
+ If web search is available:
71
+ - Research current official docs for each library, framework API, animation package, scroll tool, 3D/canvas helper, charting tool, icon package, or UI primitive claim.
72
+ - Record source URL, fetched date, stable compatible version, purpose, risk, and fallback in `docs/design-intent.json`.
73
+ - Set `libraryResearchStatus` to `verified` only when each external library decision has current official evidence.
74
+
75
+ If web search is unavailable or fails:
76
+ - Do not hallucinate dependency APIs, package names, versions, or imports.
77
+ - Write `LIBRARY_TO_VERIFY: [name] - requires live research before implementation` in the design notes.
78
+ - Use only native CSS, browser APIs, or already-present project dependencies you can verify from local repo files.
79
+ - Set `libraryResearchStatus` to `pending-verification` and give every `libraryDecisions[]` entry a `fallbackIfUnavailable`.
80
+
81
+ Do not write imports from a new library until that library decision is verified or the user explicitly accepts a pending verification blocker.
82
+
46
83
  ## Zero-Based Redesign Protocol
47
84
 
48
85
  If the user says "redesign from zero", "redesain dari 0", "ulang dari 0", "research ulang", or equivalent reset language, activate reset mode.
@@ -106,6 +143,8 @@ The JSON must stay machine-readable and project-specific. It should record:
106
143
  - the confirmed project context and assumptions to validate
107
144
  - agent-chosen visual direction, not scaffold-chosen direction
108
145
  - `conceptualAnchor` and how typography, spacing, morphology, motion, and responsive composition derive from it when no external research was provided
146
+ - `derivedTokenLogic` with exact `anchorReference` traceability for color, spacing, typography, and motion tokens
147
+ - `libraryResearchStatus` plus `libraryDecisions[]` with verified source metadata or explicit native/project-local fallbacks
109
148
  - agent-chosen semantic color roles, typography system, spacing rhythm, and motion approach
110
149
  - token layering with primitive, semantic, and component tokens
111
150
  - viewport mutation rules for mobile, tablet, and desktop
@@ -81,6 +81,7 @@ Run this before declaring a task done. Apply only the sections relevant to the c
81
81
  - [ ] Official setup flows are preferred when they produce better-supported current defaults.
82
82
  - [ ] Docker, framework, package, and ecosystem claims were checked live when they could be stale.
83
83
  - [ ] Token optimization and memory continuity defaults remain enabled unless the user explicitly opts out.
84
+ - [ ] If `.agent-context/state/active-memory.json` exists and the task made material project progress, the agent refreshed it directly before completion and preserved privacy/user-owned entries.
84
85
 
85
86
  ## 9. State And Governance
86
87
 
@@ -56,10 +56,19 @@ Do not use this file to teach generic frontend basics the model already knows.
56
56
 
57
57
  - If the user gives no current-task visual research or reference, the scaffold, old UI, and existing design docs do not count as research.
58
58
  - Before UI code, choose one agent-synthesized conceptual anchor from high-variance non-software domains and record only the final anchor in `docs/design-intent.json`.
59
+ - Before broad compliance review, record a creative commitment: one concrete real-world anchor reference, one signature motion behavior, and one typographic decision with meaningful role contrast.
60
+ - Reject anchors that can only be described with generic quality words such as "modern", "clean", "premium", "expressive", "minimal", or "bold"; the anchor must name a specific material, instrument, artifact class, architectural system, editorial genre, cinematic behavior, exhibition system, scientific apparatus, or industrial mechanism.
59
61
  - Internally reject the safest dashboard, portal, card-grid, admin-shell, or minimalist-web-app mental model before writing CSS.
60
62
  - Typography, spacing, morphology, motion, and responsive recomposition must derive from the chosen anchor, not from framework defaults.
63
+ - Token choices must trace to `docs/design-intent.json` `derivedTokenLogic.anchorReference`. A color, spacing, typography, or motion token that cannot be explained from the anchor is invalid.
61
64
  - Default to an expressive motion plan derived from the anchor. Use spatial transitions, micro-interactions, scroll choreography, and modern animation libraries when they improve the experience; include reduced-motion and performance safeguards without using them as an excuse for a static UI.
62
65
 
66
+ ## Library Research Boundary
67
+
68
+ - New UI, animation, scroll, 3D, canvas, charting, icon, styling, or primitive libraries require current official-doc verification before imports are written.
69
+ - If live research is unavailable, mark `libraryResearchStatus` as `pending-verification`, record the library as `LIBRARY_TO_VERIFY`, and use native CSS, browser APIs, or already-present project dependencies until verification is possible.
70
+ - Each `libraryDecisions[]` entry must have either verification metadata or a concrete `fallbackIfUnavailable`.
71
+
63
72
  ## Responsive Mutation Requirements
64
73
 
65
74
  - Responsive quality is not allowed to be scale-only. At least one surface must materially change position, grouping, priority, or disclosure strategy between mobile and desktop.
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-04-25T10:16:51.159Z",
2
+ "generatedAt": "2026-04-25T11:56:18.296Z",
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.27
3
+ Generated by Agentic-Senior-Core CLI v3.0.29
4
4
  Timestamp: 2026-04-24T06:02:48.303Z
5
5
  Selected policy file: .agent-context/policies/llm-judge-threshold.json
6
6
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Adapter Mode: thin
4
4
  Adapter Source: .instructions.md
5
- Canonical Snapshot SHA256: 11eeafb3ff6a0977785e3668a704c6bba543b515d2828c02de8276f6cf1c391c
5
+ Canonical Snapshot SHA256: 5c955eab4c644e7139c0c5a5609ea9af7d47fdc8e69617f407af01ccc8c64e43
6
6
 
7
7
  Canonical policy source: [.instructions.md](../.instructions.md).
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Adapter Mode: thin
4
4
  Adapter Source: .instructions.md
5
- Canonical Snapshot SHA256: 11eeafb3ff6a0977785e3668a704c6bba543b515d2828c02de8276f6cf1c391c
5
+ Canonical Snapshot SHA256: 5c955eab4c644e7139c0c5a5609ea9af7d47fdc8e69617f407af01ccc8c64e43
6
6
 
7
7
  The canonical policy source for this repository is [.instructions.md](../.instructions.md).
8
8
 
package/.instructions.md CHANGED
@@ -184,8 +184,10 @@ Use available MCP tools when you need validation, linting, or test execution.
184
184
  1. Read `.agent-context/prompts/bootstrap-design.md`.
185
185
  2. Read `.agent-context/rules/frontend-architecture.md`.
186
186
  3. Read UI-relevant repository evidence from `.agent-context/state/onboarding-report.json`, current UI code, and `docs/*`.
187
- 4. Generate or refine `docs/DESIGN.md` plus `docs/design-intent.json` before UI implementation.
188
- 5. Keep context isolated and do not eagerly load unrelated backend-only rules unless the task explicitly touches those boundaries.
187
+ 4. Before UI implementation, record a concrete creative commitment in the design contract: one specific real-world anchor reference, one signature motion behavior, and one typographic decision with meaningful role contrast.
188
+ 5. Ensure `docs/design-intent.json` includes `conceptualAnchor.anchorReference`, top-level `derivedTokenLogic`, `libraryResearchStatus`, and `libraryDecisions[]` before UI code.
189
+ 6. Generate or refine `docs/DESIGN.md` plus `docs/design-intent.json` before UI implementation.
190
+ 7. Keep context isolated and do not eagerly load unrelated backend-only rules unless the task explicitly touches those boundaries.
189
191
 
190
192
  ---
191
193
 
@@ -209,7 +211,8 @@ Why Required: [why the boundary protects the project]
209
211
  1. All relevant rules from `.agent-context/rules/` applied.
210
212
  2. Code reviewed against `.agent-context/review-checklists/pr-checklist.md` and `.agent-context/review-checklists/architecture-review.md`.
211
213
  3. Universal SOP hard gates satisfied (`docs/architecture-decision-record.md`, and `docs/DESIGN.md` plus `docs/design-intent.json` for UI scope).
212
- 4. MCP validation passed (`npm run validate`).
214
+ 4. If `.agent-context/state/active-memory.json` exists and material project progress happened, refresh it directly before the final response: update current focus, durable achievements/issues/next actions/validation state, and `lastUpdatedAt` while preserving privacy rules and existing user-owned entries.
215
+ 5. MCP validation passed (`npm run validate`).
213
216
 
214
217
  ---
215
218
 
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.27
3
+ Generated by Agentic-Senior-Core CLI v3.0.29
4
4
  Timestamp: 2026-04-24T06:02:48.303Z
5
5
  Selected policy file: .agent-context/policies/llm-judge-threshold.json
6
6
 
package/AGENTS.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Adapter Mode: thin
4
4
  Adapter Source: .instructions.md
5
- Canonical Snapshot SHA256: 11eeafb3ff6a0977785e3668a704c6bba543b515d2828c02de8276f6cf1c391c
5
+ Canonical Snapshot SHA256: 5c955eab4c644e7139c0c5a5609ea9af7d47fdc8e69617f407af01ccc8c64e43
6
6
 
7
7
  This file is an adapter entrypoint for agent discovery.
8
8
  The canonical policy source is [.instructions.md](.instructions.md).
package/README.md CHANGED
@@ -10,14 +10,13 @@
10
10
  **Production-grade Rules Engine (Governance Engine) for AI coding agents.**
11
11
  Works with Cursor, Windsurf, GitHub Copilot, Claude Code, Gemini, and other LLM-powered IDE workflows.
12
12
 
13
- Latest release: 3.0.26 (2026-04-25).
14
-
15
- Highlights in 3.0.26:
16
- - Memory continuity now seeds `.agent-context/state/active-memory.json` once, so new sessions have a compact project-focus snapshot without overwriting active work during upgrade.
17
- - Token optimization now exposes an output folding strategy that preserves failures, file/line details, and actionable warnings while folding repetitive shell noise.
18
- - UI design guidance now treats expressive motion as a first-class default for modern interfaces instead of letting safety wording become an excuse for static screens.
19
- - Agents must use live/current-year research for ecosystem, framework, dependency, Docker, and modern UI/library claims instead of offline repository guesses.
20
- - Frontend guidance rejects safe dashboard/admin-panel defaults and requires responsive recomposition.
13
+ Latest release: 3.0.29 (2026-04-25).
14
+
15
+ Highlights in 3.0.29:
16
+ - UI design contracts now require deterministic `anchorReference` traceability through `derivedTokenLogic` before implementation.
17
+ - Compiled UI context can surface a top-of-file anchor commitment header from `docs/design-intent.json` so the creative direction is not buried under governance.
18
+ - Library decisions now must be verified against current official docs or marked `pending-verification` with native/project-local fallbacks.
19
+ - Release gate now validates the design-intent seed for token derivation and library verification completeness.
21
20
 
22
21
  </div>
23
22
 
@@ -26,6 +26,75 @@ import {
26
26
  buildMemoryContinuityGuidanceBlock,
27
27
  } from './memory-continuity.mjs';
28
28
 
29
+ function toSingleLine(value, fallbackValue) {
30
+ const normalizedValue = String(value || '').replace(/\s+/g, ' ').trim();
31
+ return normalizedValue || fallbackValue;
32
+ }
33
+
34
+ async function readDesignIntentIfExists(targetDirectoryPath) {
35
+ const designIntentPath = path.join(targetDirectoryPath, 'docs', 'design-intent.json');
36
+ if (!(await pathExists(designIntentPath))) {
37
+ return null;
38
+ }
39
+
40
+ try {
41
+ return JSON.parse(await fs.readFile(designIntentPath, 'utf8'));
42
+ } catch {
43
+ return {
44
+ parseError: true,
45
+ };
46
+ }
47
+ }
48
+
49
+ function buildAnchorCommitmentHeader(designIntent) {
50
+ if (!designIntent || typeof designIntent !== 'object') {
51
+ return null;
52
+ }
53
+
54
+ if (designIntent.parseError) {
55
+ return [
56
+ '## [UI TASK ANCHOR - READ FIRST]',
57
+ 'Source: docs/design-intent.json',
58
+ 'Status: design-intent.json could not be parsed.',
59
+ 'Required action: fix docs/design-intent.json before UI implementation so the creative commitment can be loaded.',
60
+ ].join('\n');
61
+ }
62
+
63
+ const conceptualAnchor = designIntent.conceptualAnchor || {};
64
+ const derivedTokenLogic = designIntent.derivedTokenLogic || {};
65
+ const creativeCommitment = designIntent.designExecutionHandoff?.creativeCommitment || {};
66
+ const anchorReference = conceptualAnchor.anchorReference || derivedTokenLogic.anchorReference;
67
+ const conceptualAnchorName = conceptualAnchor.name || anchorReference;
68
+ const signatureMove = conceptualAnchor.signatureMove
69
+ || designIntent.designExecutionHandoff?.signatureMoveRationale;
70
+ const signatureMotion = conceptualAnchor.signatureMotion
71
+ || creativeCommitment.signatureMotion
72
+ || derivedTokenLogic.motionDerivationSource;
73
+ const typographicDecision = conceptualAnchor.typographicDecision
74
+ || creativeCommitment.typographicDecision
75
+ || derivedTokenLogic.typographyDerivationSource;
76
+
77
+ if (!conceptualAnchorName && !anchorReference) {
78
+ return [
79
+ '## [UI TASK ANCHOR - READ FIRST]',
80
+ 'Source: docs/design-intent.json',
81
+ 'Status: Creative commitment is missing.',
82
+ 'Required action: define conceptualAnchor.anchorReference, a concrete real-world anchor, signature motion, typographic decision, derivedTokenLogic, and libraryDecisions before UI implementation.',
83
+ ].join('\n');
84
+ }
85
+
86
+ return [
87
+ '## [UI TASK ANCHOR - READ FIRST]',
88
+ 'Source: docs/design-intent.json',
89
+ `Conceptual Anchor: ${toSingleLine(conceptualAnchorName, 'MISSING - complete Creative Commitment Gate before UI implementation')}`,
90
+ `Anchor Reference: ${toSingleLine(anchorReference, 'MISSING - required for deterministic token validation')}`,
91
+ `Signature Move: ${toSingleLine(signatureMove, 'MISSING - define one concrete authored move before UI implementation')}`,
92
+ `Motion Signature: ${toSingleLine(signatureMotion, 'MISSING - define timing/easing/choreography before UI implementation')}`,
93
+ `Typographic Decision: ${toSingleLine(typographicDecision, 'MISSING - define role contrast before UI implementation')}`,
94
+ 'If the UI output does not reflect these lines, stop and revise the design contract before continuing.',
95
+ ].join('\n');
96
+ }
97
+
29
98
  export async function writeSelectedPolicy(targetDirectoryPath, selectedProfileName) {
30
99
  const policyFilePath = path.join(targetDirectoryPath, '.agent-context', 'policies', POLICY_FILE_NAME);
31
100
  const parsedPolicy = JSON.parse(await fs.readFile(policyFilePath, 'utf8'));
@@ -480,6 +549,12 @@ export async function buildCompiledRulesContent({
480
549
  );
481
550
  }
482
551
 
552
+ const designIntent = await readDesignIntentIfExists(resolvedTargetDirectoryPath);
553
+ const anchorCommitmentHeader = buildAnchorCommitmentHeader(designIntent);
554
+ if (anchorCommitmentHeader) {
555
+ contextBlocks.unshift(anchorCommitmentHeader);
556
+ }
557
+
483
558
  return [
484
559
  '# AGENTIC-SENIOR-CORE DYNAMIC GOVERNANCE RULESET',
485
560
  '',
@@ -522,7 +522,10 @@ export function buildMemoryContinuityGuidanceBlock(memoryContinuityState) {
522
522
  `- Load compact index first (limit: ${sessionStartIndexLimit} entries).`,
523
523
  `- Hydrate full detail only for highest-value entries (limit: ${fullHydrationLimit}).`,
524
524
  '- Always redact sensitive text before persistence (<private> blocks and inline secret-like fields).',
525
- '- Refresh `active-memory.json` at natural task boundaries, but never store secrets, raw chat logs, or stale visual taste.',
525
+ '- Refresh `.agent-context/state/active-memory.json` directly at natural task boundaries when material project progress happened.',
526
+ '- Before the final response, update `project.currentFocus`, compact `progress.lastAchievements`, `progress.pendingIssues`, `progress.nextBestActions`, `progress.validationState`, and `lastUpdatedAt` when they changed.',
527
+ '- Preserve existing user-owned entries, keep each array compact (12 entries or fewer), and append only durable facts proven by current repo evidence.',
528
+ '- If no durable project progress happened, leave the snapshot unchanged and state that no memory update was needed.',
526
529
  '- Current repo evidence, current user brief, and live research override active-memory when they conflict.',
527
530
  '',
528
531
  'Host compatibility scope:',
@@ -136,6 +136,7 @@ function buildDesignIntentContractObject({
136
136
  conceptualAnchor: {
137
137
  mode: 'required-when-no-external-research',
138
138
  seedMode: 'selection-policy-only',
139
+ anchorReference: 'agent-defined-anchor-reference',
139
140
  requiresAgentSelectionBeforeUiImplementation: true,
140
141
  userResearchAbsencePolicy: {
141
142
  userSuppliedResearchOnly: true,
@@ -152,6 +153,17 @@ function buildDesignIntentContractObject({
152
153
  doNotRevealHiddenCandidateList: true,
153
154
  outputOnlyChosenAnchor: true,
154
155
  },
156
+ creativeCommitmentPolicy: {
157
+ requiredBeforeComplianceReview: true,
158
+ recordInDesignDocs: true,
159
+ requiredCommitmentFields: [
160
+ 'specificReferencePoint',
161
+ 'signatureMotion',
162
+ 'typographicDecision',
163
+ ],
164
+ rejectGenericQualityWordsOnly: true,
165
+ specificityFloor: 'name-a-real-material-instrument-artifact-architecture-editorial-genre-cinematic-behavior-exhibition-system-scientific-apparatus-or-industrial-mechanism',
166
+ },
155
167
  forbiddenFinalAnchorTerms: [
156
168
  'dashboard',
157
169
  'cards',
@@ -182,9 +194,13 @@ function buildDesignIntentContractObject({
182
194
  finalAnchorContract: {
183
195
  requiredFields: [
184
196
  'name',
197
+ 'anchorReference',
185
198
  'agentResearchMode',
186
199
  'sourceDomain',
200
+ 'specificReferencePoint',
187
201
  'rationale',
202
+ 'signatureMotion',
203
+ 'typographicDecision',
188
204
  'derivedTokenLogic',
189
205
  'visualRiskBudget',
190
206
  'motionRiskBudget',
@@ -200,6 +216,25 @@ function buildDesignIntentContractObject({
200
216
  ],
201
217
  },
202
218
  },
219
+ derivedTokenLogic: {
220
+ anchorReference: 'agent-defined-anchor-reference',
221
+ colorDerivationSource: 'Agent must explain how semantic color roles derive from the chosen anchorReference; default blue or generic SaaS palettes are invalid without anchor evidence.',
222
+ spacingDerivationSource: 'Agent must explain how base grid, rhythm, density, and spacing exceptions derive from the chosen anchorReference.',
223
+ typographyDerivationSource: 'Agent must explain how display, body, metadata, and data typography roles derive from the chosen anchorReference.',
224
+ motionDerivationSource: 'Agent must explain how duration, easing, choreography, and reduced-motion alternatives derive from the chosen anchorReference.',
225
+ validationRule: 'Every primitive, semantic, component, typography, spacing, and motion token must trace back to anchorReference; if a token cannot be explained from the anchor, revise the token.',
226
+ },
227
+ libraryResearchStatus: 'pending-verification',
228
+ libraryDecisions: [
229
+ {
230
+ library: 'agent-defined-or-none',
231
+ purpose: 'Agent must verify any UI, animation, scroll, 3D, canvas, chart, icon, or styling library against current official docs before implementation.',
232
+ verifiedAt: null,
233
+ sourceUrl: null,
234
+ stableVersion: null,
235
+ fallbackIfUnavailable: 'Use native CSS, browser APIs, or existing project dependencies until live verification is available.',
236
+ },
237
+ ],
203
238
  mathSystems: {
204
239
  typographyScaleRatio: inferredKeywords.typographyScaleRatio,
205
240
  baseGridUnit: inferredKeywords.baseGridUnit,
@@ -288,6 +323,7 @@ function buildDesignIntentContractObject({
288
323
  requireContentPriorityMap: true,
289
324
  requireTaskFlowNarrative: true,
290
325
  requireSignatureMoveRationale: true,
326
+ requireCreativeCommitmentGate: true,
291
327
  requireStructuredHandoff: true,
292
328
  requireRepoEvidenceAlignment: true,
293
329
  forbidScreenshotDependency: true,
@@ -406,6 +442,15 @@ function buildDesignIntentContractObject({
406
442
  requiredResetAxes: ['composition', 'hierarchy', 'motion-or-interaction', 'responsive-information-architecture'],
407
443
  },
408
444
  signatureMoveRationale: 'Agent must choose one project-specific visual, motion, typographic, or interaction move and explain why generic fallback weakens it.',
445
+ creativeCommitment: {
446
+ status: 'agent-must-complete-before-ui-implementation',
447
+ requiredFields: [
448
+ 'specificReferencePoint',
449
+ 'signatureMotion',
450
+ 'typographicDecision',
451
+ ],
452
+ failureMode: 'generic quality words without a named real-world reference are not enough',
453
+ },
409
454
  implementationGuardrails: {
410
455
  requireBuildFromHandoff: true,
411
456
  requireGapNotesBeforeFallback: true,
@@ -557,6 +602,81 @@ function buildDesignIntentContractObject({
557
602
  };
558
603
  }
559
604
 
605
+ function hasNonEmptyString(value) {
606
+ return typeof value === 'string' && value.trim().length > 0;
607
+ }
608
+
609
+ export function validateDesignContractCompleteness(designIntentContract) {
610
+ const validationIssues = [];
611
+ const conceptualAnchor = designIntentContract?.conceptualAnchor;
612
+ const derivedTokenLogic = designIntentContract?.derivedTokenLogic;
613
+ const libraryDecisions = designIntentContract?.libraryDecisions;
614
+
615
+ const anchorReference = conceptualAnchor?.anchorReference || derivedTokenLogic?.anchorReference;
616
+ if (!hasNonEmptyString(anchorReference)) {
617
+ validationIssues.push('designIntent.conceptualAnchor.anchorReference must be a stable non-empty ID for deterministic validation.');
618
+ }
619
+
620
+ if (!derivedTokenLogic || typeof derivedTokenLogic !== 'object') {
621
+ validationIssues.push('designIntent.derivedTokenLogic must exist.');
622
+ } else {
623
+ if (derivedTokenLogic.anchorReference !== anchorReference) {
624
+ validationIssues.push('designIntent.derivedTokenLogic.anchorReference must exactly match designIntent.conceptualAnchor.anchorReference.');
625
+ }
626
+
627
+ for (const requiredFieldName of [
628
+ 'colorDerivationSource',
629
+ 'spacingDerivationSource',
630
+ 'typographyDerivationSource',
631
+ 'motionDerivationSource',
632
+ 'validationRule',
633
+ ]) {
634
+ if (!hasNonEmptyString(derivedTokenLogic[requiredFieldName])) {
635
+ validationIssues.push(`designIntent.derivedTokenLogic.${requiredFieldName} must be a non-empty string.`);
636
+ }
637
+ }
638
+
639
+ if (
640
+ hasNonEmptyString(derivedTokenLogic.validationRule)
641
+ && !derivedTokenLogic.validationRule.includes('anchorReference')
642
+ ) {
643
+ validationIssues.push('designIntent.derivedTokenLogic.validationRule must require traceability to anchorReference.');
644
+ }
645
+ }
646
+
647
+ if (!['verified', 'pending-verification', 'no-external-library-needed'].includes(designIntentContract?.libraryResearchStatus)) {
648
+ validationIssues.push('designIntent.libraryResearchStatus must be verified, pending-verification, or no-external-library-needed.');
649
+ }
650
+
651
+ if (!Array.isArray(libraryDecisions)) {
652
+ validationIssues.push('designIntent.libraryDecisions must be an array.');
653
+ } else {
654
+ for (const [libraryIndex, libraryDecision] of libraryDecisions.entries()) {
655
+ if (!libraryDecision || typeof libraryDecision !== 'object') {
656
+ validationIssues.push(`designIntent.libraryDecisions[${libraryIndex}] must be an object.`);
657
+ continue;
658
+ }
659
+
660
+ if (!hasNonEmptyString(libraryDecision.library)) {
661
+ validationIssues.push(`designIntent.libraryDecisions[${libraryIndex}].library must be a non-empty string.`);
662
+ }
663
+ if (!hasNonEmptyString(libraryDecision.purpose)) {
664
+ validationIssues.push(`designIntent.libraryDecisions[${libraryIndex}].purpose must be a non-empty string.`);
665
+ }
666
+
667
+ const hasVerification = hasNonEmptyString(libraryDecision.verifiedAt)
668
+ && hasNonEmptyString(libraryDecision.sourceUrl);
669
+ const hasFallback = hasNonEmptyString(libraryDecision.fallbackIfUnavailable);
670
+
671
+ if (!hasVerification && !hasFallback) {
672
+ validationIssues.push(`designIntent.libraryDecisions[${libraryIndex}] must either record verification source or provide fallbackIfUnavailable.`);
673
+ }
674
+ }
675
+ }
676
+
677
+ return validationIssues;
678
+ }
679
+
560
680
  export function validateDesignIntentContract(designIntentContract) {
561
681
  const validationErrors = [];
562
682
 
@@ -564,6 +684,8 @@ export function validateDesignIntentContract(designIntentContract) {
564
684
  return ['Design intent contract must be an object.'];
565
685
  }
566
686
 
687
+ validationErrors.push(...validateDesignContractCompleteness(designIntentContract));
688
+
567
689
  if (designIntentContract.mode !== 'dynamic') {
568
690
  validationErrors.push('designIntent.mode must equal "dynamic".');
569
691
  }
@@ -606,6 +728,9 @@ export function validateDesignIntentContract(designIntentContract) {
606
728
  if (conceptualAnchor.requiresAgentSelectionBeforeUiImplementation !== true) {
607
729
  validationErrors.push('designIntent.conceptualAnchor.requiresAgentSelectionBeforeUiImplementation must equal true.');
608
730
  }
731
+ if (!hasNonEmptyString(conceptualAnchor.anchorReference)) {
732
+ validationErrors.push('designIntent.conceptualAnchor.anchorReference must be a stable non-empty ID.');
733
+ }
609
734
  const userResearchAbsencePolicy = conceptualAnchor.userResearchAbsencePolicy;
610
735
  if (!userResearchAbsencePolicy || typeof userResearchAbsencePolicy !== 'object') {
611
736
  validationErrors.push('designIntent.conceptualAnchor.userResearchAbsencePolicy must exist.');
@@ -649,6 +774,28 @@ export function validateDesignIntentContract(designIntentContract) {
649
774
  validationErrors.push('designIntent.conceptualAnchor.candidateSelectionPolicy.outputOnlyChosenAnchor must equal true.');
650
775
  }
651
776
  }
777
+ const creativeCommitmentPolicy = conceptualAnchor.creativeCommitmentPolicy;
778
+ if (!creativeCommitmentPolicy || typeof creativeCommitmentPolicy !== 'object') {
779
+ validationErrors.push('designIntent.conceptualAnchor.creativeCommitmentPolicy must exist.');
780
+ } else {
781
+ if (creativeCommitmentPolicy.requiredBeforeComplianceReview !== true) {
782
+ validationErrors.push('designIntent.conceptualAnchor.creativeCommitmentPolicy.requiredBeforeComplianceReview must equal true.');
783
+ }
784
+ if (creativeCommitmentPolicy.recordInDesignDocs !== true) {
785
+ validationErrors.push('designIntent.conceptualAnchor.creativeCommitmentPolicy.recordInDesignDocs must equal true.');
786
+ }
787
+ if (
788
+ !Array.isArray(creativeCommitmentPolicy.requiredCommitmentFields)
789
+ || !creativeCommitmentPolicy.requiredCommitmentFields.includes('specificReferencePoint')
790
+ || !creativeCommitmentPolicy.requiredCommitmentFields.includes('signatureMotion')
791
+ || !creativeCommitmentPolicy.requiredCommitmentFields.includes('typographicDecision')
792
+ ) {
793
+ validationErrors.push('designIntent.conceptualAnchor.creativeCommitmentPolicy.requiredCommitmentFields must include specificReferencePoint, signatureMotion, and typographicDecision.');
794
+ }
795
+ if (creativeCommitmentPolicy.rejectGenericQualityWordsOnly !== true) {
796
+ validationErrors.push('designIntent.conceptualAnchor.creativeCommitmentPolicy.rejectGenericQualityWordsOnly must equal true.');
797
+ }
798
+ }
652
799
  if (
653
800
  !Array.isArray(conceptualAnchor.forbiddenFinalAnchorTerms)
654
801
  || !conceptualAnchor.forbiddenFinalAnchorTerms.includes('dashboard')
@@ -696,13 +843,17 @@ export function validateDesignIntentContract(designIntentContract) {
696
843
  } else {
697
844
  if (
698
845
  !Array.isArray(finalAnchorContract.requiredFields)
846
+ || !finalAnchorContract.requiredFields.includes('anchorReference')
699
847
  || !finalAnchorContract.requiredFields.includes('agentResearchMode')
848
+ || !finalAnchorContract.requiredFields.includes('specificReferencePoint')
849
+ || !finalAnchorContract.requiredFields.includes('signatureMotion')
850
+ || !finalAnchorContract.requiredFields.includes('typographicDecision')
700
851
  || !finalAnchorContract.requiredFields.includes('derivedTokenLogic')
701
852
  || !finalAnchorContract.requiredFields.includes('visualRiskBudget')
702
853
  || !finalAnchorContract.requiredFields.includes('motionRiskBudget')
703
854
  || !finalAnchorContract.requiredFields.includes('cohesionChecks')
704
855
  ) {
705
- validationErrors.push('designIntent.conceptualAnchor.finalAnchorContract.requiredFields must require agentResearchMode, derivedTokenLogic, visualRiskBudget, motionRiskBudget, and cohesionChecks.');
856
+ validationErrors.push('designIntent.conceptualAnchor.finalAnchorContract.requiredFields must require anchorReference, agentResearchMode, specificReferencePoint, signatureMotion, typographicDecision, derivedTokenLogic, visualRiskBudget, motionRiskBudget, and cohesionChecks.');
706
857
  }
707
858
  if (
708
859
  !Array.isArray(finalAnchorContract.derivedTokenLogicAxes)
@@ -944,6 +1095,7 @@ export function validateDesignIntentContract(designIntentContract) {
944
1095
  'requireContentPriorityMap',
945
1096
  'requireTaskFlowNarrative',
946
1097
  'requireSignatureMoveRationale',
1098
+ 'requireCreativeCommitmentGate',
947
1099
  'requireStructuredHandoff',
948
1100
  'requireRepoEvidenceAlignment',
949
1101
  'forbidScreenshotDependency',
@@ -1038,6 +1190,25 @@ export function validateDesignIntentContract(designIntentContract) {
1038
1190
  if (!String(designIntentContract.designExecutionHandoff.signatureMoveRationale || '').trim()) {
1039
1191
  validationErrors.push('designIntent.designExecutionHandoff.signatureMoveRationale must explain the chosen authored move.');
1040
1192
  }
1193
+ const creativeCommitment = designIntentContract.designExecutionHandoff.creativeCommitment;
1194
+ if (!creativeCommitment || typeof creativeCommitment !== 'object') {
1195
+ validationErrors.push('designIntent.designExecutionHandoff.creativeCommitment must exist.');
1196
+ } else {
1197
+ if (creativeCommitment.status !== 'agent-must-complete-before-ui-implementation') {
1198
+ validationErrors.push('designIntent.designExecutionHandoff.creativeCommitment.status must equal "agent-must-complete-before-ui-implementation".');
1199
+ }
1200
+ if (
1201
+ !Array.isArray(creativeCommitment.requiredFields)
1202
+ || !creativeCommitment.requiredFields.includes('specificReferencePoint')
1203
+ || !creativeCommitment.requiredFields.includes('signatureMotion')
1204
+ || !creativeCommitment.requiredFields.includes('typographicDecision')
1205
+ ) {
1206
+ validationErrors.push('designIntent.designExecutionHandoff.creativeCommitment.requiredFields must include specificReferencePoint, signatureMotion, and typographicDecision.');
1207
+ }
1208
+ if (!hasNonEmptyString(creativeCommitment.failureMode)) {
1209
+ validationErrors.push('designIntent.designExecutionHandoff.creativeCommitment.failureMode must be a non-empty string.');
1210
+ }
1211
+ }
1041
1212
  const implementationGuardrails = designIntentContract.designExecutionHandoff.implementationGuardrails;
1042
1213
  if (!implementationGuardrails || typeof implementationGuardrails !== 'object') {
1043
1214
  validationErrors.push('designIntent.designExecutionHandoff.implementationGuardrails must exist.');
@@ -125,23 +125,26 @@ export function buildDesignBootstrapPrompt({
125
125
  '5. brandAdjectives',
126
126
  '6. antiAdjectives',
127
127
  '7. visualDirection',
128
- '8. mathSystems',
129
- '9. tokenSystem',
130
- '10. colorTruth',
131
- '11. crossViewportAdaptation',
132
- '12. motionSystem',
133
- '13. componentMorphology',
134
- '14. accessibilityPolicy',
135
- '15. designExecutionPolicy',
136
- '16. designExecutionHandoff',
137
- '17. reviewRubric',
138
- '18. contextHygiene',
139
- '19. experiencePrinciples',
140
- '20. forbiddenPatterns',
141
- '21. validationHints',
142
- '22. requiredDesignSections',
143
- '23. implementation',
144
- '24. repoEvidence when onboarding or detector evidence exists',
128
+ '8. derivedTokenLogic',
129
+ '9. libraryResearchStatus',
130
+ '10. libraryDecisions',
131
+ '11. mathSystems',
132
+ '12. tokenSystem',
133
+ '13. colorTruth',
134
+ '14. crossViewportAdaptation',
135
+ '15. motionSystem',
136
+ '16. componentMorphology',
137
+ '17. accessibilityPolicy',
138
+ '18. designExecutionPolicy',
139
+ '19. designExecutionHandoff',
140
+ '20. reviewRubric',
141
+ '21. contextHygiene',
142
+ '22. experiencePrinciples',
143
+ '23. forbiddenPatterns',
144
+ '24. validationHints',
145
+ '25. requiredDesignSections',
146
+ '26. implementation',
147
+ '27. repoEvidence when onboarding or detector evidence exists',
145
148
  '',
146
149
  '## Hard Rules',
147
150
  '1. No copy-paste from external style guides.',
@@ -177,8 +180,22 @@ export function buildDesignBootstrapPrompt({
177
180
  '31. If modern UI, animation, scroll, 3D, canvas, chart, or icon libraries are useful, choose them from current official docs and record source URL, fetched date, reason, risk, and accessibility fallback.',
178
181
  '32. If the user supplies research files, library lists, screenshots, articles, or benchmark notes, read them as candidate evidence, summarize the useful signals, filter by project fit, and verify technology claims against current official docs before implementation.',
179
182
  '33. If no user-supplied research or reference is supplied for UI work, activate the Dynamic Avant-Garde Anchor Engine before coding. User-supplied research means current-task evidence from the user; this scaffold, prior UI, and old design docs do not count as research.',
180
- '34. In Dynamic Avant-Garde mode, perform agent-led research when available, then internally consider at least three high-variance conceptual anchors, discard the two safest or most predictable options, output only the chosen anchor and rationale, and forbid final anchors named dashboard, portal, cards, admin panel, SaaS shell, web app shell, or minimalist interface.',
181
- '35. The chosen anchor must drive typography, spacing, density, color behavior, morphology, motion, and responsive composition. Treat expressive motion, spatial transitions, micro-interactions, and modern animation libraries as first-class options; include performance notes and reduced-motion fallbacks instead of suppressing motion to look safe.',
183
+ '34. Before broad compliance review, make a creative commitment and record it in the design contract: one specific real-world anchor reference, one signature motion behavior more specific than smooth transitions, and one typographic decision with meaningful role contrast.',
184
+ '35. In Dynamic Avant-Garde mode, perform agent-led research when available, then internally consider at least three high-variance conceptual anchors, discard the two safest or most predictable options, output only the chosen anchor, its specific reference point, and rationale, and forbid final anchors named dashboard, portal, cards, admin panel, SaaS shell, web app shell, or minimalist interface.',
185
+ '36. Reject anchors that can only be described with generic quality words such as modern, clean, premium, expressive, minimal, or bold. The anchor must name a material, instrument, artifact class, architecture, editorial genre, cinematic behavior, exhibition system, scientific apparatus, or industrial mechanism.',
186
+ '37. The chosen anchor must define a stable conceptualAnchor.anchorReference. derivedTokenLogic.anchorReference must match it exactly so validation does not depend on paraphrased prose.',
187
+ '38. Fill derivedTokenLogic with color, spacing, typography, and motion derivation sources before UI implementation. If a token cannot be explained from anchorReference, revise the token.',
188
+ '39. If live web research is unavailable or fails, do not hallucinate dependency APIs, package names, versions, or imports. Set libraryResearchStatus to pending-verification, record LIBRARY_TO_VERIFY notes, and use native CSS, browser APIs, or already-present project dependencies until verification is possible.',
189
+ '40. Every libraryDecisions entry must either include current official-doc verification metadata or a fallbackIfUnavailable. Do not import a new library without verification or an accepted blocker.',
190
+ '41. The chosen anchor must drive typography, spacing, density, color behavior, morphology, motion, and responsive composition. Treat expressive motion, spatial transitions, micro-interactions, and modern animation libraries as first-class options; include performance notes and reduced-motion fallbacks instead of suppressing motion to look safe.',
191
+ '',
192
+ '## Token Derivation Audit',
193
+ 'Before implementation, docs/design-intent.json must include derivedTokenLogic.anchorReference plus colorDerivationSource, spacingDerivationSource, typographyDerivationSource, motionDerivationSource, and validationRule.',
194
+ 'Every token must be explainable from anchorReference. If the rationale is only looks good, common practice, modern default, or framework default, derive the token again before UI code.',
195
+ '',
196
+ '## Library Research Protocol',
197
+ 'If web search is available, verify every new UI, animation, scroll, 3D, canvas, chart, icon, styling, or primitive library against current official docs and record source URL, fetched date, stable compatible version, purpose, risk, and fallback.',
198
+ 'If web search is unavailable or fails, set libraryResearchStatus to pending-verification, record LIBRARY_TO_VERIFY notes, and use native CSS, browser APIs, or already-present project dependencies until verification is possible.',
182
199
  '',
183
200
  '## Project Inputs',
184
201
  `- Project name: ${discoveryAnswers.projectName}`,
@@ -209,8 +226,9 @@ export function buildDesignBootstrapPrompt({
209
226
  '12. Keep visualResetStrategy in the machine-readable handoff so reset-language tasks cannot quietly become restyles of the previous UI.',
210
227
  '13. Preserve externalResearchIntake so user-provided research becomes reviewed evidence without turning into an offline style or dependency preset.',
211
228
  '14. Preserve conceptualAnchor so prompt-only UI work has one cohesive non-template concept instead of a mixed collection of bold but unrelated visual decisions.',
212
- '15. Record conceptualAnchor.agentResearchMode, visualRiskBudget, motionRiskBudget, and cohesionChecks so the final UI cannot quietly fall back to a timid dashboard/admin mental model.',
213
- '16. After the contract exists, use it as a first-class source for future UI tasks.',
229
+ '15. Record conceptualAnchor.agentResearchMode, specificReferencePoint, signatureMotion, typographicDecision, visualRiskBudget, motionRiskBudget, and cohesionChecks so the final UI cannot quietly fall back to a timid dashboard/admin mental model.',
230
+ '16. Preserve derivedTokenLogic, libraryResearchStatus, and libraryDecisions so token choices and dependency uncertainty stay visible before implementation.',
231
+ '17. After the contract exists, use it as a first-class source for future UI tasks.',
214
232
  '',
215
233
  ].join('\n');
216
234
  }
@@ -22,6 +22,7 @@ export {
22
22
  export {
23
23
  shouldBootstrapDesignDocument,
24
24
  validateDesignIntentContract,
25
+ validateDesignContractCompleteness,
25
26
  buildDesignIntentSeedFromSignals,
26
27
  } from './project-scaffolder/design-contract.mjs';
27
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryuenn3123/agentic-senior-core",
3
- "version": "3.0.27",
3
+ "version": "3.0.29",
4
4
  "type": "module",
5
5
  "description": "Force your AI Agent to code like a Staff Engineer, not a Junior.",
6
6
  "bin": {
@@ -15,6 +15,10 @@ import {
15
15
  VERSION_PATTERN,
16
16
  } from './constants.mjs';
17
17
  import { pushResult, readText } from './runtime.mjs';
18
+ import {
19
+ buildDesignIntentSeedFromSignals,
20
+ validateDesignContractCompleteness,
21
+ } from '../../lib/cli/project-scaffolder.mjs';
18
22
 
19
23
  export function runStaticReleaseChecks(results, diagnostics) {
20
24
  const packageJsonPath = 'package.json';
@@ -66,6 +70,34 @@ export function runStaticReleaseChecks(results, diagnostics) {
66
70
  pushResult(results, true, 'roadmap-v18', 'Roadmap includes V1.8 release track');
67
71
  }
68
72
 
73
+ try {
74
+ const designIntentSeed = JSON.parse(buildDesignIntentSeedFromSignals({
75
+ projectName: 'Release Gate UI Contract',
76
+ projectDescription: 'Validates deterministic UI design contract completeness before release',
77
+ primaryDomain: 'Web application',
78
+ initContext: {
79
+ stackFileName: 'agent-decision-runtime.md',
80
+ blueprintFileName: 'agent-decision-architecture.md',
81
+ },
82
+ status: 'release-gate-seed-validation',
83
+ }));
84
+ const designContractIssues = validateDesignContractCompleteness(designIntentSeed);
85
+
86
+ if (designContractIssues.length === 0) {
87
+ pushResult(results, true, 'ui-design-contract-completeness', 'Design intent seed includes deterministic token derivation and library verification gates');
88
+ } else {
89
+ pushResult(
90
+ results,
91
+ false,
92
+ 'ui-design-contract-completeness',
93
+ `Design intent seed completeness issues: ${designContractIssues.join('; ')}`
94
+ );
95
+ }
96
+ } catch (designContractError) {
97
+ const designContractMessage = designContractError instanceof Error ? designContractError.message : 'Unknown design contract error';
98
+ pushResult(results, false, 'ui-design-contract-completeness', `Cannot validate design intent seed: ${designContractMessage}`);
99
+ }
100
+
69
101
  const requiredOperationsFiles = [
70
102
  '.agent-context/review-checklists/architecture-review.md',
71
103
  'docs/v1.8-operations-playbook.md',