@ryuenn3123/agentic-senior-core 3.0.26 → 3.0.28
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/bootstrap-design.md +14 -3
- package/.agent-context/prompts/refactor.md +2 -0
- package/.agent-context/prompts/review-code.md +2 -2
- package/.agent-context/review-checklists/architecture-review.md +12 -0
- package/.agent-context/review-checklists/pr-checklist.md +10 -1
- package/.agent-context/rules/api-docs.md +4 -0
- package/.agent-context/rules/architecture.md +3 -3
- package/.agent-context/rules/database-design.md +9 -0
- package/.agent-context/rules/error-handling.md +8 -0
- package/.agent-context/rules/event-driven.md +3 -0
- package/.agent-context/rules/frontend-architecture.md +2 -0
- package/.agent-context/rules/microservices.md +2 -0
- package/.agent-context/rules/security.md +11 -0
- package/.agent-context/rules/testing.md +8 -0
- package/.agent-context/state/memory-continuity-benchmark.json +1 -1
- package/.agent-context/state/weekly-governance-report.json +234 -31
- package/.cursorrules +1 -1
- package/.gemini/instructions.md +3 -2
- package/.github/copilot-instructions.md +3 -2
- package/.instructions.md +21 -4
- package/.windsurfrules +1 -1
- package/AGENTS.md +4 -3
- package/README.md +4 -3
- package/lib/cli/commands/init.mjs +1 -0
- package/lib/cli/commands/upgrade.mjs +1 -0
- package/lib/cli/compiler.mjs +9 -8
- package/lib/cli/memory-continuity.mjs +4 -1
- package/lib/cli/project-scaffolder/design-contract.mjs +24 -0
- package/lib/cli/project-scaffolder/prompt-builders.mjs +5 -3
- package/package.json +1 -1
- package/scripts/governance-weekly-report.mjs +138 -1
- package/scripts/release-gate/audit-checks.mjs +1 -1
- package/scripts/release-gate/constants.mjs +11 -0
- package/scripts/rules-guardian-audit.mjs +1 -1
- package/scripts/single-source-lazy-loading-audit.mjs +10 -8
- package/scripts/sync-thin-adapters.mjs +7 -4
|
@@ -15,10 +15,21 @@ The agent must:
|
|
|
15
15
|
2. If `docs/DESIGN.md` or `docs/design-intent.json` exists, refine them instead of replacing them blindly.
|
|
16
16
|
3. If either design doc is missing, create it before UI implementation.
|
|
17
17
|
4. Use current repo evidence, product copy, route names, component names, user goals, and existing constraints as the source of truth.
|
|
18
|
-
5. Treat prior-chat visuals, unrelated project memory, benchmark screenshots, and famous-product aesthetics as tainted unless the user explicitly asks for continuity.
|
|
18
|
+
5. Treat prior-chat visuals, unrelated project memory, benchmark screenshots, and famous-product aesthetics as tainted context unless the user explicitly asks for continuity.
|
|
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,11 +46,11 @@ 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,
|
|
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
|
|
|
@@ -13,6 +13,8 @@ Before editing:
|
|
|
13
13
|
5. If the change touches a dependency, framework, Docker, runtime, or ecosystem claim, verify current official docs before choosing.
|
|
14
14
|
6. Enforce Universal SOP hard gate: stop implementation if `docs/architecture-decision-record.md` is missing, and for UI scope stop if `docs/DESIGN.md` or `docs/design-intent.json` is missing.
|
|
15
15
|
7. Enforce backend universal principles: no clever hacks, no premature abstraction, readability over brevity.
|
|
16
|
+
8. For backend/API scope, enforce layered boundaries, zero-trust input validation, safe centralized error responses, bounded list reads, transaction safety for multi-write mutations, idempotency for sensitive mutations, and behavior-focused API tests.
|
|
17
|
+
9. Backend/API governance is global and stack-agnostic. Do not create stack-specific adapters or framework-specific rule branches; apply the global rules through the framework already present in the target project.
|
|
16
18
|
|
|
17
19
|
Refactor rules:
|
|
18
20
|
- Improve clarity, boundaries, naming, validation, error handling, tests, and docs.
|
|
@@ -12,7 +12,7 @@ Before reviewing:
|
|
|
12
12
|
4. Load only the rules relevant to the changed scope.
|
|
13
13
|
5. For UI changes, load .agent-context/prompts/bootstrap-design.md, .agent-context/rules/frontend-architecture.md, docs/DESIGN.md, and docs/design-intent.json when present.
|
|
14
14
|
6. Enforce Universal SOP hard gate: block coding flow when required project docs are missing (`docs/architecture-decision-record.md`, and for UI scope `docs/DESIGN.md` plus `docs/design-intent.json`).
|
|
15
|
-
7. Enforce single-source and lazy-loading policy: canonical rule source must be explicitly enforced,
|
|
15
|
+
7. Enforce single-source and lazy-loading policy: canonical rule source must be explicitly enforced, global domain governance must load lazily based on touched scope, and conflicting duplicate rule instructions must not appear during normal flow.
|
|
16
16
|
|
|
17
17
|
Prioritize findings in this order:
|
|
18
18
|
1. Correctness, data loss, security, privacy, auth, and permission risks.
|
|
@@ -27,5 +27,5 @@ For every finding:
|
|
|
27
27
|
- reference the rule or contract only when it materially supports the finding
|
|
28
28
|
- propose the smallest safe fix
|
|
29
29
|
|
|
30
|
-
Do not
|
|
30
|
+
Do not create stack-specific governance concerns. Use project framework details only for concrete implementation risks proven by changed code, docs, or current official documentation.
|
|
31
31
|
```
|
|
@@ -6,6 +6,10 @@ Use this when module structure, feature shape, public contracts, topology, or re
|
|
|
6
6
|
|
|
7
7
|
- [ ] The changed code has clear transport, application, domain, and infrastructure boundaries where those layers exist.
|
|
8
8
|
- [ ] Business policy is not hidden in transport handlers, UI adapters, database queries, framework glue, or generated code.
|
|
9
|
+
- [ ] Controllers and route handlers only translate protocol input/output, enforce edge checks, and delegate business flow.
|
|
10
|
+
- [ ] Service or use-case code owns orchestration, transactions, state transitions, and idempotency decisions.
|
|
11
|
+
- [ ] Repository or adapter code owns persistence and external IO details without hiding product policy in queries.
|
|
12
|
+
- [ ] Global backend/API governance is used directly; no stack-specific adapter or framework-specific rule fork was introduced.
|
|
9
13
|
- [ ] Internal models do not leak across public API, event, CLI, library, or UI contracts without a deliberate mapping.
|
|
10
14
|
- [ ] Modules import through public entrypoints instead of deep internal paths.
|
|
11
15
|
- [ ] Circular dependencies are absent or explicitly removed.
|
|
@@ -35,6 +39,10 @@ Use this when module structure, feature shape, public contracts, topology, or re
|
|
|
35
39
|
- [ ] API, event, CLI, library, data, and UI contracts are documented before or alongside implementation.
|
|
36
40
|
- [ ] Schema and validation strategy matches the project’s chosen runtime and official docs.
|
|
37
41
|
- [ ] Error contracts are safe, stable, and do not leak internals.
|
|
42
|
+
- [ ] List endpoints have bounded pagination, limits, or streaming behavior documented.
|
|
43
|
+
- [ ] Sensitive mutations have documented idempotency, retry, and duplicate-submit behavior.
|
|
44
|
+
- [ ] Error contracts document stable codes, safe trace or correlation identifiers, and any Problem Details-style fields when exposed.
|
|
45
|
+
- [ ] Async/event contracts document retry, ordering, duplicate handling, and dead-letter or recovery behavior.
|
|
38
46
|
- [ ] Migration and rollback plans exist for risky data or public contract changes.
|
|
39
47
|
|
|
40
48
|
## Operational Review
|
|
@@ -43,3 +51,7 @@ Use this when module structure, feature shape, public contracts, topology, or re
|
|
|
43
51
|
- [ ] Observability, logging, and health checks match the project’s runtime and risk level.
|
|
44
52
|
- [ ] Security assumptions are documented and enforced at trust boundaries.
|
|
45
53
|
- [ ] Performance-sensitive paths avoid avoidable repeated work, unbounded lists, and hidden blocking operations.
|
|
54
|
+
- [ ] Relational reads avoid N+1 patterns or include an explicit query-shape rationale.
|
|
55
|
+
- [ ] Multi-table or cross-resource writes are transactional or include a documented compensating recovery path.
|
|
56
|
+
- [ ] Dual-write database plus message flows use an outbox or equivalent atomicity and replay strategy.
|
|
57
|
+
- [ ] Cross-service consistency avoids default two-phase commit and defines saga, compensation, or recovery behavior when needed.
|
|
@@ -24,6 +24,10 @@ Run this before declaring a task done. Apply only the sections relevant to the c
|
|
|
24
24
|
- [ ] No clever hacks in backend and shared core modules
|
|
25
25
|
- [ ] No premature abstraction (base classes/util layers created only after repeated stable patterns)
|
|
26
26
|
- [ ] Readability over brevity for maintainability
|
|
27
|
+
- [ ] Controllers, route handlers, and transport adapters do not contain business policy, raw queries, or cross-resource orchestration.
|
|
28
|
+
- [ ] Services or use cases own business flow, transaction boundaries, and mutation safety.
|
|
29
|
+
- [ ] Repositories or adapters own persistence/external IO details without hiding business decisions.
|
|
30
|
+
- [ ] Backend/API governance was applied through global domain rules, not stack-specific adapters or framework-only branches.
|
|
27
31
|
- [ ] Code is grouped by feature/domain where that improves maintainability.
|
|
28
32
|
- [ ] Cross-module access uses public contracts instead of internal file reach-through.
|
|
29
33
|
- [ ] Files above roughly 1000 lines were split or explicitly justified.
|
|
@@ -32,14 +36,18 @@ Run this before declaring a task done. Apply only the sections relevant to the c
|
|
|
32
36
|
## 4. Security And Privacy
|
|
33
37
|
|
|
34
38
|
- [ ] External input is validated at trust boundaries using the project’s chosen validation approach.
|
|
39
|
+
- [ ] Body, query, params, headers, cookies, uploads, webhooks, and job payloads are treated as untrusted until validated and normalized.
|
|
35
40
|
- [ ] Secrets, tokens, credentials, and private data are not committed or logged.
|
|
36
41
|
- [ ] Authorization is enforced at a trusted boundary.
|
|
37
42
|
- [ ] Error responses and logs do not leak internals.
|
|
43
|
+
- [ ] Least privilege, resource-level authorization, and secret handling are preserved where sensitive data or privileged actions are touched.
|
|
38
44
|
- [ ] Dependency or platform security claims are based on current official docs or repo evidence.
|
|
39
45
|
|
|
40
46
|
## 5. Testing
|
|
41
47
|
|
|
42
48
|
- [ ] Changed behavior has appropriate tests at the smallest useful level.
|
|
49
|
+
- [ ] API changes cover validation, authorization, documented error shape, pagination defaults, and empty states where relevant.
|
|
50
|
+
- [ ] Sensitive mutations include idempotency or duplicate-submit coverage where duplicate side effects would be harmful.
|
|
43
51
|
- [ ] Tests assert behavior and contracts, not implementation trivia.
|
|
44
52
|
- [ ] Critical flows include failure-path coverage.
|
|
45
53
|
- [ ] Test fixtures are readable and do not hide the behavior under test.
|
|
@@ -73,6 +81,7 @@ Run this before declaring a task done. Apply only the sections relevant to the c
|
|
|
73
81
|
- [ ] Official setup flows are preferred when they produce better-supported current defaults.
|
|
74
82
|
- [ ] Docker, framework, package, and ecosystem claims were checked live when they could be stale.
|
|
75
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.
|
|
76
85
|
|
|
77
86
|
## 9. State And Governance
|
|
78
87
|
|
|
@@ -88,7 +97,7 @@ Run this before declaring a task done. Apply only the sections relevant to the c
|
|
|
88
97
|
- [ ] State internals are exposed only on explicit request.
|
|
89
98
|
- [ ] Diagnostic mode can explain relevant state decisions when needed.
|
|
90
99
|
- [ ] Canonical rule source is explicitly defined and enforced
|
|
91
|
-
- [ ]
|
|
100
|
+
- [ ] Global domain governance is loaded lazily based on touched scope
|
|
92
101
|
- [ ] No conflicting duplicate rule instructions during normal flow
|
|
93
102
|
- [ ] Canonical rule source is explicit and duplicate/conflicting instructions are avoided.
|
|
94
103
|
|
|
@@ -9,6 +9,10 @@ If a change affects an API, CLI command, exported library behavior, schema, even
|
|
|
9
9
|
- Document the public surface before or alongside implementation.
|
|
10
10
|
- Machine-readable API contracts should use the current project standard. If unresolved, the LLM must recommend a current maintained option from official docs.
|
|
11
11
|
- HTTP APIs should prefer OpenAPI 3.1 when no stronger project standard exists.
|
|
12
|
+
- List endpoints must document pagination, limits, filtering, sorting, and empty-state behavior.
|
|
13
|
+
- Sensitive mutation endpoints must document idempotency behavior, retry safety, duplicate-submit handling, and any required idempotency key or request fingerprint.
|
|
14
|
+
- Public error contracts must document stable machine-readable codes and any RFC 9457 Problem Details-style fields the project exposes, including safe trace or correlation identifiers when present.
|
|
15
|
+
- Async, webhook, and event contracts must document idempotency, retry, ordering, dead-letter or recovery behavior, and duplicate-message handling.
|
|
12
16
|
- Event APIs should define producer, consumer, payload, versioning, retry, and failure behavior.
|
|
13
17
|
- CLI/library public behavior must update README, help text, changelog, or docs as appropriate.
|
|
14
18
|
- Do not write "see code" as the contract.
|
|
@@ -50,9 +50,9 @@ The `.agent-context/rules/` directory is the default guidance source for impleme
|
|
|
50
50
|
|
|
51
51
|
- Canonical rule source is .instructions.md.
|
|
52
52
|
- Adapter entry files stay thin and must point to the canonical source.
|
|
53
|
-
- Load
|
|
54
|
-
-
|
|
55
|
-
-
|
|
53
|
+
- Load global domain rules lazily based on touched scope.
|
|
54
|
+
- Do not create or load stack-specific governance adapters as the baseline.
|
|
55
|
+
- Runtime or framework evidence can clarify implementation details, but it must not replace the global architecture, security, data, API, error, event, and testing boundaries.
|
|
56
56
|
- Keep rule-loading output deterministic for init and release validation.
|
|
57
57
|
|
|
58
58
|
## Architecture Decision Boundary
|
|
@@ -10,4 +10,13 @@ Reject these bad habits:
|
|
|
10
10
|
- raw query construction that bypasses safe parameterization
|
|
11
11
|
- destructive data changes without backup, migration, or deployment sequencing notes
|
|
12
12
|
|
|
13
|
+
Backend data access rules:
|
|
14
|
+
- Relational reads must avoid N+1 query patterns. Use eager loading, joins, batching, or explicit query-shape rationale based on the project's ORM or database driver.
|
|
15
|
+
- List endpoints and exports must paginate, limit, stream, or otherwise bound growable datasets by default.
|
|
16
|
+
- Use cursor pagination for large or frequently changing datasets when the project contract allows it; offset pagination is acceptable for small, stable, explicitly bounded collections.
|
|
17
|
+
- Define maximum page size, payload size, and export limits so list responses cannot exhaust memory or connection pools.
|
|
18
|
+
- Mutations that write more than one table, aggregate, queue, or external consistency boundary must run inside a transaction or document the compensating recovery path.
|
|
19
|
+
- Repository and data-access layers own persistence mechanics. They must not hide business policy that belongs in application or domain logic.
|
|
20
|
+
- Cross-domain persistence must respect ownership boundaries. Independent services must not share database tables as an integration contract; modular monoliths may share one database only when module ownership and access paths stay explicit.
|
|
21
|
+
|
|
13
22
|
Docs must record entity ownership, relationships, constraints, data lifecycle, migration risk, and assumptions to validate.
|
|
@@ -9,4 +9,12 @@ Reject these failure patterns:
|
|
|
9
9
|
- retries without transient-failure evidence, limits, backoff, and a clear final outcome
|
|
10
10
|
- logs that say only "something failed" without action, target, actor, or trace context
|
|
11
11
|
|
|
12
|
+
Backend API error rules:
|
|
13
|
+
- Use the framework's normal centralized error boundary or middleware for HTTP/API responses.
|
|
14
|
+
- Do not return raw exception messages, stack traces, SQL, provider payloads, file paths, secrets, or infrastructure details to callers.
|
|
15
|
+
- Public API errors must use a stable JSON shape with at least `code` and `message`; include `details` only when the data is safe, documented, and useful to the caller. HTTP APIs may use an RFC 9457 Problem Details-style shape when it fits the project contract.
|
|
16
|
+
- Domain and validation errors should keep machine-readable codes so tests, clients, and operators can distinguish expected failures from defects.
|
|
17
|
+
- API boundary errors should include a safe correlation or trace identifier when observability exists, while protected logs keep the internal exception, actor, target, and trace context.
|
|
18
|
+
- Distributed systems should preserve trace context across ingress and egress using the project's tracing standard, such as W3C Trace Context or OpenTelemetry propagation.
|
|
19
|
+
|
|
12
20
|
At boundaries, validate early, return safe user-facing errors, and keep machine-readable error context for operators and callers.
|
|
@@ -17,6 +17,9 @@ Hard rules:
|
|
|
17
17
|
- consumers are idempotent
|
|
18
18
|
- retries are bounded and dead-letter or recovery behavior is defined
|
|
19
19
|
- transactional publishing uses an outbox or equivalent safety pattern when data consistency matters
|
|
20
|
+
- dual-write flows that update local state and publish a message must use a transactional outbox or document an equivalent atomicity and replay strategy
|
|
21
|
+
- distributed transactions and two-phase commit are not the default recovery model; prefer local transactions plus saga, choreography, orchestration, or explicit compensating actions when consistency crosses service boundaries
|
|
22
|
+
- message handlers must record processed message identifiers or use another duplicate-detection strategy when the delivery model can retry or redeliver
|
|
20
23
|
- event catalogs or docs identify producer, consumers, ownership, and schema evolution rules
|
|
21
24
|
|
|
22
25
|
If event tooling is unresolved, the LLM must recommend a current project-fit broker or managed service from official docs before implementation.
|
|
@@ -56,6 +56,8 @@ 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.
|
|
61
63
|
- 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.
|
|
@@ -35,7 +35,9 @@ Hard rules:
|
|
|
35
35
|
- Each service owns its data boundary.
|
|
36
36
|
- Public service contracts must be documented before implementation or extraction.
|
|
37
37
|
- Cross-service calls need timeout, retry, idempotency, observability, and recovery behavior.
|
|
38
|
+
- Independent services must not use shared tables as their integration contract; communicate through documented APIs, events, or async workflows owned by the source domain.
|
|
38
39
|
- Avoid synchronous call chains that turn services into a distributed monolith.
|
|
40
|
+
- Critical cross-service mutations should prefer local transactions plus outbox, saga, choreography, orchestration, or compensating actions over two-phase commit by default.
|
|
39
41
|
- Prefer incremental extraction over rewrites.
|
|
40
42
|
|
|
41
43
|
If the evidence is unclear, document the uncertainty and keep the topology agent-recommended instead of pretending an offline default is correct.
|
|
@@ -10,5 +10,16 @@ Hard rules:
|
|
|
10
10
|
- enforce authorization at the server or trusted boundary, not only in UI state
|
|
11
11
|
- return safe client-facing errors and keep sensitive detail in protected logs
|
|
12
12
|
- document auth, permission, data exposure, rate-limit, and abuse assumptions before changing sensitive flows
|
|
13
|
+
- apply least privilege to service accounts, API tokens, database users, background jobs, and operator/admin actions
|
|
14
|
+
- retrieve secrets through environment, runtime secret injection, or the project's secret manager; do not store static secrets in source or plaintext config
|
|
15
|
+
- keep `.env` and local secret files covered by `.gitignore`; commit only safe examples such as `.env.example`
|
|
16
|
+
- treat transport encryption, secure cookies, and trusted proxy boundaries as deployment assumptions that must be documented when sensitive traffic is involved
|
|
17
|
+
|
|
18
|
+
Zero-trust API input rules:
|
|
19
|
+
- Treat body, query, params, headers, cookies, uploaded files, webhook payloads, and background job payloads as untrusted until validated.
|
|
20
|
+
- Validate and normalize input at the outer boundary before it reaches service, use-case, repository, or domain logic.
|
|
21
|
+
- Services should receive typed, already-validated values and still enforce domain invariants for security-sensitive rules.
|
|
22
|
+
- Sanitization must match the sink: SQL, shell, file path, log, HTML, template, and URL contexts need different protections.
|
|
23
|
+
- Authorization must be resource-aware when data ownership matters. Prefer row, tenant, account, organization, or resource-level checks over role-only checks for sensitive records.
|
|
13
24
|
|
|
14
25
|
For high-risk changes, check current framework security docs and record the relevant source or assumption in the implementation notes.
|
|
@@ -8,6 +8,14 @@ Test what can break:
|
|
|
8
8
|
- regressions around bugs being fixed
|
|
9
9
|
- critical accessibility or responsive behavior when UI is in scope
|
|
10
10
|
|
|
11
|
+
Backend/API test rules:
|
|
12
|
+
- API tests must cover request validation, authorization boundaries, success responses, documented error shapes, pagination defaults, and empty states for touched endpoints.
|
|
13
|
+
- Sensitive mutations such as payments, orders, status changes, inventory adjustments, and account/security changes must include duplicate-submit or retry tests when idempotency is required.
|
|
14
|
+
- Data-access changes must include evidence for query shape, transaction behavior, rollback or recovery paths, and N+1 prevention when relational reads are touched.
|
|
15
|
+
- Event or worker changes must test retry, duplicate-message handling, dead-letter or recovery behavior, and outbox relay semantics when those paths exist.
|
|
16
|
+
- Distributed consistency changes must test the local transaction, publish/retry behavior, and compensating action or recovery path rather than only the happy path.
|
|
17
|
+
- Tests should make the API contract obvious from the fixture names, inputs, and expected response shape.
|
|
18
|
+
|
|
11
19
|
Do not test framework internals, third-party library behavior, private implementation trivia, or snapshots that only freeze noise.
|
|
12
20
|
|
|
13
21
|
Tests should describe behavior, keep setup readable, and mock only at real boundaries such as network, filesystem, clock, database, or external services.
|
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generatedAt": "2026-04-
|
|
2
|
+
"generatedAt": "2026-04-25T09:59:20.980Z",
|
|
3
3
|
"reportName": "weekly-governance-report",
|
|
4
4
|
"methodology": {
|
|
5
5
|
"qualityTrendSource": "state-file",
|
|
6
6
|
"qualityTrendGeneratedAt": "2026-04-11T12:21:35.779Z",
|
|
7
7
|
"commitWindowDays": 7,
|
|
8
8
|
"requiredVerifiedDomains": [
|
|
9
|
-
"
|
|
10
|
-
"frontend",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
9
|
+
"canonical-instructions",
|
|
10
|
+
"frontend-design-contract",
|
|
11
|
+
"frontend-architecture",
|
|
12
|
+
"backend-architecture",
|
|
13
|
+
"backend-security",
|
|
14
|
+
"backend-data-access",
|
|
15
|
+
"backend-error-handling",
|
|
16
|
+
"backend-api-contract",
|
|
17
|
+
"backend-testing",
|
|
18
|
+
"backend-performance",
|
|
19
|
+
"backend-idempotency",
|
|
20
|
+
"backend-risk-map",
|
|
21
|
+
"pr-checklist",
|
|
22
|
+
"architecture-review",
|
|
23
|
+
"mcp-server",
|
|
24
|
+
"state-continuity"
|
|
14
25
|
]
|
|
15
26
|
},
|
|
16
27
|
"qualitySignals": {
|
|
@@ -31,64 +42,236 @@
|
|
|
31
42
|
"skillTrust": {
|
|
32
43
|
"domains": [
|
|
33
44
|
{
|
|
34
|
-
"domain": "
|
|
35
|
-
"tier": "
|
|
36
|
-
"score":
|
|
45
|
+
"domain": "architecture-review",
|
|
46
|
+
"tier": "verified",
|
|
47
|
+
"score": 100,
|
|
48
|
+
"sourcePath": ".agent-context/review-checklists/architecture-review.md"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"domain": "backend-api-contract",
|
|
52
|
+
"tier": "verified",
|
|
53
|
+
"score": 100,
|
|
54
|
+
"sourcePath": ".agent-context/rules/api-docs.md"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"domain": "backend-architecture",
|
|
58
|
+
"tier": "verified",
|
|
59
|
+
"score": 100,
|
|
60
|
+
"sourcePath": ".agent-context/rules/architecture.md"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"domain": "backend-data-access",
|
|
64
|
+
"tier": "verified",
|
|
65
|
+
"score": 100,
|
|
66
|
+
"sourcePath": ".agent-context/rules/database-design.md"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"domain": "backend-error-handling",
|
|
70
|
+
"tier": "verified",
|
|
71
|
+
"score": 100,
|
|
72
|
+
"sourcePath": ".agent-context/rules/error-handling.md"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"domain": "backend-idempotency",
|
|
76
|
+
"tier": "verified",
|
|
77
|
+
"score": 100,
|
|
78
|
+
"sourcePath": ".agent-context/rules/event-driven.md"
|
|
37
79
|
},
|
|
38
80
|
{
|
|
39
|
-
"domain": "
|
|
81
|
+
"domain": "backend-performance",
|
|
40
82
|
"tier": "verified",
|
|
41
|
-
"score": 100
|
|
83
|
+
"score": 100,
|
|
84
|
+
"sourcePath": ".agent-context/rules/performance.md"
|
|
42
85
|
},
|
|
43
86
|
{
|
|
44
|
-
"domain": "
|
|
87
|
+
"domain": "backend-risk-map",
|
|
45
88
|
"tier": "verified",
|
|
46
|
-
"score": 100
|
|
89
|
+
"score": 100,
|
|
90
|
+
"sourcePath": ".agent-context/state/architecture-map.md"
|
|
47
91
|
},
|
|
48
92
|
{
|
|
49
|
-
"domain": "
|
|
93
|
+
"domain": "backend-security",
|
|
50
94
|
"tier": "verified",
|
|
51
|
-
"score": 100
|
|
95
|
+
"score": 100,
|
|
96
|
+
"sourcePath": ".agent-context/rules/security.md"
|
|
52
97
|
},
|
|
53
98
|
{
|
|
54
|
-
"domain": "
|
|
99
|
+
"domain": "backend-testing",
|
|
55
100
|
"tier": "verified",
|
|
56
|
-
"score": 100
|
|
101
|
+
"score": 100,
|
|
102
|
+
"sourcePath": ".agent-context/rules/testing.md"
|
|
57
103
|
},
|
|
58
104
|
{
|
|
59
|
-
"domain": "
|
|
105
|
+
"domain": "canonical-instructions",
|
|
60
106
|
"tier": "verified",
|
|
61
|
-
"score": 100
|
|
107
|
+
"score": 100,
|
|
108
|
+
"sourcePath": ".instructions.md"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"domain": "frontend-architecture",
|
|
112
|
+
"tier": "verified",
|
|
113
|
+
"score": 100,
|
|
114
|
+
"sourcePath": ".agent-context/rules/frontend-architecture.md"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"domain": "frontend-design-contract",
|
|
118
|
+
"tier": "verified",
|
|
119
|
+
"score": 100,
|
|
120
|
+
"sourcePath": ".agent-context/prompts/bootstrap-design.md"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"domain": "mcp-server",
|
|
124
|
+
"tier": "verified",
|
|
125
|
+
"score": 100,
|
|
126
|
+
"sourcePath": "scripts/mcp-server.mjs"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"domain": "pr-checklist",
|
|
130
|
+
"tier": "verified",
|
|
131
|
+
"score": 100,
|
|
132
|
+
"sourcePath": ".agent-context/review-checklists/pr-checklist.md"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"domain": "state-continuity",
|
|
136
|
+
"tier": "verified",
|
|
137
|
+
"score": 100,
|
|
138
|
+
"sourcePath": ".agent-context/state"
|
|
62
139
|
}
|
|
63
140
|
],
|
|
64
141
|
"tierCounts": {
|
|
65
|
-
"verified":
|
|
142
|
+
"verified": 16,
|
|
66
143
|
"community": 0,
|
|
67
|
-
"experimental":
|
|
144
|
+
"experimental": 0
|
|
68
145
|
},
|
|
69
146
|
"requiredVerifiedDomains": [
|
|
70
|
-
"
|
|
71
|
-
"frontend",
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
147
|
+
"canonical-instructions",
|
|
148
|
+
"frontend-design-contract",
|
|
149
|
+
"frontend-architecture",
|
|
150
|
+
"backend-architecture",
|
|
151
|
+
"backend-security",
|
|
152
|
+
"backend-data-access",
|
|
153
|
+
"backend-error-handling",
|
|
154
|
+
"backend-api-contract",
|
|
155
|
+
"backend-testing",
|
|
156
|
+
"backend-performance",
|
|
157
|
+
"backend-idempotency",
|
|
158
|
+
"backend-risk-map",
|
|
159
|
+
"pr-checklist",
|
|
160
|
+
"architecture-review",
|
|
161
|
+
"mcp-server",
|
|
162
|
+
"state-continuity"
|
|
75
163
|
],
|
|
76
164
|
"requiredVerifiedDomainFailures": [],
|
|
77
165
|
"allRequiredVerified": true
|
|
78
166
|
},
|
|
167
|
+
"backendGovernance": {
|
|
168
|
+
"status": "verified",
|
|
169
|
+
"summary": "Backend governance is verified across architecture, security, data access, error handling, API contracts, testing, performance, idempotency, and risk-map surfaces.",
|
|
170
|
+
"requiredSurfaceCount": 9,
|
|
171
|
+
"verifiedSurfaceCount": 9,
|
|
172
|
+
"missingSurfaceNames": [],
|
|
173
|
+
"coverage": [
|
|
174
|
+
{
|
|
175
|
+
"constraint": "Layered architecture and separation of concerns",
|
|
176
|
+
"status": "covered",
|
|
177
|
+
"sourcePaths": [
|
|
178
|
+
".agent-context/rules/architecture.md",
|
|
179
|
+
".agent-context/review-checklists/architecture-review.md"
|
|
180
|
+
],
|
|
181
|
+
"signal": "Transport, application, domain, and infrastructure boundaries are explicit."
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"constraint": "Global backend/API rule routing",
|
|
185
|
+
"status": "strengthened",
|
|
186
|
+
"sourcePaths": [
|
|
187
|
+
".instructions.md",
|
|
188
|
+
".agent-context/rules/architecture.md",
|
|
189
|
+
".agent-context/prompts/refactor.md"
|
|
190
|
+
],
|
|
191
|
+
"signal": "Backend/API governance routes by problem domain and stays stack-agnostic; no stack-specific governance adapters are created."
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"constraint": "Zero-trust input validation",
|
|
195
|
+
"status": "strengthened",
|
|
196
|
+
"sourcePaths": [
|
|
197
|
+
".agent-context/rules/security.md",
|
|
198
|
+
".agent-context/review-checklists/pr-checklist.md"
|
|
199
|
+
],
|
|
200
|
+
"signal": "User-controlled body, query, params, headers, cookies, files, webhooks, and job payloads must be validated before service logic."
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"constraint": "Data access performance and integrity",
|
|
204
|
+
"status": "strengthened",
|
|
205
|
+
"sourcePaths": [
|
|
206
|
+
".agent-context/rules/database-design.md",
|
|
207
|
+
".agent-context/rules/performance.md",
|
|
208
|
+
".agent-context/state/architecture-map.md"
|
|
209
|
+
],
|
|
210
|
+
"signal": "Backend reads must avoid N+1 and unbounded list responses; multi-write mutations need transaction or recovery evidence."
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"constraint": "Distributed consistency and outbox safety",
|
|
214
|
+
"status": "strengthened",
|
|
215
|
+
"sourcePaths": [
|
|
216
|
+
".agent-context/rules/event-driven.md",
|
|
217
|
+
".agent-context/rules/database-design.md",
|
|
218
|
+
".agent-context/rules/microservices.md"
|
|
219
|
+
],
|
|
220
|
+
"signal": "Dual-write flows need outbox or equivalent replay safety, and cross-service consistency must define saga, compensation, or recovery behavior instead of defaulting to two-phase commit."
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"constraint": "Safe centralized API errors",
|
|
224
|
+
"status": "strengthened",
|
|
225
|
+
"sourcePaths": [
|
|
226
|
+
".agent-context/rules/error-handling.md",
|
|
227
|
+
".agent-context/rules/api-docs.md"
|
|
228
|
+
],
|
|
229
|
+
"signal": "HTTP/API responses use safe machine-readable error shapes, may align with RFC 9457 Problem Details, and preserve safe trace/correlation identifiers without leaking internals."
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"constraint": "Sensitive mutation idempotency",
|
|
233
|
+
"status": "strengthened",
|
|
234
|
+
"sourcePaths": [
|
|
235
|
+
".agent-context/rules/api-docs.md",
|
|
236
|
+
".agent-context/rules/testing.md",
|
|
237
|
+
".agent-context/rules/event-driven.md"
|
|
238
|
+
],
|
|
239
|
+
"signal": "Payments, orders, status changes, and other risky mutations must document and test duplicate-submit behavior."
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"constraint": "API contract and behavior testing",
|
|
243
|
+
"status": "strengthened",
|
|
244
|
+
"sourcePaths": [
|
|
245
|
+
".agent-context/rules/testing.md",
|
|
246
|
+
".agent-context/review-checklists/pr-checklist.md"
|
|
247
|
+
],
|
|
248
|
+
"signal": "API tests cover validation, auth, documented error shapes, pagination defaults, empty states, and mutation retry safety."
|
|
249
|
+
}
|
|
250
|
+
],
|
|
251
|
+
"developmentFocus": [
|
|
252
|
+
{
|
|
253
|
+
"focus": "Keep backend guidance global and stack-agnostic.",
|
|
254
|
+
"reason": "The repo should enforce architecture, security, API, data, error, event, and testing thinking without building Nest, Laravel, FastAPI, Express, Go, or other stack-specific governance adapters."
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"focus": "Use framework facts only when implementing inside an existing project.",
|
|
258
|
+
"reason": "LLMs can apply current ecosystem knowledge directly; governance should route the relevant global constraints instead of acting as a stack detector."
|
|
259
|
+
}
|
|
260
|
+
]
|
|
261
|
+
},
|
|
79
262
|
"commitSignals": {
|
|
80
263
|
"windowDays": 7,
|
|
81
|
-
"commitCount":
|
|
82
|
-
"releaseCommitCount":
|
|
264
|
+
"commitCount": 30,
|
|
265
|
+
"releaseCommitCount": 18,
|
|
83
266
|
"rollbackCommitCount": 1,
|
|
84
|
-
"releaseFrequencyPercent":
|
|
85
|
-
"rollbackFrequencyPercent":
|
|
267
|
+
"releaseFrequencyPercent": 60,
|
|
268
|
+
"rollbackFrequencyPercent": 3.33,
|
|
86
269
|
"error": null
|
|
87
270
|
},
|
|
88
271
|
"releaseReadiness": {
|
|
89
272
|
"isReady": true,
|
|
90
273
|
"blockers": [],
|
|
91
|
-
"summary": "Weekly governance posture is ready for maintenance releases."
|
|
274
|
+
"summary": "Weekly governance posture is ready for maintenance releases with frontend and backend governance surfaces verified."
|
|
92
275
|
},
|
|
93
276
|
"artifact": {
|
|
94
277
|
"path": "E:\\Project\\Agentic-Senior-Core\\.agent-context\\state\\weekly-governance-report.json",
|
|
@@ -121,6 +304,26 @@
|
|
|
121
304
|
"verifiedSkillDomainCount": 5,
|
|
122
305
|
"releaseFrequencyPercent": 38.89,
|
|
123
306
|
"rollbackFrequencyPercent": 5.56
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"generatedAt": "2026-04-25T06:41:17.654Z",
|
|
310
|
+
"readinessStatus": "ready",
|
|
311
|
+
"blockerCount": 0,
|
|
312
|
+
"gatePassRatePercent": 100,
|
|
313
|
+
"verifiedSkillDomainCount": 16,
|
|
314
|
+
"backendVerifiedSurfaceCount": 9,
|
|
315
|
+
"releaseFrequencyPercent": 60,
|
|
316
|
+
"rollbackFrequencyPercent": 3.33
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"generatedAt": "2026-04-25T09:59:20.980Z",
|
|
320
|
+
"readinessStatus": "ready",
|
|
321
|
+
"blockerCount": 0,
|
|
322
|
+
"gatePassRatePercent": 100,
|
|
323
|
+
"verifiedSkillDomainCount": 16,
|
|
324
|
+
"backendVerifiedSurfaceCount": 9,
|
|
325
|
+
"releaseFrequencyPercent": 60,
|
|
326
|
+
"rollbackFrequencyPercent": 3.33
|
|
124
327
|
}
|
|
125
328
|
]
|
|
126
329
|
}
|
package/.cursorrules
CHANGED