@ryuenn3123/agentic-senior-core 3.0.25 → 3.0.26

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.
@@ -41,7 +41,7 @@ The final anchor must come from broad non-template domains such as complex physi
41
41
 
42
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.
43
43
 
44
- Motion is not a garnish. The agent may use rich animation, fluid transitions, spatial reveals, scroll choreography, micro-interactions, and modern motion libraries when they support the anchor, remain performant, and include reduced-motion fallbacks. Do not suppress motion merely to look safe.
44
+ 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
45
 
46
46
  ## Zero-Based Redesign Protocol
47
47
 
@@ -62,7 +62,7 @@ The UI must feel authored by a strong UI/UX designer, not assembled from default
62
62
  Do:
63
63
  - Synthesize a visual direction from the project context and explain why it fits.
64
64
  - Choose color, typography, spacing, motion, density, and component morphology dynamically from the product and audience.
65
- - Use modern, expressive interaction when it improves hierarchy, feedback, delight, confidence, or memorability.
65
+ - Use modern, expressive interaction and motion as part of the core design language, especially when it improves hierarchy, feedback, delight, confidence, or memorability.
66
66
  - Keep frontend code clean, componentized, accessible, and easy to maintain.
67
67
  - Use tokens and semantic aliases so future changes do not require rewriting components.
68
68
  - Make design decisions explicit before coding, then implement consistently.
@@ -65,7 +65,7 @@ Run this before declaring a task done. Apply only the sections relevant to the c
65
65
  - [ ] Visual direction is project-specific and not a template/default component-kit habit.
66
66
  - [ ] Responsive behavior recomposes content and priority, not only shrinking desktop layout.
67
67
  - [ ] Accessibility hard requirements are preserved: keyboard access, focus visibility, contrast, target size, status feedback, and no color-only meaning.
68
- - [ ] Motion is purposeful, reduced-motion-safe, and justified by product value.
68
+ - [ ] Motion is treated as part of the design language for modern UI work, with reduced-motion and performance safeguards instead of defaulting to static screens.
69
69
 
70
70
  ## 8. Dependencies And Runtime
71
71
 
@@ -58,7 +58,7 @@ Do not use this file to teach generic frontend basics the model already knows.
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
59
  - Internally reject the safest dashboard, portal, card-grid, admin-shell, or minimalist-web-app mental model before writing CSS.
60
60
  - Typography, spacing, morphology, motion, and responsive recomposition must derive from the chosen anchor, not from framework defaults.
61
- - Rich motion, spatial transitions, and micro-interactions are allowed when they support the anchor and include reduced-motion and performance safeguards.
61
+ - 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
62
 
63
63
  ## Responsive Mutation Requirements
64
64
 
@@ -72,7 +72,7 @@ Do not use this file to teach generic frontend basics the model already knows.
72
72
  - Define the primary user task or reading path from current evidence before arranging surfaces.
73
73
  - Supporting surfaces must earn their placement through role, priority, or behavior. They must not feel like cloned modules.
74
74
  - Component states must preserve identity under hover, focus, loading, success, empty, and error. Do not let everything collapse into anonymous rounded panels.
75
- - Motion may be expressive, but it must strengthen hierarchy, feedback, or memorability while staying reduced-motion-safe and performant.
75
+ - Motion should be expressive by default for modern UI work. Make it strengthen hierarchy, feedback, or memorability, then keep it reduced-motion-safe and performant.
76
76
 
77
77
  ## Implementation Boundaries
78
78
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-04-24T17:20:37.769Z",
2
+ "generatedAt": "2026-04-25T03:25:49.150Z",
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.25
3
+ Generated by Agentic-Senior-Core CLI v3.0.26
4
4
  Timestamp: 2026-04-24T06:02:48.303Z
5
5
  Selected policy file: .agent-context/policies/llm-judge-threshold.json
