@mytechtoday/augment-extensions 3.2.0 → 3.4.0

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.
Files changed (198) hide show
  1. package/AGENTS.md +25 -16
  2. package/README.md +215 -17
  3. package/augment-extensions/coding-standards/java/CHANGELOG.md +12 -0
  4. package/augment-extensions/coding-standards/java/README.md +54 -0
  5. package/augment-extensions/coding-standards/java/examples/SearchRequest.java +13 -0
  6. package/augment-extensions/coding-standards/java/metadata.json +36 -0
  7. package/augment-extensions/coding-standards/java/module.json +35 -0
  8. package/augment-extensions/coding-standards/java/rules/language-and-api-design.md +45 -0
  9. package/augment-extensions/coding-standards/java/rules/reliability-and-concurrency.md +43 -0
  10. package/augment-extensions/coding-standards/java/rules/testing-tooling-and-security.md +39 -0
  11. package/augment-extensions/coding-standards/spring/CHANGELOG.md +12 -0
  12. package/augment-extensions/coding-standards/spring/README.md +61 -0
  13. package/augment-extensions/coding-standards/spring/examples/OrderController.java +40 -0
  14. package/augment-extensions/coding-standards/spring/metadata.json +39 -0
  15. package/augment-extensions/coding-standards/spring/module.json +38 -0
  16. package/augment-extensions/coding-standards/spring/rules/beans-configuration-and-boot.md +39 -0
  17. package/augment-extensions/coding-standards/spring/rules/data-testing-and-transactions.md +36 -0
  18. package/augment-extensions/coding-standards/spring/rules/production-operations.md +40 -0
  19. package/augment-extensions/coding-standards/spring/rules/web-apis-and-security.md +43 -0
  20. package/augment-extensions/visual-design/metadata.json +1 -1
  21. package/augment-extensions/visual-design/module.json +2 -2
  22. package/augment-extensions/workflows/agent-engineering/README.md +67 -0
  23. package/augment-extensions/workflows/agent-engineering/examples/contracts.cjs +89 -0
  24. package/augment-extensions/workflows/agent-engineering/examples/demo.cjs +17 -0
  25. package/augment-extensions/workflows/agent-engineering/examples/evaluation-cases.json +7 -0
  26. package/augment-extensions/workflows/agent-engineering/examples/graphs.cjs +149 -0
  27. package/augment-extensions/workflows/agent-engineering/examples/loop.cjs +125 -0
  28. package/augment-extensions/workflows/agent-engineering/examples/recovery.cjs +51 -0
  29. package/augment-extensions/workflows/agent-engineering/examples/stub.cjs +11 -0
  30. package/augment-extensions/workflows/agent-engineering/examples/verify.cjs +21 -0
  31. package/augment-extensions/workflows/agent-engineering/module.json +24 -0
  32. package/augment-extensions/workflows/agent-engineering/rules/01-adoption.md +30 -0
  33. package/augment-extensions/workflows/agent-engineering/rules/02-agents.md +34 -0
  34. package/augment-extensions/workflows/agent-engineering/rules/03-contracts.md +34 -0
  35. package/augment-extensions/workflows/agent-engineering/rules/04-loops.md +39 -0
  36. package/augment-extensions/workflows/agent-engineering/rules/05-graphs.md +39 -0
  37. package/augment-extensions/workflows/agent-engineering/rules/06-improvement.md +38 -0
  38. package/augment-extensions/workflows/agent-engineering/schemas/contracts.schema.json +1 -0
  39. package/augment-extensions/workflows/agent-engineering/scripts/validate.cjs +32 -0
  40. package/augment-extensions/workflows/agent-engineering/sources.md +12 -0
  41. package/augment-extensions/workflows/agent-engineering/templates/agent.json +40 -0
  42. package/augment-extensions/workflows/agent-engineering/templates/check-tool.json +94 -0
  43. package/augment-extensions/workflows/agent-engineering/templates/evidence.json +29 -0
  44. package/augment-extensions/workflows/agent-engineering/templates/invocation.json +40 -0
  45. package/augment-extensions/workflows/agent-engineering/templates/node.json +27 -0
  46. package/augment-extensions/workflows/agent-engineering/templates/state.json +27 -0
  47. package/augment-extensions/workflows/agent-engineering/templates/task.json +40 -0
  48. package/augment-extensions/workflows/agent-engineering/templates/tool.json +52 -0
  49. package/augment-extensions/workflows/cross-platform/README.md +120 -0
  50. package/augment-extensions/workflows/cross-platform/examples/end-to-end-session.md +196 -0
  51. package/augment-extensions/workflows/cross-platform/module.json +91 -0
  52. package/augment-extensions/workflows/cross-platform/rules/drift-resolution.md +126 -0
  53. package/augment-extensions/workflows/cross-platform/rules/export-guide.md +139 -0
  54. package/augment-extensions/workflows/cross-platform/rules/mcp-snippet-inlining.md +99 -0
  55. package/augment-extensions/workflows/cross-platform/rules/mirror-guide.md +139 -0
  56. package/augment-extensions/workflows/cross-platform/rules/windows-fallback.md +111 -0
  57. package/augment-extensions/workflows/decision-layer/README.md +172 -0
  58. package/augment-extensions/workflows/decision-layer/examples/call-inventory.json +6 -0
  59. package/augment-extensions/workflows/decision-layer/examples/config.json +9 -0
  60. package/augment-extensions/workflows/decision-layer/examples/decision.json +13 -0
  61. package/augment-extensions/workflows/decision-layer/examples/labeled-cases.json +410 -0
  62. package/augment-extensions/workflows/decision-layer/examples/source.txt +3 -0
  63. package/augment-extensions/workflows/decision-layer/examples/task.json +8 -0
  64. package/augment-extensions/workflows/decision-layer/installation/augx-judgments/SKILL.md +14 -0
  65. package/augment-extensions/workflows/decision-layer/installation/package-lock.json +27 -0
  66. package/augment-extensions/workflows/decision-layer/installation/package.json +7 -0
  67. package/augment-extensions/workflows/decision-layer/installation/sources.json +18 -0
  68. package/augment-extensions/workflows/decision-layer/module.json +24 -0
  69. package/augment-extensions/workflows/decision-layer/rules/00-index.md +5 -0
  70. package/augment-extensions/workflows/decision-layer/rules/01-responsibilities.md +15 -0
  71. package/augment-extensions/workflows/decision-layer/rules/02-operation.md +15 -0
  72. package/augment-extensions/workflows/decision-layer/runtime/automatic.cjs +80 -0
  73. package/augment-extensions/workflows/decision-layer/runtime/chat-install.cjs +149 -0
  74. package/augment-extensions/workflows/decision-layer/runtime/chat-server.cjs +71 -0
  75. package/augment-extensions/workflows/decision-layer/runtime/cli.cjs +70 -0
  76. package/augment-extensions/workflows/decision-layer/runtime/common.cjs +85 -0
  77. package/augment-extensions/workflows/decision-layer/runtime/contracts.d.ts +21 -0
  78. package/augment-extensions/workflows/decision-layer/runtime/decisions.cjs +198 -0
  79. package/augment-extensions/workflows/decision-layer/runtime/evaluate.cjs +61 -0
  80. package/augment-extensions/workflows/decision-layer/runtime/install.cjs +199 -0
  81. package/augment-extensions/workflows/decision-layer/runtime/integrations.cjs +64 -0
  82. package/augment-extensions/workflows/decision-layer/runtime/runner.cjs +201 -0
  83. package/augment-extensions/workflows/decision-layer/runtime/worker-child.cjs +15 -0
  84. package/augment-extensions/workflows/decision-layer/runtime/workers.cjs +15 -0
  85. package/augment-extensions/workflows/decision-layer/schemas/automatic-input.schema.json +40 -0
  86. package/augment-extensions/workflows/decision-layer/schemas/config.schema.json +39 -0
  87. package/augment-extensions/workflows/decision-layer/scripts/validate.cjs +16 -0
  88. package/augment-extensions/workflows/decision-layer/sources.md +34 -0
  89. package/cli/MODULES.md +804 -302
  90. package/cli/dist/__test_file-tracking.d.ts +2 -0
  91. package/cli/dist/__test_file-tracking.d.ts.map +1 -0
  92. package/cli/dist/__test_file-tracking.js +4 -0
  93. package/cli/dist/__test_file-tracking.js.map +1 -0
  94. package/cli/dist/analysis/ast-parser.d.ts.map +1 -1
  95. package/cli/dist/analysis/ast-parser.js +25 -9
  96. package/cli/dist/analysis/ast-parser.js.map +1 -1
  97. package/cli/dist/cli.js +43 -9
  98. package/cli/dist/cli.js.map +1 -1
  99. package/cli/dist/commands/context.d.ts +8 -0
  100. package/cli/dist/commands/context.d.ts.map +1 -0
  101. package/cli/dist/commands/context.js +115 -0
  102. package/cli/dist/commands/context.js.map +1 -0
  103. package/cli/dist/commands/decision.d.ts +4 -0
  104. package/cli/dist/commands/decision.d.ts.map +1 -0
  105. package/cli/dist/commands/decision.js +34 -0
  106. package/cli/dist/commands/decision.js.map +1 -0
  107. package/cli/dist/commands/gui-decision.d.ts +6 -0
  108. package/cli/dist/commands/gui-decision.d.ts.map +1 -0
  109. package/cli/dist/commands/gui-decision.js +210 -0
  110. package/cli/dist/commands/gui-decision.js.map +1 -0
  111. package/cli/dist/commands/gui-module-manager.d.ts +14 -0
  112. package/cli/dist/commands/gui-module-manager.d.ts.map +1 -0
  113. package/cli/dist/commands/gui-module-manager.js +328 -0
  114. package/cli/dist/commands/gui-module-manager.js.map +1 -0
  115. package/cli/dist/commands/gui.d.ts +3 -9
  116. package/cli/dist/commands/gui.d.ts.map +1 -1
  117. package/cli/dist/commands/gui.js +7 -293
  118. package/cli/dist/commands/gui.js.map +1 -1
  119. package/cli/dist/commands/link.d.ts +2 -0
  120. package/cli/dist/commands/link.d.ts.map +1 -1
  121. package/cli/dist/commands/link.js +82 -84
  122. package/cli/dist/commands/link.js.map +1 -1
  123. package/cli/dist/commands/search.js +1 -11
  124. package/cli/dist/commands/search.js.map +1 -1
  125. package/cli/dist/commands/show.d.ts.map +1 -1
  126. package/cli/dist/commands/show.js +5 -18
  127. package/cli/dist/commands/show.js.map +1 -1
  128. package/cli/dist/commands/skill.d.ts.map +1 -1
  129. package/cli/dist/commands/skill.js +3 -3
  130. package/cli/dist/commands/skill.js.map +1 -1
  131. package/cli/dist/commands/unlink.d.ts +2 -0
  132. package/cli/dist/commands/unlink.d.ts.map +1 -1
  133. package/cli/dist/commands/unlink.js +51 -45
  134. package/cli/dist/commands/unlink.js.map +1 -1
  135. package/cli/dist/commands/update.js +14 -7
  136. package/cli/dist/commands/update.js.map +1 -1
  137. package/cli/dist/core/compatibility-checker.d.ts.map +1 -1
  138. package/cli/dist/core/compatibility-checker.js +5 -2
  139. package/cli/dist/core/compatibility-checker.js.map +1 -1
  140. package/cli/dist/lib/context-hosts.d.ts +16 -0
  141. package/cli/dist/lib/context-hosts.d.ts.map +1 -0
  142. package/cli/dist/lib/context-hosts.js +395 -0
  143. package/cli/dist/lib/context-hosts.js.map +1 -0
  144. package/cli/dist/lib/context-refresh.d.ts +60 -0
  145. package/cli/dist/lib/context-refresh.d.ts.map +1 -0
  146. package/cli/dist/lib/context-refresh.js +630 -0
  147. package/cli/dist/lib/context-refresh.js.map +1 -0
  148. package/cli/dist/lib/module-resolver.d.ts.map +1 -1
  149. package/cli/dist/lib/module-resolver.js +2 -2
  150. package/cli/dist/lib/module-resolver.js.map +1 -1
  151. package/cli/dist/types/gui.d.ts +4 -0
  152. package/cli/dist/types/gui.d.ts.map +1 -1
  153. package/cli/dist/utils/coordination-queries.js +2 -2
  154. package/cli/dist/utils/coordination-queries.js.map +1 -1
  155. package/cli/dist/utils/decision-runner.d.ts +20 -0
  156. package/cli/dist/utils/decision-runner.d.ts.map +1 -0
  157. package/cli/dist/utils/decision-runner.js +114 -0
  158. package/cli/dist/utils/decision-runner.js.map +1 -0
  159. package/cli/dist/utils/extensions-config.d.ts.map +1 -1
  160. package/cli/dist/utils/extensions-config.js +3 -1
  161. package/cli/dist/utils/extensions-config.js.map +1 -1
  162. package/cli/dist/utils/extractCommandHelp.d.ts +2 -2
  163. package/cli/dist/utils/extractCommandHelp.d.ts.map +1 -1
  164. package/cli/dist/utils/extractCommandHelp.js +54 -24
  165. package/cli/dist/utils/extractCommandHelp.js.map +1 -1
  166. package/cli/dist/utils/file-tracking.js +5 -5
  167. package/cli/dist/utils/file-tracking.js.map +1 -1
  168. package/cli/dist/utils/glob-match.d.ts +6 -0
  169. package/cli/dist/utils/glob-match.d.ts.map +1 -0
  170. package/cli/dist/utils/glob-match.js +8 -0
  171. package/cli/dist/utils/glob-match.js.map +1 -0
  172. package/cli/dist/utils/gui-helpers.d.ts.map +1 -1
  173. package/cli/dist/utils/gui-helpers.js +7 -3
  174. package/cli/dist/utils/gui-helpers.js.map +1 -1
  175. package/cli/dist/utils/mcp-integration.d.ts.map +1 -1
  176. package/cli/dist/utils/mcp-integration.js +5 -7
  177. package/cli/dist/utils/mcp-integration.js.map +1 -1
  178. package/cli/dist/utils/module-system.d.ts +14 -0
  179. package/cli/dist/utils/module-system.d.ts.map +1 -1
  180. package/cli/dist/utils/module-system.js +39 -13
  181. package/cli/dist/utils/module-system.js.map +1 -1
  182. package/cli/dist/utils/modules-catalog.d.ts.map +1 -1
  183. package/cli/dist/utils/modules-catalog.js +5 -0
  184. package/cli/dist/utils/modules-catalog.js.map +1 -1
  185. package/cli/dist/utils/process.d.ts +14 -0
  186. package/cli/dist/utils/process.d.ts.map +1 -0
  187. package/cli/dist/utils/process.js +57 -0
  188. package/cli/dist/utils/process.js.map +1 -0
  189. package/cli/dist/utils/version.d.ts +2 -0
  190. package/cli/dist/utils/version.d.ts.map +1 -0
  191. package/cli/dist/utils/version.js +8 -0
  192. package/cli/dist/utils/version.js.map +1 -0
  193. package/cli/dist/utils/vscode-editor.d.ts.map +1 -1
  194. package/cli/dist/utils/vscode-editor.js +14 -8
  195. package/cli/dist/utils/vscode-editor.js.map +1 -1
  196. package/modules.md +85 -6
  197. package/package.json +36 -16
  198. package/scripts/check-wsl-augx.sh +63 -0
