@ryuenn3123/agentic-senior-core 2.5.14 → 2.5.16
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.
- package/.agent-context/prompts/review-code.md +2 -0
- package/.agent-context/review-checklists/frontend-excellence-rubric.md +12 -2
- package/.agent-context/review-checklists/frontend-usability.md +1 -0
- package/.agent-context/review-checklists/pr-checklist.md +10 -0
- package/.agent-context/rules/architecture.md +17 -0
- package/.agent-context/rules/frontend-architecture.md +7 -0
- package/.agent-context/state/memory-continuity-benchmark.json +1 -1
- package/.agent-context/state/onboarding-report.json +11 -2
- package/.cursorrules +2 -2
- package/.windsurfrules +2 -2
- package/lib/cli/compiler.mjs +20 -1
- package/package.json +3 -1
- package/scripts/explain-on-demand-audit.mjs +426 -0
- package/scripts/frontend-usability-audit.mjs +5 -0
- package/scripts/release-gate.mjs +164 -0
- package/scripts/single-source-lazy-loading-audit.mjs +535 -0
- package/scripts/validate.mjs +2 -0
package/scripts/release-gate.mjs
CHANGED
|
@@ -33,6 +33,8 @@ const FRONTEND_AUDIT_SCRIPT_PATH = 'scripts/frontend-usability-audit.mjs';
|
|
|
33
33
|
const DOCUMENTATION_BOUNDARY_AUDIT_SCRIPT_PATH = 'scripts/documentation-boundary-audit.mjs';
|
|
34
34
|
const CONTEXT_TRIGGERED_AUDIT_SCRIPT_PATH = 'scripts/context-triggered-audit.mjs';
|
|
35
35
|
const RULES_GUARDIAN_AUDIT_SCRIPT_PATH = 'scripts/rules-guardian-audit.mjs';
|
|
36
|
+
const EXPLAIN_ON_DEMAND_AUDIT_SCRIPT_PATH = 'scripts/explain-on-demand-audit.mjs';
|
|
37
|
+
const SINGLE_SOURCE_LAZY_LOADING_AUDIT_SCRIPT_PATH = 'scripts/single-source-lazy-loading-audit.mjs';
|
|
36
38
|
const BACKEND_ARCHITECTURE_RULE_PATH = '.agent-context/rules/architecture.md';
|
|
37
39
|
const BACKEND_REVIEW_CHECKLIST_PATH = '.agent-context/review-checklists/pr-checklist.md';
|
|
38
40
|
const REFACTOR_PROMPT_PATH = '.agent-context/prompts/refactor.md';
|
|
@@ -63,6 +65,8 @@ const REQUIRED_FRONTEND_EXCELLENCE_RUBRIC_SNIPPETS = [
|
|
|
63
65
|
'Typography Quality',
|
|
64
66
|
'Color System Diversity and Contrast',
|
|
65
67
|
'Interaction Choreography',
|
|
68
|
+
'Language and Content Consistency',
|
|
69
|
+
'Text Contrast and Collision Safety',
|
|
66
70
|
'UX Narrative and Conversion Clarity',
|
|
67
71
|
'Template Diversity and Originality',
|
|
68
72
|
'Low-Diversity Template Output Policy',
|
|
@@ -509,6 +513,166 @@ function runReleaseGate() {
|
|
|
509
513
|
}
|
|
510
514
|
}
|
|
511
515
|
|
|
516
|
+
const explainOnDemandAuditExecution = runMachineReadableScript(
|
|
517
|
+
EXPLAIN_ON_DEMAND_AUDIT_SCRIPT_PATH,
|
|
518
|
+
['--mode', 'default', '--workflow', 'pr-preparation']
|
|
519
|
+
);
|
|
520
|
+
if (!explainOnDemandAuditExecution.report) {
|
|
521
|
+
const failureDetails = explainOnDemandAuditExecution.executionErrorMessage
|
|
522
|
+
? `Explain-on-demand audit execution failed before producing a machine-readable report: ${explainOnDemandAuditExecution.executionErrorMessage}`
|
|
523
|
+
: 'Explain-on-demand audit did not produce machine-readable JSON output';
|
|
524
|
+
pushResult(results, false, 'explain-on-demand-audit', failureDetails);
|
|
525
|
+
} else {
|
|
526
|
+
diagnostics.explainOnDemandAudit = explainOnDemandAuditExecution.report;
|
|
527
|
+
pushResult(
|
|
528
|
+
results,
|
|
529
|
+
true,
|
|
530
|
+
'explain-on-demand-audit',
|
|
531
|
+
`explain-on-demand-audit executed (passed=${explainOnDemandAuditExecution.report.passed}, mode=${explainOnDemandAuditExecution.report.mode}, failures=${explainOnDemandAuditExecution.report.failureCount})`
|
|
532
|
+
);
|
|
533
|
+
|
|
534
|
+
const defaultHiddenStatePolicyPassed = explainOnDemandAuditExecution.report?.responsePolicy?.defaultModeExposesStateInternals === false
|
|
535
|
+
&& explainOnDemandAuditExecution.report?.defaultResponse?.containsStateInternals === false;
|
|
536
|
+
|
|
537
|
+
if (defaultHiddenStatePolicyPassed) {
|
|
538
|
+
pushResult(
|
|
539
|
+
results,
|
|
540
|
+
true,
|
|
541
|
+
'explain-on-demand-default-hidden-state',
|
|
542
|
+
'Default response mode hides unnecessary state-file internals'
|
|
543
|
+
);
|
|
544
|
+
} else {
|
|
545
|
+
pushResult(
|
|
546
|
+
results,
|
|
547
|
+
false,
|
|
548
|
+
'explain-on-demand-default-hidden-state',
|
|
549
|
+
'Default response mode exposes state internals or visibility flags are inconsistent'
|
|
550
|
+
);
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
const diagnosticExplicitRequestPolicyPassed = explainOnDemandAuditExecution.report?.responsePolicy?.diagnosticRequiresExplicitRequest === true;
|
|
554
|
+
|
|
555
|
+
if (diagnosticExplicitRequestPolicyPassed) {
|
|
556
|
+
pushResult(
|
|
557
|
+
results,
|
|
558
|
+
true,
|
|
559
|
+
'explain-on-demand-explicit-request-gate',
|
|
560
|
+
'State internals are gated behind explicit diagnostic request'
|
|
561
|
+
);
|
|
562
|
+
} else {
|
|
563
|
+
pushResult(
|
|
564
|
+
results,
|
|
565
|
+
false,
|
|
566
|
+
'explain-on-demand-explicit-request-gate',
|
|
567
|
+
'Explain-on-demand policy does not require explicit diagnostic request'
|
|
568
|
+
);
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
const diagnosticExplainabilityPassed = explainOnDemandAuditExecution.report?.diagnosticMode?.canExplainStateDecisions === true;
|
|
572
|
+
|
|
573
|
+
if (diagnosticExplainabilityPassed) {
|
|
574
|
+
pushResult(
|
|
575
|
+
results,
|
|
576
|
+
true,
|
|
577
|
+
'explain-on-demand-diagnostic-explainability',
|
|
578
|
+
'Diagnostic mode can explain relevant state decisions when requested'
|
|
579
|
+
);
|
|
580
|
+
} else {
|
|
581
|
+
pushResult(
|
|
582
|
+
results,
|
|
583
|
+
false,
|
|
584
|
+
'explain-on-demand-diagnostic-explainability',
|
|
585
|
+
'Explain-on-demand audit cannot provide diagnostic state decision explanations'
|
|
586
|
+
);
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
if (explainOnDemandAuditExecution.report.passed === true) {
|
|
590
|
+
pushResult(
|
|
591
|
+
results,
|
|
592
|
+
true,
|
|
593
|
+
'explain-on-demand-hard-rule',
|
|
594
|
+
'Explain-on-demand hard-rule passed'
|
|
595
|
+
);
|
|
596
|
+
} else {
|
|
597
|
+
const failedAuditDetails = Array.isArray(explainOnDemandAuditExecution.report.failures)
|
|
598
|
+
? explainOnDemandAuditExecution.report.failures.join('; ')
|
|
599
|
+
: 'Unknown explain-on-demand audit failures';
|
|
600
|
+
pushResult(
|
|
601
|
+
results,
|
|
602
|
+
false,
|
|
603
|
+
'explain-on-demand-hard-rule',
|
|
604
|
+
`Explain-on-demand audit failed: ${failedAuditDetails}`
|
|
605
|
+
);
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
const singleSourceLazyLoadingAuditExecution = runMachineReadableScript(
|
|
610
|
+
SINGLE_SOURCE_LAZY_LOADING_AUDIT_SCRIPT_PATH,
|
|
611
|
+
['--workflow', 'pr-preparation']
|
|
612
|
+
);
|
|
613
|
+
if (!singleSourceLazyLoadingAuditExecution.report) {
|
|
614
|
+
const failureDetails = singleSourceLazyLoadingAuditExecution.executionErrorMessage
|
|
615
|
+
? `Single-source lazy-loading audit execution failed before producing a machine-readable report: ${singleSourceLazyLoadingAuditExecution.executionErrorMessage}`
|
|
616
|
+
: 'Single-source lazy-loading audit did not produce machine-readable JSON output';
|
|
617
|
+
pushResult(results, false, 'single-source-lazy-loading-audit', failureDetails);
|
|
618
|
+
} else {
|
|
619
|
+
diagnostics.singleSourceLazyLoadingAudit = singleSourceLazyLoadingAuditExecution.report;
|
|
620
|
+
pushResult(
|
|
621
|
+
results,
|
|
622
|
+
true,
|
|
623
|
+
'single-source-lazy-loading-audit',
|
|
624
|
+
`single-source-lazy-loading-audit executed (passed=${singleSourceLazyLoadingAuditExecution.report.passed}, failures=${singleSourceLazyLoadingAuditExecution.report.failureCount})`
|
|
625
|
+
);
|
|
626
|
+
|
|
627
|
+
if (singleSourceLazyLoadingAuditExecution.report?.canonicalSource?.enforced === true) {
|
|
628
|
+
pushResult(
|
|
629
|
+
results,
|
|
630
|
+
true,
|
|
631
|
+
'canonical-rule-source-hard-rule',
|
|
632
|
+
'Canonical rule source is explicitly defined and enforced'
|
|
633
|
+
);
|
|
634
|
+
} else {
|
|
635
|
+
pushResult(
|
|
636
|
+
results,
|
|
637
|
+
false,
|
|
638
|
+
'canonical-rule-source-hard-rule',
|
|
639
|
+
'Canonical rule source enforcement failed in single-source lazy-loading audit'
|
|
640
|
+
);
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
if (singleSourceLazyLoadingAuditExecution.report?.lazyRuleLoading?.enforced === true) {
|
|
644
|
+
pushResult(
|
|
645
|
+
results,
|
|
646
|
+
true,
|
|
647
|
+
'lazy-rule-loading-hard-rule',
|
|
648
|
+
'Language-specific guidance is loaded lazily by detected scope'
|
|
649
|
+
);
|
|
650
|
+
} else {
|
|
651
|
+
pushResult(
|
|
652
|
+
results,
|
|
653
|
+
false,
|
|
654
|
+
'lazy-rule-loading-hard-rule',
|
|
655
|
+
'Lazy rule loading enforcement failed in single-source lazy-loading audit'
|
|
656
|
+
);
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
if (singleSourceLazyLoadingAuditExecution.report?.duplicationPolicy?.noConflictingDuplicates === true) {
|
|
660
|
+
pushResult(
|
|
661
|
+
results,
|
|
662
|
+
true,
|
|
663
|
+
'no-conflicting-duplicate-rule-instructions',
|
|
664
|
+
'No conflicting duplicate rule instructions detected in normal flow'
|
|
665
|
+
);
|
|
666
|
+
} else {
|
|
667
|
+
pushResult(
|
|
668
|
+
results,
|
|
669
|
+
false,
|
|
670
|
+
'no-conflicting-duplicate-rule-instructions',
|
|
671
|
+
'Conflicting duplicate rule instructions detected by single-source lazy-loading audit'
|
|
672
|
+
);
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
|
|
512
676
|
const frontendParityChecklistContent = readText(FRONTEND_PARITY_CHECKLIST_PATH);
|
|
513
677
|
if (!frontendParityChecklistContent) {
|
|
514
678
|
pushResult(results, false, 'frontend-parity-checklist-exists', `Missing ${FRONTEND_PARITY_CHECKLIST_PATH}`);
|