6
6
 
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.25
3
+ Generated by Agentic-Senior-Core CLI v3.0.26
4
4
  Timestamp: 2026-04-24T06:02:48.303Z
5
5
  Selected policy file: .agent-context/policies/llm-judge-threshold.json
6
6
 
package/README.md CHANGED
@@ -10,13 +10,14 @@
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.25 (2026-04-25).
13
+ Latest release: 3.0.26 (2026-04-25).
14
14
 
15
- Highlights in 3.0.25:
16
- - UI design bootstrap now forces a dynamic conceptual anchor when no current-task visual research is provided.
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.
17
19
  - Agents must use live/current-year research for ecosystem, framework, dependency, Docker, and modern UI/library claims instead of offline repository guesses.
18
- - Frontend guidance now rejects safe dashboard/admin-panel defaults, requires responsive recomposition, and allows rich modern motion when it supports the chosen concept.
19
- - Generated design-intent seeds are more compact, leaving the LLM room to synthesize project-specific visual direction instead of inheriting verbose scaffold bias.
20
+ - Frontend guidance rejects safe dashboard/admin-panel defaults and requires responsive recomposition.
20
21
 
21
22
  </div>
22
23
 
@@ -67,6 +67,7 @@ import {
67
67
  } from '../token-optimization.mjs';
68
68
  import {
69
69
  createMemoryContinuityState,
70
+ ensureActiveMemorySnapshot,
70
71
  writeMemoryContinuityState,
71
72
  } from '../memory-continuity.mjs';
72
73
 
@@ -603,6 +604,9 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
603
604
  });
604
605
 
605
606
  await writeMemoryContinuityState(resolvedTargetDirectoryPath, memoryContinuityState);
607
+ await ensureActiveMemorySnapshot(resolvedTargetDirectoryPath, {
608
+ projectName: path.basename(resolvedTargetDirectoryPath),
609
+ });
606
610
  console.log(`Project memory continuity metadata enabled (${memoryContinuityState.hydrationMode}, host-supported).`);
607
611
  }
608
612
 
@@ -748,6 +752,7 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
748
752
  hydrationMode: memoryContinuityState?.hydrationMode || null,
749
753
  adapters: memoryContinuityState?.adapters || [],
750
754
  stateFile: isMemoryContinuityEnabled ? '.agent-context/state/memory-continuity.json' : null,
755
+ activeSnapshotFile: isMemoryContinuityEnabled ? '.agent-context/state/active-memory.json' : null,
751
756
  },
752
757
  detectionTransparency,
753
758
  uiScopeSignals: existingProjectUiScopeSignals,
@@ -47,6 +47,7 @@ import {
47
47
  detectProjectDocTemplateStaleness,
48
48
  buildDesignIntentSeedFromSignals,
49
49
  } from '../project-scaffolder.mjs';
50
+ import { ensureActiveMemorySnapshot } from '../memory-continuity.mjs';
50
51
 