@@ -0,0 +1,43 @@
1
+ # Java Reliability and Concurrency
2
+
3
+ Use explicit contracts and ownership to make failures, resources, and shared state predictable.
4
+
5
+ ## Validate inputs and handle failures
6
+
7
+ - Validate untrusted or externally supplied values at the boundary where they enter the application. Keep domain invariants close to the type or operation that owns them.
8
+ - Use exceptions for exceptional failure, not routine branching. Select checked or unchecked exceptions according to the existing API and recovery contract; do not convert every failure into a generic `RuntimeException`.
9
+ - Catch an exception only where the code can recover, add useful context, translate it at a layer boundary, or complete required cleanup. Preserve the cause when translating. Do not catch `Throwable` for normal application flow.
10
+ - Never swallow an exception or log it and then report success. Include stable identifiers and operation context in logs, but exclude credentials, tokens, and sensitive payloads.
11
+ - Avoid using exceptions for expected absence when a return type or explicit result is clearer.
12
+ - Keep error messages useful to operators and safe for users. Do not return implementation details or stack traces through public APIs.
13
+
14
+ ## Manage resources with clear ownership
15
+
16
+ - Use try-with-resources for `AutoCloseable` resources so cleanup runs on both success and failure.
17
+ - Define who owns and closes streams, clients, executors, and other resources. Do not close a resource supplied by a caller unless the contract says ownership transfers.
18
+ - Avoid keeping sockets, files, database resources, or locks open longer than necessary. Set timeouts for network operations using the APIs and project defaults that apply.
19
+ - Use shutdown hooks only when the application lifecycle requires them. Prefer the existing framework or container lifecycle for managed services.
20
+
21
+ ## Keep concurrent state safe
22
+
23
+ - Prefer immutable values and confinement over shared mutable state. Make thread-safety assumptions visible in type and method documentation when they affect callers.
24
+ - Use the concurrency primitive that expresses the requirement: executor services for task lifecycle, atomics for simple shared values, locks for compound invariants, and concurrent collections for supported concurrent access. A concurrent collection does not make a multi-step workflow atomic.
25
+ - Preserve interruption. If a method cannot rethrow `InterruptedException`, restore the interrupt flag before translating or returning.
26
+ - Avoid blocking calls on event-loop or request threads when the surrounding framework requires non-blocking work. Do not introduce thread pools without defining capacity, queueing, rejection, shutdown, and cancellation behavior.
27
+ - Consider virtual threads only when the project's JDK supports them, dependencies are compatible, and workload measurements support the choice. Do not assume they make CPU-heavy work faster or remove the need for limits on scarce downstream resources.
28
+ - Avoid `ThreadLocal` state unless its lifecycle and cleanup are well-defined, especially in pooled threads.
29
+
30
+ ## Measure performance before tuning
31
+
32
+ - Choose an appropriate algorithm and data structure before micro-optimizing syntax. Use a representative profiler or benchmark when performance is material.
33
+ - Avoid repeated expensive work in loops, unbounded caches, unnecessary object retention, and accidental quadratic algorithms. Do not add caching without an invalidation and memory policy.
34
+ - Do not replace clear loops with streams or vice versa for assumed speed. Choose the form that best expresses the operation, and measure if speed is a requirement.
35
+ - Check allocation, I/O, lock contention, and database round trips at the relevant system boundary. Avoid speculative optimization based on tiny synthetic examples.
36
+
37
+ ## Apply security checks at trust boundaries
38
+
39
+ - Treat network, file, environment, and user input as untrusted. Validate type, length, range, and allowed values before use.
40
+ - Use parameterized APIs for database queries and safe encoders for output contexts. Do not assemble executable SQL, shell commands, HTML, or expression strings from untrusted input.
41
+ - Use maintained cryptographic libraries and documented algorithms. Do not create custom encryption, password hashing, or random-number schemes.
42
+ - Keep secrets out of source files, logs, test fixtures, and exception messages. Use the project's approved secret configuration and rotation path.
43
+ - Avoid unsafe deserialization and unrestricted polymorphic type handling for untrusted data. Review dependency and serialization behavior against the project's supported JDK and libraries.
@@ -0,0 +1,39 @@
1
+ # Java Testing, Tooling, and Documentation
2
+
3
+ Make changes repeatable through the project's existing build, test, and review workflow.
4
+
5
+ ## Test observable behavior
6
+
7
+ - Follow the project's existing test framework and directory conventions. Do not add another test framework for a small change.
8
+ - Write focused unit tests for domain logic and edge cases. Assert outcomes and behavior rather than private implementation details.
9
+ - Add integration tests where behavior depends on a real boundary such as persistence, serialization, network configuration, or framework wiring. Use isolated fixtures and deterministic inputs.
10
+ - Keep tests repeatable: control clocks, random values, environment, ordering, and shared state when they affect results. Clean up temporary files and resources.
11
+ - Test failure paths and invalid input when they form part of the contract. Do not test only that a method was called if the observable result matters.
12
+ - Keep the test command and target JDK consistent with CI. A test passing locally on a newer JDK does not prove compatibility with the project's minimum runtime.
13
+
14
+ ## Keep builds reproducible
15
+
16
+ - Use the checked-in Maven Wrapper or Gradle Wrapper. Preserve established plugin and dependency management.
17
+ - Set the Java toolchain or compiler release explicitly when the project supports it. Compile and test against the declared minimum release in CI, and use a separate job for newer supported runtimes where required.
18
+ - Keep dependency versions centrally managed through the existing parent, BOM, version catalog, or plugin conventions. Add only dependencies needed by the feature.
19
+ - Preserve deterministic builds and lock down versions according to project policy. Do not change wrappers, plugins, or build structure as an incidental cleanup.
20
+ - Run the narrow relevant build or test task first, then the broader checks required by the change and repository instructions. Report skipped commands accurately.
21
+
22
+ ## Document public contracts
23
+
24
+ - Add Javadoc when a public type or method has non-obvious purpose, constraints, lifecycle, threading, nullability, or failure behavior.
25
+ - Document observable behavior and examples rather than restating every method name. Keep documentation current when public behavior changes.
26
+ - Use comments to explain a reason, invariant, workaround, or surprising constraint. Remove stale comments instead of leaving contradictory guidance.
27
+
28
+ ## Review security and maintenance risks
29
+
30
+ - Check dependency provenance, maintenance, license policy, and known vulnerabilities using the repository's approved tools.
31
+ - Use least privilege for file, process, network, and cloud access. Avoid hard-coded credentials, insecure random values, and unsafe trust decisions.
32
+ - Check logs and error responses for secret or personal data exposure. Avoid logging full request bodies by default.
33
+ - Use maintained APIs supported by the project's baseline. Before replacing a deprecated API, verify the target library version and migration guidance.
34
+
35
+ ## Official references
36
+
37
+ - [Java SE specifications](https://docs.oracle.com/javase/specs/)
38
+ - [Maven toolchains](https://maven.apache.org/guides/mini/guide-using-toolchains.html)
39
+ - [Gradle Java toolchains](https://docs.gradle.org/current/userguide/toolchains.html)
@@ -0,0 +1,12 @@
1
+ # Changelog
2
+
3
+ All notable changes to this module are documented here.
4
+
5
+ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [1.0.0] - 2026-11-26
8
+
9
+ ### Added
10
+
11
+ - Initial Spring Framework and Spring Boot standards module covering configuration, web APIs, transactions, testing, security, and production operations.
12
+ - Added an illustrative Spring Boot 3+ MVC endpoint example using Jakarta Validation.
@@ -0,0 +1,61 @@
1
+ # Spring Framework and Spring Boot Standards
2
+
3
+ Version 1.0.0 provides practical guidance for applications built with Spring Framework and Spring Boot. The module is useful on its own and complements the Java Coding Standards module.
4
+
5
+ ## Overview
6
+
7
+ Use these rules for Spring-specific design and operation: constructor injection, bean lifecycle, Boot auto-configuration, external settings, Spring MVC or WebFlux, request validation, error handling, transaction boundaries, Spring testing, Spring Security, observability, health, and Actuator exposure.
8
+
9
+ The module does not prescribe a Spring release, database, deployment platform, or build tool. Inspect the consuming project's Spring Boot and Spring Framework versions, Java toolchain, dependency management, and official compatibility requirements before suggesting APIs or dependencies. Spring Cloud, Spring AI, Spring Batch, Spring Data, and other Spring portfolio projects are separate products. This module covers their integration only when an application already uses them and the concern is directly relevant.
10
+
11
+ ## Installation
12
+
13
+ Link the module directly:
14
+
15
+ ```bash
16
+ augx link coding-standards/spring
17
+ ```
18
+
19
+ Inspect its guidance with:
20
+
21
+ ```bash
22
+ augx show coding-standards/spring
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ 1. Identify the project's Spring Framework, Spring Boot, Spring Security, and Java versions before suggesting annotations, configuration keys, or dependencies.
28
+ 2. Choose the rule file for the concern: bean and Boot configuration, web APIs and security, data and tests, or production operations.
29
+ 3. Use this module for Spring-specific decisions. Link the Java module separately for general language, API, and platform guidance.
30
+
31
+ ## Contents
32
+
33
+ - [Beans, configuration, and Boot](rules/beans-configuration-and-boot.md): dependency injection, bean lifecycle, application structure, auto-configuration, and externalized settings.
34
+ - [Web APIs and security](rules/web-apis-and-security.md): MVC and WebFlux choice, endpoints, validation, consistent errors, and Spring Security.
35
+ - [Data, testing, and transactions](rules/data-testing-and-transactions.md): persistence boundaries, transaction behavior, unit tests, slices, and integration tests.
36
+ - [Production operations](rules/production-operations.md): production configuration, observability, health checks, graceful lifecycle, and safe Actuator exposure.
37
+ - [OrderController.java](examples/OrderController.java): an illustrative Spring Boot 3+ MVC endpoint using constructor injection and Jakarta validation. It is not a compiled project.
38
+
39
+ ## Relationship to Java guidance
40
+
41
+ [Java Coding Standards](../java/README.md) owns general Java language, API, exception, concurrency, build, testing, and security practices. This module owns Spring Framework and Spring Boot behavior. Link either module independently. When both are linked, apply Java rules to language choices and this module to framework choices, without duplicating general Java advice.
42
+
43
+ ## Version and source policy
44
+
45
+ Follow the versions declared by the consuming project and its supported Java baseline. Use the official compatibility and reference documentation for those exact versions. Do not add a starter or portfolio project just because an example uses it. Versioned details in examples are labeled so teams can adjust them to their own supported releases.
46
+
47
+ Official sources:
48
+
49
+ - [Spring projects](https://spring.io/projects)
50
+ - [Spring Framework reference](https://docs.spring.io/spring-framework/reference/)
51
+ - [Spring Boot reference](https://docs.spring.io/spring-boot/reference/)
52
+ - [Spring Boot system requirements](https://docs.spring.io/spring-boot/system-requirements.html)
53
+ - [Spring Security reference](https://docs.spring.io/spring-security/reference/)
54
+
55
+ ## Character count
56
+
57
+ The count covers every file in this module directory, including manifests, documentation, rules, and examples: see `module.json` and `metadata.json` for the verified total.
58
+
59
+ ## Changelog
60
+
61
+ See [CHANGELOG.md](CHANGELOG.md).
@@ -0,0 +1,40 @@
1
+ // Illustrative single-file Spring Boot 3+ MVC example using Jakarta Validation.
2
+ // Verify dependency versions, package layout, and validation setup against the consuming project.
3
+ package example.orders;
4
+
5
+ import jakarta.validation.Valid;
6
+ import jakarta.validation.constraints.NotBlank;
7
+ import org.springframework.http.HttpStatus;
8
+ import org.springframework.stereotype.Service;
9
+ import org.springframework.web.bind.annotation.PostMapping;
10
+ import org.springframework.web.bind.annotation.RequestBody;
11
+ import org.springframework.web.bind.annotation.RequestMapping;
12
+ import org.springframework.web.bind.annotation.ResponseStatus;
13
+ import org.springframework.web.bind.annotation.RestController;
14
+
15
+ @RestController
16
+ @RequestMapping("/orders")
17
+ class OrderController {
18
+ private final OrderService orderService;
19
+
20
+ OrderController(OrderService orderService) {
21
+ this.orderService = orderService;
22
+ }
23
+
24
+ @PostMapping
25
+ @ResponseStatus(HttpStatus.CREATED)
26
+ OrderResponse create(@Valid @RequestBody CreateOrderRequest request) {
27
+ return orderService.create(request);
28
+ }
29
+ }
30
+
31
+ record CreateOrderRequest(@NotBlank String reference) {}
32
+
33
+ record OrderResponse(String reference) {}
34
+
35
+ @Service
36
+ class OrderService {
37
+ OrderResponse create(CreateOrderRequest request) {
38
+ return new OrderResponse(request.reference());
39
+ }
40
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "name": "spring-standards",
4
+ "displayName": "Spring Framework and Spring Boot Standards",
5
+ "description": "Practical Spring Framework and Spring Boot guidance for dependency injection, configuration, web APIs, transactions, testing, security, and operations.",
6
+ "type": "coding-standards",
7
+ "language": "java",
8
+ "tags": [
9
+ "spring",
10
+ "spring-framework",
11
+ "spring-boot",
12
+ "java",
13
+ "dependency-injection",
14
+ "configuration",
15
+ "spring-mvc",
16
+ "webflux",
17
+ "validation",
18
+ "transactions",
19
+ "spring-security",
20
+ "actuator",
21
+ "testing"
22
+ ],
23
+ "compatibility": {
24
+ "augmentMinVersion": "1.0.0"
25
+ },
26
+ "characterCount": 24030,
27
+ "lastUpdated": "2026-11-26",
28
+ "files": {
29
+ "rules": [
30
+ "beans-configuration-and-boot.md",
31
+ "web-apis-and-security.md",
32
+ "data-testing-and-transactions.md",
33
+ "production-operations.md"
34
+ ],
35
+ "examples": [
36
+ "OrderController.java"
37
+ ]
38
+ }
39
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "spring-standards",
3
+ "version": "1.0.0",
4
+ "displayName": "Spring Framework and Spring Boot Standards",
5
+ "description": "Practical Spring Framework and Spring Boot guidance for dependency injection, configuration, web APIs, transactions, testing, security, and operations.",
6
+ "type": "coding-standards",
7
+ "author": "Augment Extensions",
8
+ "license": "MIT",
9
+ "tags": [
10
+ "spring",
11
+ "spring-framework",
12
+ "spring-boot",
13
+ "java",
14
+ "dependency-injection",
15
+ "configuration",
16
+ "spring-mvc",
17
+ "webflux",
18
+ "validation",
19
+ "transactions",
20
+ "spring-security",
21
+ "actuator",
22
+ "testing"
23
+ ],
24
+ "files": [
25
+ "rules/beans-configuration-and-boot.md",
26
+ "rules/web-apis-and-security.md",
27
+ "rules/data-testing-and-transactions.md",
28
+ "rules/production-operations.md",
29
+ "examples/OrderController.java"
30
+ ],
31
+ "dependencies": [],
32
+ "augment": {
33
+ "characterCount": 24030,
34
+ "priority": "high",
35
+ "category": "coding-standards",
36
+ "language": "java"
37
+ }
38
+ }
@@ -0,0 +1,39 @@
1
+ # Spring Beans, Configuration, and Boot
2
+
3
+ Use the Spring container deliberately. Keep application behavior explicit and configuration external to compiled code.
4
+
5
+ ## Inject dependencies and manage beans
6
+
7
+ - Prefer constructor injection for required collaborators. It makes dependencies visible, supports immutable fields, and lets a plain unit test construct the class without starting a container.
8
+ - Use Spring-managed beans for application services and infrastructure that need container lifecycle, configuration, or framework integration. Do not retrieve dependencies from the application context inside business code.
9
+ - Define a bean with `@Bean` when configuring a third-party type or when explicit factory logic is clearer than component scanning. Keep configuration focused and deterministic.
10
+ - Choose singleton scope unless per-request or per-operation state requires another scope. A singleton service should not keep mutable request state in fields.
11
+ - Keep constructors and bean initialization fast and side-effect light. Perform network calls or other fallible startup work only through an explicit lifecycle design with defined failure and shutdown behavior.
12
+ - Avoid circular dependencies. Extract a shared responsibility or change the direction of the dependency rather than hiding the cycle with setter injection or lazy lookups.
13
+ - Use lifecycle callbacks only for lifecycle work. Ensure external resources created by a bean have a corresponding managed close or destroy path.
14
+
15
+ ## Structure Spring Boot applications clearly
16
+
17
+ - Use one primary `@SpringBootApplication` entry point and place it above the application packages it should discover. Add component scanning or auto-configuration exclusions only for a documented reason.
18
+ - Organize code around the application's domain or features when that makes ownership and changes easier to follow. Keep HTTP controllers thin and delegate use cases to application services.
19
+ - Let auto-configuration provide conventional infrastructure when it matches the application. Add explicit beans to replace behavior intentionally, not preemptively.
20
+ - When configuration is surprising, inspect the condition report with the supported Boot diagnostic options before excluding classes or copying internal auto-configuration details.
21
+ - Keep framework annotations at the integration boundary where possible. Avoid spreading container lookups and framework-specific types through domain logic without a need.
22
+ - Do not mix APIs or configuration conventions from different Spring Boot generations without checking migration notes, dependency management, and supported Java versions.
23
+
24
+ ## Externalize and validate settings
25
+
26
+ - Put environment-specific settings in supported external configuration sources. Do not compile hostnames, credentials, tokens, or environment-specific paths into application code.
27
+ - Bind related settings to a typed configuration object when that improves validation and discoverability. Use direct property injection for a small isolated value when it is consistent with the codebase.
28
+ - Validate required configuration at startup and fail with a clear, non-secret diagnostic. Define safe defaults only for values that are genuinely optional.
29
+ - Use profiles for intentional environment-specific configuration, not as a replacement for a clear configuration model. Understand property-source precedence before relying on overrides.
30
+ - Keep secrets in the deployment's approved secret mechanism. Avoid committing secret values in properties, YAML, test fixtures, or build files. Redact them in logs and diagnostic endpoints.
31
+ - Add a new configuration source or secret manager only when the deployment actually requires it.
32
+
33
+ ## Official references
34
+
35
+ - [Spring Framework dependency injection](https://docs.spring.io/spring-framework/reference/core/beans/dependencies/factory-collaborators.html)
36
+ - [Spring bean lifecycle](https://docs.spring.io/spring-framework/reference/core/beans/factory-nature.html)
37
+ - [Spring Boot auto-configuration](https://docs.spring.io/spring-boot/reference/using/auto-configuration.html)
38
+ - [Spring Boot externalized configuration](https://docs.spring.io/spring-boot/reference/features/external-config.html)
39
+ - [Spring Boot system requirements](https://docs.spring.io/spring-boot/system-requirements.html)
@@ -0,0 +1,36 @@
1
+ # Spring Persistence, Testing, and Transactions
2
+
3
+ Put transaction and framework behavior at deliberate application boundaries, and test only the integration level each behavior needs.
4
+
5
+ ## Define transaction boundaries around use cases
6
+
7
+ - Place a transaction around an application operation that must commit or roll back as one unit. Keep the boundary on a Spring-managed service or application component rather than scattering it across controller methods.
8
+ - Review what the configured transaction manager controls. A database transaction does not automatically make HTTP calls, messages, files, or multiple independent stores atomic.
9
+ - Keep slow network calls and user interaction outside database transactions where possible. Holding a transaction open can retain locks and connections longer than necessary.
10
+ - Check the project's configured propagation, isolation, timeout, read-only, and rollback behavior. Do not assume that a method annotation alone gives the intended semantics for every exception or transaction manager.
11
+ - Understand proxy-based interception: calls made within the same object may not pass through the proxy. Avoid relying on an annotation for self-invocation; extract the transactional operation or use the documented programmatic approach when needed.
12
+ - Do not catch and suppress a failure inside a transaction if the caller expects rollback. Make rollback and retry policy explicit and safe for repeated execution.
13
+ - Keep persistence technology and repository APIs behind an application boundary where practical. Add Spring Data or another persistence project only when the application chooses it; it is outside this module's core scope.
14
+
15
+ ## Use the smallest Spring test context that proves the behavior
16
+
17
+ - Unit test domain and application logic without a Spring context when dependency wiring is not under test.
18
+ - Use a focused test slice for a web, persistence, or serialization boundary where the selected Spring version provides one. Keep the slice narrow and replace only external collaborators needed for isolation.
19
+ - Use `@SpringBootTest` when behavior depends on application configuration, auto-configuration, or interactions across several layers. Avoid loading the full context for every test.
20
+ - For web behavior, assert externally visible status, headers, and payload. For persistence, use isolated test data and verify constraints and transaction outcomes against the project's supported database setup.
21
+ - Test both success and failure paths, including validation, authorization, rollback, and startup configuration failures where those outcomes are contractual.
22
+ - Keep test properties deterministic and credentials fake. Do not weaken production security or transactions just to simplify a test.
23
+ - Verify test annotations and context setup against the exact Boot, Framework, JUnit, and test-library versions declared by the application.
24
+
25
+ ## Keep dependency management consistent
26
+
27
+ - Use the Spring Boot dependency management already selected by the project when available. Avoid pinning a Spring Framework or Spring test artifact independently without checking the supported dependency set.
28
+ - Add only the starter or testing support that is needed. Check whether the project already includes an equivalent dependency before suggesting another one.
29
+ - For a non-Boot Spring application, follow its existing dependency alignment and refer to the matching Framework documentation instead of assuming Boot's dependency management.
30
+
31
+ ## Official references
32
+
33
+ - [Spring declarative transaction management](https://docs.spring.io/spring-framework/reference/data-access/transaction/declarative.html)
34
+ - [Using `@Transactional`](https://docs.spring.io/spring-framework/reference/data-access/transaction/declarative/annotations.html)
35
+ - [Spring Boot testing](https://docs.spring.io/spring-boot/reference/testing/index.html)
36
+ - [Testing Spring Boot applications](https://docs.spring.io/spring-boot/reference/testing/spring-boot-applications.html)
@@ -0,0 +1,40 @@
1
+ # Spring Production Operations
2
+
3
+ Make runtime behavior diagnosable while keeping operational data and control endpoints protected.
4
+
5
+ ## Configure for each environment safely
6
+
7
+ - Keep operational settings outside the artifact and document required values, defaults, and validation. Fail startup when a required safety-critical value is missing or invalid.
8
+ - Use profiles and property sources intentionally. Verify precedence and active profiles in the exact Boot version rather than assuming a local configuration file wins.
9
+ - Set explicit connection, request, and shutdown timeouts for external resources using the settings supported by the chosen libraries. Bound queues and concurrency according to available capacity.
10
+ - Do not log secrets, full authorization headers, or sensitive request data. Use structured, consistently named fields and an appropriate request or trace identifier.
11
+
12
+ ## Add observability that answers operational questions
13
+
14
+ - Use the project's supported logging and observability integrations. Record failures with useful context and avoid logging the same exception at every layer.
15
+ - Expose health and metrics only to the monitoring system that needs them. Review endpoint access, exposure, sanitization, network binding, and authentication together.
16
+ - A health response should communicate actionable health without revealing environment values, credentials, or internal topology.
17
+ - Separate liveness from readiness. Liveness should reflect whether the process can continue; do not make it fail solely because a downstream service is temporarily unavailable. Readiness may reflect whether the application can safely receive traffic, according to its deployment contract.
18
+ - Do not add an observability backend or deployment platform as a prerequisite when the project has not selected one.
19
+
20
+ ## Expose Actuator deliberately
21
+
22
+ - Treat Actuator endpoints as operational interfaces. Expose only the endpoints the deployment requires, and control access using the supported security configuration.
23
+ - Review the data returned by environment, configuration, mappings, beans, loggers, and similar diagnostic endpoints before exposing them beyond a trusted boundary.
24
+ - Keep health detail and component indicators at the minimum level appropriate for the intended audience.
25
+ - Do not assume an endpoint is unavailable simply because it is not exposed over HTTP; review every configured management transport and port.
26
+ - Test access control and the public health contract in the production configuration profile, not only in a development profile.
27
+
28
+ ## Manage lifecycle and failure recovery
29
+
30
+ - Use framework lifecycle and graceful shutdown support so in-flight work can complete within the deployment's termination window.
31
+ - Make background work cancellable and bounded. Ensure executors and clients are closed when their owning context ends.
32
+ - Make retries explicit, bounded, and safe for duplicate execution. Avoid retrying non-idempotent operations without an idempotency design.
33
+ - Record startup and shutdown failures clearly while withholding secret configuration values.
34
+ - Check the current Spring Boot operations and Actuator documentation for settings supported by the application's exact release.
35
+
36
+ ## Official references
37
+
38
+ - [Spring Boot Actuator endpoints](https://docs.spring.io/spring-boot/reference/actuator/endpoints.html)
39
+ - [Spring Boot externalized configuration](https://docs.spring.io/spring-boot/reference/features/external-config.html)
40
+ - [Spring Boot system requirements](https://docs.spring.io/spring-boot/system-requirements.html)
@@ -0,0 +1,43 @@
1
+ # Spring Web APIs and Security
2
+
3
+ Keep transport concerns at the web boundary. Choose the web stack to match the application's I/O model and security requirements.
4
+
5
+ ## Choose MVC or WebFlux intentionally
6
+
7
+ - Prefer Spring MVC for conventional servlet applications, especially when the application and its dependencies use blocking I/O.
8
+ - Choose WebFlux when non-blocking request handling and reactive composition are requirements across the relevant call path. Evaluate client libraries, persistence access, streaming needs, operational skills, and measured workload before choosing it.
9
+ - Do not call blocking database, file, or network APIs on a reactive event loop. If a blocking boundary is unavoidable, isolate it using the supported scheduler and capacity controls for the project's Reactor and Spring versions.
10
+ - Avoid converting between imperative and reactive types repeatedly. A reactive controller does not make blocking dependencies non-blocking.
11
+ - Use the testing and client tools appropriate to the chosen stack. Check the current reference for supported test clients and server setup.
12
+
13
+ ## Design endpoints around validated contracts
14
+
15
+ - Keep controllers focused on HTTP mapping, request binding, validation, and response translation. Delegate business rules and multi-step use cases to an application service.
16
+ - Use dedicated request and response types instead of binding untrusted JSON directly to persistence entities or internal domain state.
17
+ - Validate request bodies and parameters at the boundary. Combine framework validation with domain checks; boundary validation does not replace business invariants.
18
+ - Return appropriate status codes and stable response shapes. Do not expose Java exception names, stack traces, SQL messages, internal paths, or secrets in error responses.
19
+ - Centralize cross-cutting exception-to-response mapping where that keeps behavior consistent. Map known failures deliberately and keep unexpected failures generic to clients while recording safe diagnostic context.
20
+ - Add API contract, serialization, and compatibility checks when clients depend on the endpoint shape.
21
+
22
+ ## Apply Spring Security as the security boundary
23
+
24
+ - Use Spring Security's supported authentication and authorization mechanisms. Do not create a handwritten password store, request filter chain, token verifier, or role check when Spring Security provides the security integration.
25
+ - Define authorization rules for every route and method, starting from deny-by-default or authentication-required behavior and then opening only intentional public endpoints.
26
+ - Enforce authorization close to sensitive operations as well as at the HTTP boundary when the application has non-HTTP entry points. Use the currently supported API for the project's Spring Security version.
27
+ - Preserve CSRF protections for browser sessions unless the threat model and protocol justify a documented alternative. Configure CORS narrowly for known origins and methods; CORS is not authorization.
28
+ - Use secure password storage and vetted identity providers or protocols. Avoid leaking authentication failures, token contents, or user existence through responses and logs.
29
+ - Restrict access to operational endpoints and administration routes. Test both permitted and rejected cases, including unauthenticated and underprivileged callers.
30
+
31
+ ## Keep tests focused on the web contract
32
+
33
+ - Use framework slice tests for the controller or web configuration boundary when possible, and full application tests only when auto-configuration or cross-layer behavior is part of the contract.
34
+ - Exercise validation failures, status codes, content types, response bodies, and security rules. Avoid tests that only assert the controller delegates to a mock.
35
+ - Keep test configuration and credentials isolated. Never use production secrets or shared production data in a test.
36
+
37
+ ## Official references
38
+
39
+ - [Spring Boot servlet web applications](https://docs.spring.io/spring-boot/reference/web/servlet.html)
40
+ - [Spring Framework WebFlux](https://docs.spring.io/spring-framework/reference/web/webflux.html)
41
+ - [Spring MVC validation](https://docs.spring.io/spring-framework/reference/web/webmvc/mvc-controller/ann-validation.html)
42
+ - [Spring MVC exception handling](https://docs.spring.io/spring-framework/reference/web/webmvc/mvc-controller/ann-exceptionhandler.html)
43
+ - [Spring Security request authorization](https://docs.spring.io/spring-security/reference/servlet/authorization/authorize-http-requests.html)
@@ -24,7 +24,7 @@
24
24
  "augmentMinVersion": "1.0.0",
25
25
  "nodeMinVersion": "18.0.0"
26
26
  },
27
- "characterCount": 302930,
27
+ "characterCount": 304728,
28
28
  "lastUpdated": "2026-11-08",
29
29
  "files": {
30
30
  "rules": [
@@ -23,7 +23,7 @@
23
23
  "augment": {
24
24
  "inject": "on-demand",
25
25
  "priority": "medium",
26
- "characterCount": 302930,
26
+ "characterCount": 304728,
27
27
  "contexts": [
28
28
  "design",
29
29
  "ui",
@@ -38,7 +38,7 @@
38
38
  "desktop"
39
39
  ]
40
40
  },
41
- "characterCount": 302930,
41
+ "characterCount": 304728,
42
42
  "contents": {
43
43
  "core": [
44
44
  "VERSION",
@@ -0,0 +1,67 @@
1
+ # Agent Engineering
2
+
3
+ ## Overview
4
+
5
+ Reusable guidance for creating agents and designing the harness, loop, and graph around them. Start with one task and a check that can reject a bad result. Add machinery only for an observed need. This module supplies static rules and local executable fixtures, not an orchestration service.
6
+
7
+ ## Contents
8
+
9
+ - [Responsibilities and adoption](rules/01-adoption.md)
10
+ - [Agent roles, delegation, and ownership](rules/02-agents.md)
11
+ - [Contracts, evidence, and trust](rules/03-contracts.md)
12
+ - [Bounded loops and recovery](rules/04-loops.md)
13
+ - [Graphs and durable state](rules/05-graphs.md)
14
+ - [Controlled improvement and evaluation](rules/06-improvement.md)
15
+ - [Source review and attribution](sources.md)
16
+ - [Machine-readable schemas](schemas/contracts.schema.json)
17
+ - [Agent](templates/agent.json), [invocation](templates/invocation.json), [task](templates/task.json), [tool](templates/tool.json), [checker tool](templates/check-tool.json), [node](templates/node.json), [evidence](templates/evidence.json), and [state](templates/state.json) templates
18
+ - [Loop controller](examples/loop.cjs), [graph examples](examples/graphs.cjs), [recovery and replay](examples/recovery.cjs), [saved cases](examples/evaluation-cases.json)
19
+ - [Executable demo](examples/demo.cjs) and [module validator](scripts/validate.cjs)
20
+
21
+ ## Installation
22
+
23
+ ```bash
24
+ augx link workflows/agent-engineering
25
+ augx show workflows/agent-engineering rules/01-adoption.md
26
+ ```
27
+
28
+ Linking loads static guidance. It does not execute examples or change permissions. Use the CLI from a checkout or installed package that contains this module. Existing installed releases will not discover unpublished source changes.
29
+
30
+ ## Usage
31
+
32
+ From this module directory, with Node.js and the package's existing Ajv dependency installed:
33
+
34
+ ```bash
35
+ node scripts/validate.cjs
36
+ node examples/demo.cjs loop repair ./local-repair
37
+ node examples/demo.cjs loop exhaust ./local-exhaust
38
+ node examples/demo.cjs loop stall ./local-stall
39
+ node examples/demo.cjs loop denied ./local-denied
40
+ node examples/demo.cjs loop error ./local-error
41
+ node examples/demo.cjs loop transient ./local-transient
42
+ node examples/demo.cjs loop timeout ./local-timeout
43
+ node examples/demo.cjs graph chain ./local-chain
44
+ node examples/demo.cjs graph router ./local-router
45
+ node examples/demo.cjs graph fan-out ./local-join
46
+ node examples/demo.cjs graph cycle ./local-cycle
47
+ ```
48
+
49
+ Use a new explicitly chosen disposable directory for each scenario. Repeating a command resumes its compatible checkpoint and preserves accounting. Exit 0 means the selected fixture succeeded, 1 means a terminal non-success, and 2 means invalid input, an ownership conflict, incompatible state, or a filesystem failure requiring local inspection. Ctrl+C requests cancellation and kills a running loop subprocess. No external handoff is sent.
50
+
51
+ Example loop defaults are five total attempts, twelve subprocess calls, five seconds including downtime, 750 milliseconds per call, two rounds without improved score, and one worker. The `exhaust` CLI scenario narrows attempts to two to expose exhaustion before stall. The independent checker rejects the first `repair` candidate and accepts the repaired candidate. Check records bind the file bytes, contract, protected code, and caller-supplied revision. The revision is a fixture identity; an adapter must supply the actual repository revision and dirty-candidate digest.
52
+
53
+ The controller owns `state.json`, `receipt.json`, and `handoff.json`; the worker can only return a small candidate for the controller to write to `candidate.json`. Graph examples use `graph-state.json` and `graph-receipt.json`. All joins require every named branch. Fan-out is intentionally executed sequentially, demonstrating the same data contract without native subagents. Branch outputs survive later branch failures for inspection; failed graphs require a reviewed repair plan rather than automatic terminal-state reset.
54
+
55
+ ## Limits and Recovery
56
+
57
+ These are deterministic fixtures, not provider or production evidence. No provider token, request-price, or monetary cap is claimed: no provider is called. Actual adapters must reserve aggregate requests and tokens, reconcile measured usage including failures, and enforce spend externally where possible. Report unknown cost as unknown.
58
+
59
+ There is no OS sandbox. Fixed subprocesses receive no inherited credentials, but a same-user hostile process could alter files or race path checks. Trusted graph handlers must honor cancellation; JavaScript cannot forcibly stop an arbitrary synchronous handler. Use isolated processes or containers with enforced filesystem, network, credential, and process restrictions before executing untrusted code. Full external diagnostics must remain in a separately protected, redacted local artifact; the demo's small typed outputs are its complete diagnostics and are capped at 32 KiB.
60
+
61
+ Atomic checkpoints use a temporary file, fsync, rename, checksum, and an exclusive writer lock. A crash can consume allocation without producing output. Never refund counters automatically. Preserve corrupt checkpoints and incomplete temporary files, inspect the candidate and last durable evidence, then start a new run directory with a reviewed contract. A stale lock is not a lease: inspect its PID, confirm no writer remains, and explicitly remove only that lock after reconciliation. Do not clear locks by age. File fsync and rename are not a promise against every filesystem or power failure.
62
+
63
+ Graph handlers and runtime contracts are version-bound. The scheduler supports DAGs and bounded single-node repair cycles; multi-node cycles need a different scheduler. Callers must version closed-over handler configuration in the revision. For real external effects, use service-supported idempotency or reconcile the service state after a crash. [localEffect](examples/recovery.cjs) demonstrates duplicate-trigger and crash-window reconciliation for a local artifact only. No exactly-once guarantee is made.
64
+
65
+ ## Character Count
66
+
67
+ The loader counts UTF-8-decoded JavaScript string lengths across every module file, including this README, schema, examples, and manifest. `node scripts/validate.cjs --update-count` reconciles the self-inclusive manifest count; plain validation is read-only. Export aggregation reads `rules/`, so example state, templates, source references, and saved evaluation cases are not inserted into native rule surfaces. Keep execution directories outside the module when using it from a checkout.