51
52
  export function parseUpgradeArguments(commandArguments) {
52
53
  const parsedUpgradeOptions = {
@@ -401,6 +402,7 @@ export async function runUpgradeCommand(targetDirectoryArgument, upgradeOptions
401
402
  managedSurfacePlan,
402
403
  });
403
404
  const supplementalCreatedFileNames = [];
405
+ const shouldEnsureActiveMemorySnapshot = existingOnboardingReport?.memoryContinuity?.enabled !== false;
404
406
 
405
407
  if (shouldSeedDesignIntentOnApply && designIntentSeedContent) {
406
408
  const docsDirectoryPath = path.join(resolvedTargetDirectoryPath, 'docs');
@@ -410,6 +412,16 @@ export async function runUpgradeCommand(targetDirectoryArgument, upgradeOptions
410
412
  supplementalCreatedFileNames.push('docs/design-intent.json');
411
413
  }
412
414
 
415
+ if (shouldEnsureActiveMemorySnapshot) {
416
+ const activeMemoryResult = await ensureActiveMemorySnapshot(resolvedTargetDirectoryPath, {
417
+ projectName: packageManifest?.name || path.basename(resolvedTargetDirectoryPath),
418
+ });
419
+
420
+ if (activeMemoryResult.created) {
421
+ supplementalCreatedFileNames.push('.agent-context/state/active-memory.json');
422
+ }
423
+ }
424
+
413
425
  await compileDynamicContext({
414
426
  targetDirectoryPath: resolvedTargetDirectoryPath,
415
427
  selectedStackFileName,
@@ -36,8 +36,10 @@ const INLINE_SENSITIVE_PATTERNS = [
36
36
 
37
37
  export const MEMORY_SCHEMA_VERSION = '1.0.0';
38
38
  export const MEMORY_CONTINUITY_STATE_FILE_NAME = 'memory-continuity.json';
39
+ export const ACTIVE_MEMORY_STATE_FILE_NAME = 'active-memory.json';
39
40
 
40
41
  const MEMORY_CONTINUITY_STATE_SCHEMA_VERSION = 'memory-continuity-v1';
42
+ const ACTIVE_MEMORY_STATE_SCHEMA_VERSION = 'active-memory-v1';
41
43
 
42
44
  export const SUPPORTED_MEMORY_ADAPTER_IDS = Object.freeze([
43
45
  'claude-code',
@@ -359,6 +361,138 @@ export async function writeMemoryContinuityState(targetDirectoryPath, memoryCont
359
361
  await fs.writeFile(stateFilePath, JSON.stringify(memoryContinuityState, null, 2) + '\n', 'utf8');
360
362
  }
361
363
 
364
+ export function createActiveMemorySnapshot(options = {}) {
365
+ return {
366
+ schemaVersion: ACTIVE_MEMORY_STATE_SCHEMA_VERSION,
367
+ snapshotPurpose: 'compact-cross-session-continuity',
368
+ updatePolicy: {
369
+ writeWhen: 'natural-task-boundary',
370
+ overwriteOnlyWithCurrentRepoEvidence: true,
371
+ preserveUserOwnedContent: true,
372
+ },
373
+ project: {
374
+ name: toNonEmptyString(options.projectName, ''),
375
+ currentFocus: '',
376
+ durableFacts: [],
377
+ },
378
+ progress: {
379
+ lastAchievements: [],
380
+ pendingIssues: [],
381
+ nextBestActions: [],
382
+ validationState: [],
383
+ },
384
+ designContinuity: {
385
+ visualLanguageContinuity: 'opt-in-only',
386
+ currentConceptualAnchor: '',
387
+ forbiddenCarryover: [
388
+ 'prior-project-style-memory',
389
+ 'old-ui-visual-dna-without-user-approval',
390
+ 'generic-dashboard-defaults',
391
+ ],
392
+ },
393
+ privacy: {
394
+ storeSecrets: false,
395
+ storeRawChatLogs: false,
396
+ redactSensitiveTextBeforeWriting: true,
397
+ },
398
+ generatedAt: new Date().toISOString(),
399
+ lastUpdatedAt: null,
400
+ };
401
+ }
402
+
403
+ export function validateActiveMemorySnapshot(activeMemorySnapshot) {
404
+ const validationErrors = [];
405
+
406
+ if (!activeMemorySnapshot || typeof activeMemorySnapshot !== 'object') {
407
+ return ['active-memory snapshot must be an object.'];
408
+ }
409
+
410
+ if (activeMemorySnapshot.schemaVersion !== ACTIVE_MEMORY_STATE_SCHEMA_VERSION) {
411
+ validationErrors.push(`active-memory.schemaVersion must equal "${ACTIVE_MEMORY_STATE_SCHEMA_VERSION}".`);
412
+ }
413
+
414
+ if (activeMemorySnapshot.snapshotPurpose !== 'compact-cross-session-continuity') {
415
+ validationErrors.push('active-memory.snapshotPurpose must equal "compact-cross-session-continuity".');
416
+ }
417
+
418
+ const serializedSnapshot = JSON.stringify(activeMemorySnapshot);
419
+ if (estimateTokenUsage(serializedSnapshot) > 3000) {
420
+ validationErrors.push('active-memory snapshot must stay compact enough for session-start hydration.');
421
+ }
422
+
423
+ const redactionProbe = redactSensitiveMemoryText(serializedSnapshot);
424
+ if (redactionProbe.wasRedacted) {
425
+ validationErrors.push('active-memory snapshot must not contain secret-like fields, bearer tokens, or private blocks.');
426
+ }
427
+
428
+ if (activeMemorySnapshot.privacy?.storeSecrets !== false) {
429
+ validationErrors.push('active-memory.privacy.storeSecrets must equal false.');
430
+ }
431
+
432
+ if (activeMemorySnapshot.privacy?.storeRawChatLogs !== false) {
433
+ validationErrors.push('active-memory.privacy.storeRawChatLogs must equal false.');
434
+ }
435
+
436
+ if (activeMemorySnapshot.privacy?.redactSensitiveTextBeforeWriting !== true) {
437
+ validationErrors.push('active-memory.privacy.redactSensitiveTextBeforeWriting must equal true.');
438
+ }
439
+
440
+ for (const arrayPath of [
441
+ ['project', 'durableFacts'],
442
+ ['progress', 'lastAchievements'],
443
+ ['progress', 'pendingIssues'],
444
+ ['progress', 'nextBestActions'],
445
+ ['progress', 'validationState'],
446
+ ]) {
447
+ const arrayValue = arrayPath.reduce((currentValue, pathSegment) => currentValue?.[pathSegment], activeMemorySnapshot);
448
+ const pathLabel = `active-memory.${arrayPath.join('.')}`;
449
+ if (!Array.isArray(arrayValue)) {
450
+ validationErrors.push(`${pathLabel} must be an array.`);
451
+ continue;
452
+ }
453
+
454
+ if (arrayValue.length > 12) {
455
+ validationErrors.push(`${pathLabel} must stay compact and contain at most 12 entries.`);
456
+ }
457
+ }
458
+
459
+ if (activeMemorySnapshot.designContinuity?.visualLanguageContinuity !== 'opt-in-only') {
460
+ validationErrors.push('active-memory.designContinuity.visualLanguageContinuity must equal "opt-in-only".');
461
+ }
462
+
463
+ return validationErrors;
464
+ }
465
+
466
+ export async function ensureActiveMemorySnapshot(targetDirectoryPath, options = {}) {
467
+ const stateDirectoryPath = path.join(targetDirectoryPath, '.agent-context', 'state');
468
+ const stateFilePath = path.join(stateDirectoryPath, ACTIVE_MEMORY_STATE_FILE_NAME);
469
+
470
+ if (await pathExists(stateFilePath)) {
471
+ return {
472
+ created: false,
473
+ filePath: stateFilePath,
474
+ };
475
+ }
476
+
477
+ await fs.mkdir(stateDirectoryPath, { recursive: true });
478
+ const activeMemorySnapshot = createActiveMemorySnapshot(options);
479
+ const validationErrors = validateActiveMemorySnapshot(activeMemorySnapshot);
480
+ if (validationErrors.length > 0) {
481
+ throw new Error(`Invalid active memory snapshot seed: ${validationErrors.join(' ')}`);
482
+ }
483
+
484
+ await fs.writeFile(
485
+ stateFilePath,
486
+ JSON.stringify(activeMemorySnapshot, null, 2) + '\n',
487
+ 'utf8'
488
+ );
489
+
490
+ return {
491
+ created: true,
492
+ filePath: stateFilePath,
493
+ };
494
+ }
495
+
362
496
  export function buildMemoryContinuityGuidanceBlock(memoryContinuityState) {
363
497
  if (!memoryContinuityState?.enabled) {
364
498
  return [
@@ -384,9 +518,12 @@ export function buildMemoryContinuityGuidanceBlock(memoryContinuityState) {
384
518
  adapterGuidanceLine,
385
519
  '',
386
520
  'Session-start retrieval policy:',
521
+ '- Read `.agent-context/state/active-memory.json` first when it exists; it is the compact project-focus snapshot.',
387
522
  `- Load compact index first (limit: ${sessionStartIndexLimit} entries).`,
388
523
  `- Hydrate full detail only for highest-value entries (limit: ${fullHydrationLimit}).`,
389
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.',
526
+ '- Current repo evidence, current user brief, and live research override active-memory when they conflict.',
390
527
  '',
391
528
  'Host compatibility scope:',
392
529
  '- This memory layer does not replace reading bootstrap instruction files at the start of a session.',
@@ -60,7 +60,7 @@ function buildStructureFirstSeedSignals({
60
60
  distinctiveMoves: [
61
61
  'Choose one recognizable design move from product task, audience, content, repo evidence, and current docs; do not inherit a scaffold preset.',
62
62
  ],
63
- motionPurpose: 'Use modern motion when it improves hierarchy, continuity, feedback, memorability, or perceived product quality. If implementation needs a motion library, the LLM must choose a current compatible option from official docs instead of relying on an offline default.',
63
+ motionPurpose: 'Default to a modern motion plan for UI work: use expressive transitions, spatial choreography, micro-interactions, and motion libraries when they strengthen hierarchy, continuity, feedback, memorability, or perceived product quality. If implementation needs a motion library, the LLM must choose a current compatible option from official docs instead of relying on an offline default.',
64
64
  componentMorphology: {
65
65
  mobile: 'Recompose the experience for touch, task priority, and constrained attention. Mobile should be a deliberate mobile design, not a shrunken desktop.',
66
66
  tablet: 'Regroup surfaces for medium-width use, preserving task clarity without cloning either desktop or mobile blindly.',
@@ -439,7 +439,7 @@ function buildDesignIntentContractObject({
439
439
  {
440
440
  key: 'motionDiscipline',
441
441
  blockingByDefault: false,
442
- question: 'If motion is present, does it stay purposeful, performant, reduced-motion-safe, and consistent with the product tone?',
442
+ question: 'Does motion act as part of the design language while staying purposeful, performant, reduced-motion-safe, and consistent with the product tone?',
443
443
  },
444
444
  ],
445
445
  genericitySignals: [
@@ -495,7 +495,7 @@ function buildDesignIntentContractObject({
495
495
  'Accessibility, responsiveness, and implementation realism are non-negotiable.',
496
496
  'Cross-viewport behavior must reorganize tasks and navigation, not just scale the desktop layout down.',
497
497
  'A single agent-chosen conceptual anchor must unify typography, spacing, morphology, motion, and responsive composition when user research is absent.',
498
- 'Expressive motion and spatial interaction are allowed when they support the anchor and remain accessible and performant.',
498
+ 'Expressive motion and spatial interaction are expected for modern UI work when they support the anchor; keep them accessible and performant instead of suppressing them by default.',
499
499
  'When the user asks for a zero-based redesign, existing UI becomes content and behavior evidence only; prior visual DNA must be discarded unless explicitly approved.',
500
500
  ],
501
501
  forbiddenPatterns: [
@@ -156,7 +156,7 @@ export function buildDesignBootstrapPrompt({
156
156
  '10. Do not let repeated surfaces, component-kit defaults, or safe typography become the final direction without explicit product rationale.',
157
157
  '11. The LLM must choose color, type, spacing, density, morphology, and motion dynamically from the active project context instead of copying this seed.',
158
158
  '12. Viewport mutation must be operation-based. For each viewport, define the primary mutation operation, required surface actions, and forbidden responsive fallback patterns.',
159
- '13. Motion can be bold, cinematic, or highly expressive when it improves memorability, hierarchy, feedback, or product confidence. If a motion library is needed, research current official docs and select the latest stable compatible option instead of using an offline default. Only reject motion when it harms clarity, accessibility, or runtime performance.',
159
+ '13. Default to a rich motion plan for modern UI work. Motion can be bold, cinematic, spatial, scroll-linked, or highly expressive when it improves memorability, hierarchy, feedback, or product confidence. If a motion library is useful, research current official docs and select the latest stable compatible option instead of using an offline default. Solve clarity, accessibility, and runtime risks without falling back to a static interface by habit.',
160
160
  '14. Define component morphology across interaction states and viewports so cards, forms, nav, and feedback surfaces adapt coherently instead of only resizing.',
161
161
  '15. Keep UI-only requests context-isolated. Load frontend design rules first and do not eagerly load backend-only or workflow-only rules unless the task explicitly crosses those boundaries.',
162
162
  '16. Treat WCAG 2.2 AA as the hard accessibility floor. Use APCA only as advisory perceptual tuning, never as a reason to waive a WCAG failure.',
@@ -178,7 +178,7 @@ export function buildDesignBootstrapPrompt({
178
178
  '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
179
  '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
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. If expressive motion, spatial transitions, micro-interactions, or modern animation libraries support the anchor, use them with performance notes and reduced-motion fallbacks instead of suppressing motion to look safe.',
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.',
182
182
  '',
183
183
  '## Project Inputs',
184
184
  `- Project name: ${discoveryAnswers.projectName}`,
@@ -89,6 +89,43 @@ const COMMAND_REWRITE_MAPPINGS = [
89
89
  },
90
90
  ];
91
91
 
92
+ const OUTPUT_FOLDING_STRATEGY = {
93
+ mode: 'compact-high-signal-output',
94
+ appliesTo: [
95
+ 'shell-command-output',
96
+ 'test-output',
97
+ 'build-output',
98
+ 'diff-output',
99
+ 'log-output',
100
+ ],
101
+ preserveAlways: [
102
+ 'exit-code',
103
+ 'failing-command',
104
+ 'file-and-line',
105
+ 'error-message',
106
+ 'actionable-warning',
107
+ ],
108
+ foldByDefault: [
109
+ 'repeated-success-lines',
110
+ 'large-unchanged-diff-context',
111
+ 'verbose-install-progress',
112
+ 'duplicated-stack-frames',
113
+ 'low-signal-directory-noise',
114
+ ],
115
+ nativeFallback: [
116
+ 'prefer --stat or --name-only before full diff',
117
+ 'prefer focused rg queries before broad file dumps',
118
+ 'prefer failure-focused test reporters when available',
119
+ 'summarize long logs before hydrating full detail',
120
+ ],
121
+ safetyBoundary: [
122
+ 'never hide failing checks',
123
+ 'never drop the command that produced output',
124
+ 'never persist secrets into summaries',
125
+ 'hydrate full output only when the compact summary is insufficient',
126
+ ],
127
+ };
128
+
92
129
  function parseRtkVersion(versionOutput) {
93
130
  const versionMatch = versionOutput.match(/\d+\.\d+\.\d+/);
94
131
  return versionMatch ? versionMatch[0] : null;
@@ -204,6 +241,14 @@ export function createTokenOptimizationState({
204
241
  detectionError: rtkDetection.detectionError,
205
242
  },
206
243
  commandRewriteMappings: COMMAND_REWRITE_MAPPINGS.map((mapping) => ({ ...mapping })),
244
+ outputFoldingStrategy: {
245
+ ...OUTPUT_FOLDING_STRATEGY,
246
+ appliesTo: [...OUTPUT_FOLDING_STRATEGY.appliesTo],
247
+ preserveAlways: [...OUTPUT_FOLDING_STRATEGY.preserveAlways],
248
+ foldByDefault: [...OUTPUT_FOLDING_STRATEGY.foldByDefault],
249
+ nativeFallback: [...OUTPUT_FOLDING_STRATEGY.nativeFallback],
250
+ safetyBoundary: [...OUTPUT_FOLDING_STRATEGY.safetyBoundary],
251
+ },
207
252
  generatedAt: new Date().toISOString(),
208
253
  };
209
254
  }
@@ -258,6 +303,14 @@ export function buildTokenOptimizationGuidanceBlock(tokenOptimizationState) {
258
303
  '- If shell output is still large, summarize and continue iteratively instead of dumping full logs.',
259
304
  ];
260
305
 
306
+ const outputFoldingStrategy = tokenOptimizationState.outputFoldingStrategy || OUTPUT_FOLDING_STRATEGY;
307
+ const outputFoldingLines = [
308
+ `- Mode: ${outputFoldingStrategy.mode || OUTPUT_FOLDING_STRATEGY.mode}.`,
309
+ `- Preserve always: ${(outputFoldingStrategy.preserveAlways || OUTPUT_FOLDING_STRATEGY.preserveAlways).join(', ')}.`,
310
+ `- Fold by default: ${(outputFoldingStrategy.foldByDefault || OUTPUT_FOLDING_STRATEGY.foldByDefault).join(', ')}.`,
311
+ `- Safety boundary: ${(outputFoldingStrategy.safetyBoundary || OUTPUT_FOLDING_STRATEGY.safetyBoundary).join(', ')}.`,
312
+ ];
313
+
261
314
  return [
262
315
  `Token optimization mode is enabled for agent: ${tokenOptimizationState.selectedAgent}.`,
263
316
  `Preferred shell proxy: ${tokenOptimizationState.preferredShellProxy}.`,
@@ -269,6 +322,9 @@ export function buildTokenOptimizationGuidanceBlock(tokenOptimizationState) {
269
322
  '- Shell rewrite hooks affect shell tool calls only.',
270
323
  '- Built-in read/grep/glob style tools may bypass shell rewrites, so explicit compact shell commands should be preferred in high-volume sessions.',
271
324
  '',
325
+ 'Output folding policy:',
326
+ ...outputFoldingLines,
327
+ '',
272
328
  'Fallback behavior when external proxy is unavailable:',
273
329
  ...fallbackGuidance,
274
330
  ].join('\n');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryuenn3123/agentic-senior-core",
3
- "version": "3.0.25",
3
+ "version": "3.0.26",
4
4
  "type": "module",
5
5
  "description": "Force your AI Agent to code like a Staff Engineer, not a Junior.",
6
6
  "bin": {
@@ -14,7 +14,7 @@ export function buildSystemPrompt() {
14
14
  'Use repoEvidence.designEvidenceSummary as implementation evidence when deciding whether the diff follows the intended system.',
15
15
  'Do not reward generic SaaS defaults or popular template patterns.',
16
16
  'Do not penalize originality when the implementation still aligns with the contract.',
17
- 'Purposeful motion is allowed and can improve quality. Only flag motion when it drifts from the contract, ignores reduced-motion expectations, or adds avoidable performance/accessibility risk.',
17
+ 'Treat purposeful motion as a first-class quality signal for modern UI work. Flag missing or timid motion when the contract calls for expressive interaction, and only flag motion itself when it drifts from the contract, ignores reduced-motion expectations, or adds avoidable performance/accessibility risk.',
18
18
  'Only flag drift when there is a clear mismatch with the contract, accessibility non-negotiables, or cross-viewport adaptation rules.',
19
19
  'Treat WCAG 2.2 AA failures as hard accessibility drift.',
20
20
  'Treat APCA as advisory perceptual tuning only. Do not set blocking solely because APCA indicates a stronger readability adjustment when WCAG hard requirements still pass.',