ToleranceArena Community Edition: AI clearance discovery and verified repair
Version: 1.4
Research and revision date: 28 November 2026 (UTC)
Target release: 0.1.0-kiroween | Category: Frankenstein
First-party license: European Union Public Licence, version 1.2 only; SPDX EUPL-1.2
Selected agent runtime: Strands Agents SDK, core Python strands-agents[openai] package, instantiated directly with strands.Agent. No assembled harness.
Inference: Groq Chat Completions at https://api.groq.com/openai/v1; default openai/gpt-oss-120b, explicit alternative openai/gpt-oss-20b; no automatic provider or model fallback.
Audience: Claude Code or Codex for the bounded bootstrap; Kiro IDE and Kiro CLI for subsequent implementation; the owner and reviewers
Status: A development specification. Source checks and analytical calculations support the decisions below. No ToleranceArena implementation, native CAD run, live model run, resolved dependency lock, or distributable binary has been validated in this revision.
This document supersedes Community spec v1.3. It remains a subset of the general product plan: a local, reproducible geometric verification tool with a bounded AI workflow. The required advanced feature remains AI-proposed numeric repair with verified before/after comparison. The runtime is now the core Strands Agents SDK (not the assembled harness), with Groq as the only Community inference provider. No engineering acceptance condition, Community license or bootstrap boundary is relaxed by this revision.
Start here: immediate execution contract
Start with one working measurement, validate it, then continue through the gates. The expanded submission target does not expand Claude's bootstrap assignment.
- B0, Claude Code by default: build only the two-cylinder rotating-pin fixture, a real native distance query, an independent mathematical oracle, a small CLI/sweep, focused tests, and the shared project instructions. Codex may fill this same role if the owner chooses it. Stop when B0 passes, the available quota approaches exhaustion, a native blocker prevents progress, or Kiro access becomes available.
- Kiro IDE after handoff: review the actual checkpoint, refine feature requirements and design properties, validate native steering/spec recognition, use the supported Correctness workflow, and exercise useful hooks.
- Kiro CLI after handoff: finish the CAD and verifier gates, then implement bounded search and replay, the local viewer, the Strands integration, and the required repair comparison. The IDE reviews the work at each gate.
- Claude after renewal: optional independent review or an explicitly assigned disjoint task. Do not silently take over work reserved for Kiro.
- One developer instruction system:
.kiro/steering/and.kiro/specs/, indexed by rootAGENTS.md. Do not createCLAUDE.md,CLAUDE.local.md, or another project memory tree. Explicit file loading is configuration, not model training or evidence of Kiro execution. - Private development, public submission: keep the Community repository private while building. Prepare the complete public release before the contest deadline, with a target of 3 December. Retain truthful tool provenance and public-safe history. Do not include the private commercial specification.
Read the actual current Claude allowance and Kiro access status. Earlier quota and credit-arrival estimates are historical context, not a new countdown or guaranteed work capacity. No percentage implies a known token budget. Keep account identifiers and exact subscription balances outside the public repository; the public workflow only needs the bounded bootstrap and honest contribution record.
The finished submission should demonstrate: nominal inspection; AI-assisted discovery of a measured clearance violation; offline counterexample replay; one permitted AI-proposed nominal dimension change; deterministic retesting under the original requirements; and a synchronized 3D comparison. All of that code, prompts, fixtures, and replay logic belongs to the public Community edition.
Revision decisions and verification status
| Item | Decision or correction | Evidence status |
|---|---|---|
| Agent implementation | Direct strands.Agent from strands-agents[openai]; reuse the model/tool loop and OpenAI-compatible adapter | Current SDK source and docs checked [A02][A04][A05]; installed behavior gated in M5 |
| Candidate agent versions | strands-agents[openai]==1.68.0, initial candidate carried forward from v1.3; resolve and lock the OpenAI client and HTTPX | Prior release metadata [A03]; current main manifest checked [A13]; exact wheel compatibility not tested |
| Agent capabilities | Explicit allowlisted tools, no assembled harness, plugins, sessions, automatic context tools, dynamic loading, remote tools or delegation | Direct Agent constructor reviewed [A04]; negative capability tests required |
| Dependency footprint | Core SDK still declares AWS, MCP, HTTPX and telemetry packages; current OpenAI extra also declares an AWS token helper. No harness, Anthropic extra or Monty requested | Current source manifest [A13]; released wheel metadata/SBOM required |
| Inference provider | Groq only, GPT-OSS 120B default, 20B explicit alternative; Chat Completions, sequential local tools | Groq compatibility, reasoning and tool docs [A16][A17][A18]; actual account and integration pending |
| Provider compatibility | First use non-streaming model calls, SDK structured-output workflow, no simultaneous native JSON Schema mode and tools; enforce all sends and test actual request/response format | SDK OpenAI adapter [A05], Groq docs [A16][A17][A19]; mock and live gates required |
| Advanced feature | Promote one bounded repair and verified comparison to M6, after a working MVP and Strands integration | Detailed contract in section 6.5; no implemented feature claimed |
| Demo arithmetic | At the adverse pose, original radius 46.0 mm gives 0.8 mm; proposed radius 46.8 mm gives 1.6 mm | Independent Python arithmetic and geometric derivation checked; native CAD confirmation pending |
| Containment | InnerSolution() indicates partial or complete inclusion, not proof of full containment | Official OCCT reference checked [S08][S24] |
| Repair identity | Freeze the engineering policy separately from each design revision; a new design needs new evaluation IDs | Architecture correction; implementation tests required |
| Licensing | First-party Community code remains EUPL v1.2 only; Strands keeps Apache-2.0 and its notices | Primary license/compatibility sources checked [H3][H13][H14][A14][A15]; artifact-specific audit pending |
| Contest and coding tools | Meaningful Kiro use, public GitHub and tracked root .kiro; no exclusive-Kiro claim | Official contest and tool documents checked [H1][H2][H4][H5][H7] |
| Performance and advantage | No GPU required by this design; no throughput, AI superiority, production readiness or startup moat asserted | Measure on the target laptop; compare with numerical baselines |
Exact version candidates are starting points for a reproducible install, not promises that the entire stack resolves. If a candidate fails, record the failure, test a nearby supported release, update the lock and ADR, and rerun the affected gates. Do not silently replace Strands with another framework or a hand-written loop.
Contents
- 1. Mandate and execution priorities
- 2. Contest constraints and release scope
- 3. Architecture and CAD selection
- 4. Engineering model and correctness rules
- 5. Data contracts and file formats
- 6. Verification, search and bounded repair
- 7. Local application, jobs, API and interface
- 8. Strands Agents SDK and Groq integration
- 9. Technology stack and dependency register
- 10. EUPL-1.2 licensing, ownership and publication gate
- 11. Step-by-step implementation plan
- 12. Shared coding-agent and Kiro workflow
- 13. Testing and benchmark requirements
- 14. Risks, scope cut decisions and definition of done
- 15. Sources and implementation evidence
1. Mandate and execution priorities
Build an AI-assisted mechanical engineering verification application that searches for hidden clearance violations in moving assemblies under specified manufacturing variations. A deterministic CAD engine checks every candidate, records the actual measurements and enables offline replay. The combination of AI hypothesis generation, computational geometry, numerical optimization and software-style counterexamples is the Frankenstein theme.
Start simple, validate that it works, and continue only after each gate passes. Implement a small local engineering engine before the viewer or AI. This document is a narrowed, standalone adaptation of the existing general product plan. It carries forward the same engineering semantics, modular architecture and preferred dependencies, with EUPL-1.2 replacing the earlier Apache-2.0 proposal for first-party Community code. Do not copy unrelated product planning or confidential material into the public repository.
1.1 Non-negotiable coding-agent instructions
- Begin with B0 in section 11. Inspect the repository, read AGENTS.md and the active
.kirosteering/spec files, and implement the next unmet bootstrap task. After handoff, resume the full H0/M0/M1 gates. Do not scaffold all future features at once. - Use Claude Code only for the B0 bootstrap by default (Codex is an owner-selected substitute). After handoff, Kiro CLI owns outstanding engineering implementation, search, replay, application/viewer and bounded AI work; Kiro IDE owns native specs, correctness properties, hooks and integration review. Switch immediately when authorized Kiro access is available. Later Claude review or supporting tasks require explicit reassignment and available quota. The single project instruction source is
.kiro/steering/and.kiro/specs/, with a short rootAGENTS.mdentry point. Do not create or use anyCLAUDE.mdor equivalent parallel project memory. See section 12. - Use real installed APIs and real geometry. Code snippets are proposed contracts, not existing implementation. Never replace a failing native query with a mocked successful engineering result.
- Keep the deterministic verifier independent of the UI, LLM and internet. No GPU or training is needed. CPU performance and memory use must be measured on the supported laptop/Linux target.
- Do not replace proven permissive libraries just to decrease package count. Introduce them when they solve an actual task. Record architectural changes and evidence in short ADRs.
- Every accepted task has actual tests, run commands, observed output and a meaningful definition of done. Record blocked tasks honestly. Preserve user work. Do not change public scope, license or engineering requirements without an explicit decision.
- Never expose secrets, employer/client code, customer models, unapproved assets, private plans or personal data. No arbitrary model-generated code execution. External deployment and publication follow the owner's existing authorization; prepare a concrete reviewed release before any final approval that is still needed.
- Keep a progress record with the current milestone, completed work, unresolved blockers and the next step. Do not claim that a tool executed an action when it did not.
1.2 Priority hierarchy
| Priority | Contents | Release decision |
|---|---|---|
| P0 | Native compatibility, analytical fixtures, static verification, one revolute joint, bounded variations, seeded search, replay, CLI, basic 3D viewer, genuine Kiro implementation | Mandatory for a viable submission |
| P1 | Actual Strands failure analyst; AI-proposed bounded repair; verified synchronized before/after comparison; evidence export and replay | Required for the requested AI-assisted submission target, after P0 passes |
| P2 | Counterexample reduction, supported STEP import UI, persistent local projects, extra search methods and mechanisms | Defer until P0/P1 and release checks pass |
| Out of scope | Autonomous multi-agent co-evolution, unconstrained geometry generation, arbitrary parametric history reconstruction, complete GD&T, physical certification, FEA, dynamics, multi-user hosting, payments | Do not implement or advertise in the hackathon |
If time is short, remove P2 features, narrow the supported inputs and simplify the UI, not verification, evidence, licensing or contest compliance. If runtime AI fails, describe the project accurately as a deterministic application built with AI coding tools; do not label a scripted fallback as a live LLM.
2. Contest constraints and release scope
2.1 Kiroween rules and submission gate
Official sources were rechecked on 27 November 2026. Recheck [H1] before submitting; the organizer's current rules govern eligibility and judging.
Submission facts. The deadline is 4 December 2026, 14:00 PST / 22:00 UTC / 16:00 America/Mexico_City. Required deliverables include a functional application URL, public GitHub repository containing necessary code/assets/instructions, detectable open-source license, tracked root .kiro/, feature description, category selection, public YouTube demonstration under three minutes, and a Kiro-use writeup. English materials are required. [H9][H1]
The project must be newly developed during the submission period, 30 October–4 December. Libraries and frameworks are allowed; disclose incorporated pre-existing work. Kiro must contribute substantively; judges determine adequacy. No exclusive-Kiro rule or fixed percentage was found. Judges need free, unrestricted testing access through 29 January 2027. Verify actual residence, team and rights eligibility; an intention to start a business does not establish startup-bonus eligibility. The entrant retains ownership, subject to the contest's judging and publicity permissions. [H1]
Credits. Participants can request 4,000 Kiro credits with the required account and identity verification. Request by 1 December, 12:00 PST / 14:00 America/Mexico_City; allow 48 business hours. Redeem by 4 December. The earlier expectation of receipt in 40 elapsed hours is a planning estimate, not an entitlement or guarantee. Check actual access before assigning a Kiro task. [H15]
Project release policy. Develop the Community repository privately, then target publication on 3 December, leaving time to test anonymous access and correct packaging. This target is our schedule, not a contest deadline. Audit the complete history, branches, tags, generated artifacts, and configuration before changing visibility. Removing a secret or private document from the latest commit does not remove it from history. Keep the general commercial spec and customer material outside this repository from the start. The rewrite itself neither creates a repository nor changes its visibility.
The Claude B0 bootstrap remains limited to its documented stop conditions. Subsequent Kiro IDE/CLI work must be real, reviewable implementation and testing. Log the tools actually used in docs/KIRO_USAGE.md; configuration files alone do not prove Kiro use. Include Claude's bootstrap contribution and never describe this mixed workflow as exclusively Kiro-built.
Before submission, open the public repository and deployed synthetic demo without the developer's session. Rehearse the documented judge workflow, download and replay its evidence, and verify that every advertised Community feature is reproducible from public code. Freeze a tested submission tag. If a local-only distribution leaves the required functional URL unclear, obtain organizer clarification before relying on it.
2.2 Product statement and user journey
ToleranceArena Community Edition helps mechanical engineers reproduce geometric requirement violations within a declared motion and manufacturing uncertainty domain. It is a local investigation tool, not a design certification authority.
- Open the built-in rotating-pin example.
- Inspect the nominal geometry, joint axis, allowed motion, explicit uncertainty bounds and minimum clearance.
- Run the nominal/sampled sweep and display the checked scope.
- Run classical search or AI-assisted bounded scenario discovery.
- Select the confirmed violation: see the pose, affected occurrences, witness points where available, distance, threshold and deviations.
- Export the counterexample and replay it in a fresh process without a model or internet access.
- Ask the restricted repair role for one permitted nominal-radius change, review it, and run paired deterministic validation under the unchanged engineering policy.
- Compare both designs at the same pose, inspect completion counts, and export/replay the comparison before choosing an active revision.
The app must be genuinely useful without an API key. A supplied, correctly labeled saved AI trace can be replayed for demonstration, but it cannot substitute for validating a live integration before advertising it.
2.3 Exact first geometry fixture (single moving pin)
Start with the trusted rotating_pin_v1 template. It models a moving cylindrical pin on a rotating arm, passing a fixed cylindrical obstacle. For B0, only the two cylinders need physical CAD solids; an optional arm and base are explanatory visuals, not part of the checked pair. Do not infer joints or tolerances from arbitrary STEP files. All dimensions are synthetic test values, not manufacturing recommendations.
| Property | Value |
|---|---|
| Moving pin | Solid cylinder radius 2 mm, height 8 mm, z=0..8 mm |
| Pin orbit | Center at radial distance 40 mm from world origin |
| Hinge | World origin, +Z axis, angle q from 0 to 90 degrees inclusive |
| Obstacle | Solid cylinder radius 2 mm, same axial interval; center at polar radius 46 mm and angle 45 degrees |
| Uncertainty | Obstacle radial placement offset delta in [-1.2, +1.2] mm, applied along the fixed 45-degree direction |
| Checked pair | pin, obstacle; no other clearance claim |
| Minimum clearance | 1.50 mm |
| Nominal minimum | 2.00 mm at q=45 degrees, delta=0 |
| Known adverse minimum | 0.80 mm at q=45 degrees, delta=-1.2 mm |
Independent analytic reference: set a = pi/4, r = 46 + delta, and use radians for q. The centers are (40*cos(q), 40*sin(q)) and (r*cos(a), r*sin(a)). The positive surface-to-surface clearance is
import math
def reference_clearance_mm(
q_deg: float, delta_mm: float, nominal_radius_mm: float = 46.0
) -> float:
values = (q_deg, delta_mm, nominal_radius_mm)
if any(isinstance(v, bool) or not isinstance(v, (int, float))
for v in values):
raise ValueError("coordinates must be numeric, not strings or booleans")
if not all(math.isfinite(v) for v in values):
raise ValueError("non-finite scenario")
if not 0.0 <= q_deg <= 90.0 or not -1.2 <= delta_mm <= 1.2:
raise ValueError("scenario outside fixture bounds")
if not 46.0 <= nominal_radius_mm <= 47.0:
raise ValueError("design outside fixture bounds")
q = math.radians(q_deg)
a = math.pi / 4
r = nominal_radius_mm + delta_mm
return math.hypot(40.0 * math.cos(q) - r * math.cos(a),
40.0 * math.sin(q) - r * math.sin(a)) - 4.0
For this fixture the equal axial intervals and parallel axes make the planar expression valid for the 3D solids. B0 uses the default nominal_radius_mm=46.0; A1 passes the reviewed revision's value explicitly. The triangle inequality bounds center separation below by r - 40, achieved at q=45 degrees, so the original design's entire declared domain is separated by at least 0.8 mm; its nominal minimum is 2.0 mm. This is a proof about the idealized reference fixture only, not the general CAD verifier. Do not use the formula as a substitute for the native measurement. The analytic helper is a test oracle for this exact template/domain and must not serve arbitrary overlapping solids or signed penetration depths.
For the bootstrap, build both cylinders with their actual positions and verify CAD distance for q=45 degrees, delta=0 and delta=-1.2. Test several other poses and a common rigid transform. Compare with an explicit absolute numerical tolerance (initial candidate 1e-5 mm, subject to observed kernel behavior and justified revision); distinguish it from the engineering minimum. A failure means measured gap is below 1.5 mm outside the ambiguity band. Invalid bounds, nonfinite inputs, kernel failures, or ambiguous results are not passes. Print the actual CAD and reference measurements with checked scope. Never hardcode expected values as native measurements.
A coarse sweep at q in {0,30,60,90} degrees can miss the known violating pose at q=45 degrees and delta=-1.2 mm. Use the same fixture for the later M2 regression: confirm the miss and the independently known violation using actual native queries. Label sampled campaigns as sampled, even if the mathematical oracle establishes the true minimum for this specific reference geometry. Use more than one fixture for broader release validation after B0, not during the initial quota-limited work.
Required advanced feature A1 changes only the declared nominal obstacle placement radius in [46,47] mm after the baseline works. Section 6.5 specifies its reviewed proposal, paired validation, UI and replay. The manufacturing offset remains relative to the selected nominal radius; it is not an editable design variable. The independent oracle must accept the design radius explicitly. The old rectangular-arm fixture may be a later regression case, but is not part of B0 or required for this submission.
3. Architecture and CAD selection
3.1 Component structure
Use a modular Python application. Native CAD calculations run in isolated processes. The CLI, web application, numerical optimizers, and agents all use the same domain and verification interfaces.
flowchart TD
C["CLI or web client"] --> A["Application services"]
A --> J["Job coordinator"]
A --> D["Projects and evidence store"]
J --> W["Isolated CAD workers"]
W --> V["Public verifier"]
V --> G["build123d and OCP adapter"]
G --> K["OCCT kernel"]
W --> D
L["Supervised Strands role process"] --> T["Typed gateway and shared budget"]
T --> J
T --> D
A --> L
The diagram is a dependency and execution plan, not a requirement to deploy ten services. Initially these are modules plus a local coordinator and worker processes.
3.2 Architecture decision records
Create a short ADR when implementing each decision. Record alternatives, evidence, and consequences; do not repeatedly debate settled choices without new evidence.
| ADR | Decision | Reason and revisit trigger |
|---|---|---|
| ADR-001 | Python-first | Existing CAD/scientific libraries and development speed. Consider Rust only after profiling a concrete bottleneck. |
| ADR-002 | build123d with an adapter | Preserve high-level modeling productivity. Switch to CadQuery if the compatibility gate shows a blocking deficiency. |
| ADR-003 | Narrow direct OCP access | Use lower-level calls for required metadata or queries missing from build123d, without rebuilding a complete CAD framework. |
| ADR-004 | Separate CADCLAW reference environment | Avoid incompatible OCP distributions and unnecessary dependency coupling. Reuse proven functionality where integration is justified. |
| ADR-005 | B-rep results drive engineering decisions | Browser meshes support visualization. Mesh acceleration needs its own error and fallback policy. |
| ADR-006 | One public verifier | All application paths, optimizers, and agents receive the same semantics and evidence. |
| ADR-007 | Explicit engineering sidecar | CAD import does not establish joints, functional intent, or editable parameter bindings. |
| ADR-008 | CAD process isolation | Contain native crashes, memory growth, and timeouts. Do not rely on thread cancellation. |
| ADR-009 | SciPy first, Optuna when needed | Avoid duplicate optimizers initially; retain Optuna for trials, studies, and campaign management when useful. |
| ADR-010 | Core Strands Agents SDK with Groq | Use strands.Agent with OpenAIModel and an explicit Groq endpoint; reuse the upstream loop. Supersedes the full harness and custom provider-loop proposals; install only the selected provider extra. |
| ADR-011 | SQLAlchemy/Alembic for the local app | Preserve a mature persistence layer. The early CLI can use files before there is a database. |
| ADR-012 | Local-first deployment | Match customer CAD confidentiality; hosting is a product choice, not an assumed first step. |
| ADR-013 | Self-contained public repository | All necessary submitted functionality is reproducible from public source. |
| ADR-014 | Dependency groups and exact release locks | Install relevant features while preserving reproducibility and auditing the real transitive tree. |
| ADR-015 | Add services only for measured needs | Introduce a broker, distributed workers, object storage, or Kubernetes after local requirements exceed the simple design. |
| ADR-016 | Separate fixed policy and design identities | A repair changes a design revision while preserving requirements; cached results cannot cross design identities. |
| ADR-017 | Two sequential restricted roles | The controller starts direct SDK agents with distinct tool allowlists and a shared resource ledger; no native delegation. |
| ADR-018 | Bounded repair belongs to Community | One synthetic template parameter and its verification remain public; no private module is needed for the demo. |
3.3 CAD stack selection gate
Published candidate releases checked for this revision are build123d 0.13.0 and cadquery-ocp-novtk 8.0.1.1.0. Their metadata includes Python 3.12; the no-VTK distribution publishes a CPython 3.12 Linux x86-64 wheel. This confirms artifact availability, not compatibility of the complete environment. Inspect the released build123d requirements and resolve the pair together at M0; a development-branch manifest is not a release lock. [S02][S03]
B0 first tests cylinder construction, placement and distance only. The selected stable release must pass the following checks before the corresponding capabilities are advertised; M0 completes the checks necessary for the chosen release scope:
- Headless installation on the initial Linux/Python target.
- Parametric construction and controlled regeneration.
- STEP import/export, repeated occurrences, nested placement, and unit checks if the release supports these capabilities. A trusted-template-only demo can defer general STEP support.
- Static separation, contact, interference, and containment fixtures.
- Required low-level geometry access.
- GLB export with correct placement and scale.
- A resolved dependency inventory and native-library license review.
Do not install an upstream development branch or all optional extras by default. Development manifests and rolling documentation can differ from release artifacts. Inspect the actual chosen release and wheel metadata. [S04]
The current CADCLAW manifest and documentation describe a CadQuery-based runtime, while the proposed build123d environment uses the no-VTK OCP branch. The full and no-VTK distributions expose the same OCP import namespace. Keep reference executions separate until version-specific integration testing establishes compatibility. [S05][S06]
4. Engineering model and correctness rules
4.1 Mandatory invariants
| ID | Requirement |
|---|---|
| REQ-01 | The verifier runs without an LLM, network access, web server, or commercial package. |
| REQ-02 | Kernel errors, unsupported queries, invalid geometry, and ambiguous numerical results never become a passing engineering result. |
| REQ-03 | Every result identifies geometry, specification, scenario, verifier, and numerical settings. |
| REQ-04 | Search success means a valid counterexample was found; search exhaustion does not prove safety. |
| REQ-05 | Requirements, admissible uncertainty, allowed contacts, and verifier settings stay fixed during a campaign. |
| REQ-06 | Redesign changes only declared design variables or trusted operations. |
| REQ-07 | Imported STEP geometry does not automatically become an editable parametric model. |
| REQ-08 | CLI, API, UI and AI tools use the same result definitions and core checks. |
| REQ-09 | User data is not uploaded to a model provider, published, or reused for training by default. |
| REQ-10 | A meaningful result can be replayed from saved inputs without replaying an LLM conversation. |
| REQ-11 | Model output never sets a measured value, engineering verdict or revision approval. |
| REQ-12 | Every role and tool shares controller-enforced request, time and evaluation allowances. |
| REQ-13 | The runtime tool allowlist excludes general shell, code, files, web, memory and recursive delegation. |
| REQ-14 | A repair preserves the policy hash and original revision; each design receives separate native evaluation identities. |
| REQ-15 | A successful source-case retest does not imply that the final validation plan passed. |
| REQ-16 | All advertised Community behavior is reproducible with public code, fixtures and deterministic replay. |
4.2 Units and coordinate frames
Use millimetres for geometry and radians for internal joint calculations in the initial engine. Accept explicitly marked degrees at the input boundary and convert once. Preserve source-unit metadata.
- Every dimensional field has a declared unit or a schema-defined unit suffix.
- Coordinate systems are right-handed. Define transform composition once and test it.
- Store each part definition separately from each assembly occurrence and its transform.
- Apply joint motion relative to an explicit joint frame; do not rotate around an inferred world origin.
- Convert consistently at rendering/export boundaries. Test a known dimension in the GLB viewer; do not assume that setting an exporter option cannot introduce a second conversion.
- Distinguish manufacturing tolerance, kernel computation tolerance, mesh deflection, and engineering clearance requirement. These are different quantities.
- Reject NaN, infinity, invalid axes, inconsistent units, and bounds with reversed endpoints.
Before adding FEA or dynamics, define a separate coherent physical-unit policy for forces, mass, time, stiffness, and material properties.
Use a documented CAD world convention of +Z up. glTF uses metres and +Y up. Define one CAD-to-view conversion for geometry, translations, rotations, and witness markers; for example, (x, y, z) in CAD millimetres maps to 0.001 * (x, z, -y) in view metres. Apply the corresponding change of basis to rotations. If the exporter already performs a conversion, the adapter must account for it rather than apply it twice. Test scale and all three axes together. [S22][S23]
4.3 Part identity and topology
An occurrence is a placed instance of a part, not just a unique solid. Repeated bolts must remain separately addressable. Preserve the assembly hierarchy and compose nested transforms correctly.
Use stable logical IDs within an asset revision. Hash original asset bytes and a normalized specification. Record importer versions and a mapping from imported names/labels to our occurrence IDs.
Raw face or edge indices are not stable design references across regeneration. Prefer named datums and template-defined features. Detect stale references and require remapping; do not silently attach a constraint to a different face.
STEP import may preserve some assembly and PMI information, depending on source and adapter. It must not silently invent missing joints, full GD&T semantics, parametric history, or intended contacts. [S07]
4.4 Geometry relation versus requirement verdict
OCCT's BRepExtrema_DistShapeShape returns minimum distance, query state, witnesses, and an inclusion indicator. It is not a general signed penetration-depth API. [S08]
Keep separate fields:
| Field | Meaning |
|---|---|
relation | separated, touching, overlapping, or unknown |
minimum_distance_mm | Nonnegative distance when the completed query supports it |
intersection_volume_mm3 | Optional volume from a separate validated solid-intersection query |
witness_points_mm | Points supporting a completed distance query, with occurrence/frame information |
requirement_verdict | satisfied, violated, or indeterminate |
reason_codes | Machine-readable reasons such as clearance_below_minimum, kernel_not_done, or invalid_solid |
A positive distance can violate a positive minimum-clearance requirement. Zero distance does not, by itself, distinguish permitted touching from volumetric interference. Containment requires explicit handling. Intersection volume and distance have different dimensions and must not be combined as if they were the same measure.
OCCT's InnerSolution() reports partial or complete inclusion; it does not alone prove whole-solid containment. BRepClass3d_SolidClassifier classifies a point, not a complete shape. Establish volumetric overlap or full containment only with the validated solid-query combination and its recorded evidence. Use a specific solid_containment reason only when that stronger classification is supported. Otherwise report overlap with narrower evidence, or unknown if the relation is unresolved. A positive boundary-distance result with inclusion evidence must not become separated by assumption. [S08][S24]
Freeze a numerical ambiguity band before a campaign. For a valid separated distance d, threshold c and numerical band epsilon: d < c-epsilon is violated; d > c+epsilon is satisfied; the closed interval [c-epsilon,c+epsilon] is indeterminate. Initial fixture comparison tolerance and band candidates are each 1e-5 mm, but record them as separate named settings and justify them against native behavior. They are not the 1.5 mm engineering requirement, mesh deflection, or the optional 0.05 mm design guard. For overlap/touching use the applicable supported relation policy rather than fabricating signed penetration. An unresolved prerequisite query stays indeterminate.
4.5 Three separate result levels
- Execution: queued, running, completed, failed, cancelled, interrupted, or timed out.
- Scenario/constraint: satisfied, violated, or indeterminate.
- Campaign: failure found, no failure found, or inconclusive.
Aggregation rules:
- A confirmed violation is a valid failure finding even if other cases are indeterminate; report both.
- Without a violation, an unresolved required case makes the relevant conclusion inconclusive.
- If all evaluated required cases are determinate and none violates a requirement, report
no_failure_foundwith the tested scope. - Require at least one applicable completed evaluation before reporting
no_failure_found. Reject invalid/zero search budgets; a never-started run, empty required scope, or a run containing only invalid scenarios cannot pass by vacuous aggregation. - A cancelled or interrupted campaign preserves findings and reports missing work. Without a confirmed violation, incomplete required native work makes its conclusion inconclusive.
- A numerical search that finishes its predeclared finite allocation can report no_failure_found for that evaluated scope. That is not exhaustive coverage. An agent that hits a lifecycle limit separately reports its incomplete AI phase; it does not alter already persisted native results or erase a completed numerical campaign.
- Never show a green global
SAFE,CERTIFIED, orCOLLISION_FREElabel for a sampled or heuristic search.
Every report lists checked requirements and occurrence pairs, explicit exclusions, unsupported checks, and checks that were never requested. A finding for one declared pair must not look like an all-assembly interference assessment.
4.6 Kinematics and uncertainty
Start with fixed and revolute joints in an acyclic assembly graph. Add prismatic joints after the same transform and constraint tests pass.
A four-bar linkage (outside contest scope) requires closed-chain constraint solving, assembly-mode selection, closure-residual checks, and branch continuity. Independently sampling each joint angle can create impossible configurations. Do not extend the tree implementation by pretending a closed chain is a set of independent joints.
Begin with bounded dimensional and pose deviations. Bounds alone do not define a probability distribution. Random or Sobol samples are search strategies unless an explicit probabilistic model has been supplied and justified.
Support coupled uncertainty only when explicitly specified. Reject impossible combinations before geometric evaluation. Failed geometry regeneration is an invalid design/scenario, not an attractive low-clearance result.
5. Data contracts and file formats
5.1 Domain models
Use Pydantic at input/output boundaries and typed internal models. Core models must not depend on FastAPI, SQLAlchemy, provider-specific LLM objects, or commercial entitlements.
| Model | Essential content |
|---|---|
AssemblyAsset | Original files, content hashes, source units, importer metadata, part definitions, occurrences, warnings |
MechanismSpec | Schema version, units, joint graph, datums, design variables, uncertainty, constraints, allowed contacts |
DesignRevision | Parent revision, immutable parameter values, trusted regeneration operation, geometry hash |
Scenario | Joint configuration, deviations, any derived values, validity checks, scenario ID |
QueryResult | Geometry relation, distances/volumes, witness points, numerical settings, kernel status |
ConstraintResult | Requirement ID, verdict, measured quantities, threshold, reasons |
VerificationResult | Complete scenario evaluation, execution metadata, constraints, warnings |
CampaignConfig | Frozen problem references, algorithm, seed, budgets, sampling policy, evaluator version |
Counterexample | Valid failing scenario, evidence, original and reduced variants, reproducibility metadata |
RepairCandidate | Allowed parameter/operation changes, rationale, evaluation results, held-out comparison |
RunManifest | Versioned references tying every input and output together |
EvaluationPlan | Concrete ordered comparison cases, generation metadata, plan hash and required completion count |
RepairProposal | Bound source case, base revision, fixed policy hash, one permitted edit, advisory rationale and review state |
RepairComparison | Two revision IDs, paired result IDs, source-case outcome, validation outcomes and plan hash |
BudgetLedger | Parent/phase allocations, reservations, monotonic time, request identities and usage counters |
AgentRunSummary | Role, runtime/provider versions, public explanation, evidence IDs, usage and stop reason; no authority over native results |
5.2 Sidecar specification and fixture input
Use YAML with safe loading for human editing and canonical JSON for machine interchange. Validate at the input boundary using Pydantic, reject unknown fields and non-finite values. The full proposed schema below matches rotating_pin_v1. B0 can use typed built-in constants and a small CLI instead of implementing this full sidecar; Kiro implements and validates the actual contract in M1/M2. Do not advertise a file format before it works.
schema_version: "1.0"
project_id: rotating-pin-demo
units:
length: mm
input_angle: deg
geometry:
source: trusted_template
template_id: rotating_pin_v1
parameters:
pin_orbit_radius_mm: 40.0
pin_radius_mm: 2.0
obstacle_radius_mm: 2.0
cylinder_height_mm: 8.0
obstacle_placement_radius_mm: 46.0
obstacle_placement_angle_deg: 45.0
bindings:
obstacle_placement_radius:
kind: template_parameter
parameter: obstacle_placement_radius_mm
unit: mm
joints:
- id: arm_hinge
type: revolute
parent: base
child: pin
parent_frame:
origin_mm: [0.0, 0.0, 0.0]
orientation_quaternion_xyzw: [0.0, 0.0, 0.0, 1.0]
child_frame:
origin_mm: [0.0, 0.0, 0.0]
orientation_quaternion_xyzw: [0.0, 0.0, 0.0, 1.0]
axis: [0.0, 0.0, 1.0]
limits_deg: [0.0, 90.0]
uncertainties:
- id: placement_error
target: obstacle_placement_radius
kind: bounded_offset
bounds: [-1.2, 1.2]
requirements:
- id: pin_obstacle_clearance
type: minimum_clearance
occurrences: [pin, obstacle]
minimum_mm: 1.50
allowed_contacts: []
design_space:
editable_parameters:
- target: obstacle_placement_radius
bounds: [46.0, 47.0]
immutable_parameters: [pin_orbit_radius_mm, pin_radius_mm, obstacle_radius_mm, cylinder_height_mm, obstacle_placement_angle_deg]
search:
strategy: differential_evolution
seed: 42
max_evaluations: 500
max_wall_time_s: 120
base is a fixed datum/optional visual occurrence; the pin solid is authored in its child frame with its center at (40,0,4) mm (z interval 0..8 mm), then rotated about the hinge origin. The obstacle center is determined by its nominal radius plus the bound radial offset. Actual placement is changed, not merely a scalar in a report. Check only the required pair. No generic contact-pair exclusion is needed. The design space is activated only at M6/A1 and the immutable list uses template parameter names; editable targets resolve through the explicit binding table. Treat the declared [46,47] mm design interval as the explicit synthetic mounting constraint; validate it before allowing a proposal. For a concrete scenario:
{
"joint_positions_deg": {"arm_hinge": 45.0},
"deviations_mm": {"placement_error": -1.2}
}
Assign scenario IDs from canonical inputs and the frozen problem reference, not from a label invented by an agent. Version every format. Schema migration must preserve or explicitly reject old evidence.
Canonicalization is part of the format contract. Convert display degrees to internal radians once; reject Boolean numerics, NaN/infinity and unknown fields; normalize negative zero; preserve actual admitted values without silent rounding or clipping. Serialize normalized domain data with a documented UTF-8, sorted-key, whitespace-free JSON policy and hash those bytes with SHA-256. Store the canonical bytes in the bundle. Do not promise cross-language hash parity until it is tested.
Separate normalized engineering policy from the current value of an editable design parameter. The policy includes requirements, pair scope, uncertainty, motion, contacts, allowed design bounds, immutable parameters and numerical settings. The design revision includes the template/version and nominal design values. An evaluation key includes both hashes, canonical scenario values and verifier/environment identity. Keep execution attempt IDs distinct from deterministic cache keys. A comparison case ID can align equal scenario values across designs, but their result IDs must differ.
Validate that every uncertainty and editable parameter has a real binding. A nominal pin diameter in a YAML file must not be accepted if the imported shape cannot actually be regenerated or modified accordingly. Targets are explicit binding IDs, not arbitrary Python attributes or guessed JSON paths. Design bounds apply to nominal design parameters. Manufacturing offsets produce realized values, and clearance checks always evaluate realized geometry.
For source: trusted_template, the registered template version and parameters are authoritative. Generated STEP files are hashed derived artifacts; reject stale or conflicting snapshots. For source: step, the imported asset revision is authoritative. Regeneration is permitted only through an explicitly supported parameter/edit binding. The CLI must enforce this source precedence even when both a geometry path and a specification are supplied.
An allowed-contact region must resolve to actual named features/regions in the trusted template or a reviewed import mapping. Reject an unresolved region_id; never fall back to excluding the entire part pair. Permitted touching does not permit positive-volume overlap. A valid contact in the hinge region cannot suppress a separate forbidden contact elsewhere.
5.3 Evidence bundle
Store a self-contained run directory containing, as applicable:
manifest.json: schema/version information, hashes, command, environment, algorithm, budgets, and completion reason.specification.json: normalized immutable engineering problem.design.json: the design revision and trusted template parameters.scenario.json: concrete failing or selected evaluated values.result.json: structured verification results and warnings.counterexample.json: when a violation is found, its scenario/result references, asset/specification/design hashes, required replay settings, and original/reduced relationship. This is the input accepted by replay/minimize/repair commands.events.jsonl: progress and errors, with secrets and customer-sensitive model payloads excluded.- Original geometry or durable content-addressed references, with required reproduction rights.
- Derived STEP/GLB assets and their export settings.
report.md; a basic self-contained HTML report may follow after the required release.
Record package versions, native OCCT version, Python/OS/architecture, seed, thread settings, and relevant kernel/mesh tolerances. Reproducibility means matching verdicts and numerical values within documented tolerances under a compatible environment, not promising bit-identical native floating-point results on every machine.
Evidence export must not silently include provider keys, private prompt material, unrelated user files, or cached data from another project.
For A1, add comparison.json, policy.json, original/design.json, candidate/design.json, validation_cases.json, separate original/candidate result collections, proposal/review/selection records and the source counterexample. Include concrete regeneration parameters and templates or resolvable public versioned source. Keep the optional sanitized AI trace separate from the domain replay data. The comparison manifest identifies missing attempts and cache policy; it is not complete merely because two screenshots exist.
5.4 CLI contract
Target commands, introduced incrementally:
arena doctor
arena fixture rotating-pin --output demo/
arena inspect demo/assembly.step
arena validate-spec demo/mechanism.yaml
arena verify demo/assembly.step --spec demo/mechanism.yaml --scenario demo/scenario.json
arena sweep demo/assembly.step --spec demo/mechanism.yaml --output runs/sweep-001/
arena search demo/assembly.step --spec demo/mechanism.yaml --budget 1000 --seed 42
arena replay runs/search-001/counterexample.json
arena minimize runs/search-001/counterexample.json
arena repair propose --counterexample runs/search-001/counterexample.json
arena repair evaluate --proposal proposals/proposal-001.json
arena repair compare --candidate candidates/revision-002.json --plan plans/validation-cases.json
arena repair apply --comparison runs/comparison-001/comparison.json
arena replay runs/comparison-001/comparison.json
arena export-report runs/search-001/ --format markdown
CLI target contract: 0 means the requested operation completed; for a verification/search command it also means no finding in the evaluated scope. 1 means a normally completed operation reported a confirmed violation. 2 means invalid/unsupported input, execution failure or an inconclusive required evaluation. Use 124 for a hard timeout and 130 for user cancellation; those execution codes take precedence while JSON preserves any verified findings. Proposal creation or active-revision selection returning 0 is not an engineering pass. All commands support JSON with separate execution and engineering fields. CLI repair propose does not evaluate; evaluate screens one reviewed proposal; compare runs the reserved final plan; apply only selects a completed reviewed candidate. The CLI command invocation is the user's explicit action, and automation must provide the matching proposal/revision/plan IDs.
Document cancellation and timeout exits separately from ordinary successful completion. Preserve any confirmed finding in the JSON even when execution later stops; the process exit must still expose that the requested campaign did not finish normally.
6. Verification, search and bounded repair
6.1 Static evaluation pipeline
For each valid scenario:
- Validate the immutable problem and scenario bounds.
- Regenerate only geometry affected by bound parameters; validate regenerated shapes.
- Compute occurrence transforms from the declared kinematic model.
- Enumerate required pairs and documented permitted-contact exceptions.
- Use bounding volumes for conservative screening only where the implementation justifies it.
- Run required B-rep distance, intersection, containment, and validity queries.
- Interpret measurements against requirements using the numerical ambiguity policy.
- Produce structured evidence, including incomplete or failed operations.
Do not silently heal or simplify imported geometry. Any repair changes the asset revision, records what changed, and requires explicit review when it changes engineering meaning.
6.2 Motion evaluation
Start with a uniform single-joint sweep and report its angular resolution. Add adaptive refinement around low clearance, rapid changes, or uncertain states after the baseline is tested.
Adaptive sampling still does not prove absence of collisions between samples without an appropriate bound. Distinguish sampled coverage from a future conservative or certified continuous-motion algorithm.
Keep intentional contacts narrowly scoped. A hinge contact exception must not suppress all future collisions between the arm and its base.
6.3 Adversarial search
Implement baselines in order:
- Deterministic nominal and boundary cases.
- Seeded random sampling.
- Sobol sampling, with sequence and budget details recorded.
- SciPy differential evolution.
- Optional Optuna studies for experiment comparison and useful search alternatives.
SciPy's differential evolution is a stochastic bounded-search method with configurable random state, workers, and constraints. Its termination does not certify the global optimum. [S09]
Let x be fixed design parameters and u contain admissible motion and deviations. For supported separated cases, a minimum-clearance margin is:
margin(x, u) = measured_distance_mm(x, u) - required_clearance_mm.
Search for a violation within the declared set U. Confirm any candidate using the authoritative verifier before recording it as a failure.
For general intersections, use typed measurements and a documented dimensionless search score or explicit feasibility ranking. Never mix millimetres and cubic millimetres in a raw scalar objective. A surrogate score is a search aid; it is not the engineering verdict.
Enforce evaluation, wall-time, and resource budgets at the job level. Invalid scenarios and failed geometry operations must be logged and counted. They must not be rewarded as discoveries. Define retry limits; repeated kernel failures should make the campaign inconclusive rather than consuming an unbounded budget.
6.4 Counterexample reduction
Reduction seeks a simpler reproducible failure, not a guaranteed globally minimal example.
Try supported reductions such as:
- Return irrelevant deviations toward nominal values.
- Reduce the number of active deviations.
- Narrow the joint-angle interval containing the failure.
- Simplify the explanation to the smallest confirmed part/requirement set without changing the original model.
Keep both original and reduced scenarios. Every accepted reduction must retain a confirmed violation under the same immutable requirements. Require a configurable failure margin away from numerical ambiguity where possible.
6.5 Required advanced feature A1: AI repair and verified comparison
A1 adds one controlled design revision to the demonstrated workflow: an AI proposes a nominal obstacle-placement change, the user reviews it, and the deterministic engine compares the original and revised geometry under the same engineering conditions. Implement A1 as M6, after the engineering MVP, offline replay, viewer and live Strands failure analyst pass their gates. Complete it before M7 release. B0 remains unchanged. Do not start repair while the basic native measurements or replay are unreliable.
The entire feature belongs to Community: proposal schemas, prompts, SDK/Groq configuration, parameter binding, regeneration, validation, viewer, evidence export and offline replay. It requires no private optimizer, hosted control plane, enterprise entitlement or proprietary dataset. Its scope is one editable number in the owned synthetic template. General CAD redesign, topology editing, commercial CAD integrations, manufacturing-cost optimization and autonomous multi-agent iteration remain outside this release.
A1.1 Editable variable and fixed engineering policy
The only editable binding is obstacle_placement_radius, which resolves to the trusted template parameter obstacle_placement_radius_mm. Permit finite real values in [46.0, 47.0] mm; do not impose an undeclared grid. The original nominal value is 46.0 mm. The allowed range is this synthetic fixture's mounting envelope, not a manufacturing recommendation.
Freeze the following before requesting a proposal:
| Item | Unchanged value |
|---|---|
| Checked occurrences | pin, obstacle |
| Pin orbit radius | 40.0 mm |
| Cylinder radii and height | 2.0 mm each; 8.0 mm height |
| Obstacle placement angle | 45° |
| Joint domain | 0–90°, inclusive |
| Obstacle radial manufacturing offset | [-1.2, +1.2] mm relative to each revision's nominal radius |
| Hard minimum clearance | 1.50 mm |
| Other invariants | Geometry template/version, contacts, units, numerical policy, verifier/version and noneditable parameters |
Recommend a 0.05 mm additional clearance guard when selecting a candidate. This is a design preference, separate from the hard 1.50 mm requirement and numerical ambiguity band. Prefer a small nominal change that achieves that guard in the evaluated scope. Do not call an AI proposal optimal or treat an advisory guard miss as a violation of the unchanged hard requirement. Report hard-requirement results and guard results separately.
For the idealized template, put r = R + delta, where R is nominal obstacle radius. With parallel cylinders occupying the same axial interval:
d(q, delta, R) = sqrt(40² + (R + delta)² - 80(R + delta)cos(q - pi/4)) - 4.
Over the declared domains, R + delta > 40; the minimum occurs at q = pi/4, delta = -1.2, giving d_min(R) = R - 45.2. This independent reference predicts:
| Nominal R | Nominal minimum | Adverse minimum | Interpretation |
|---|---|---|---|
| 46.00 mm | 2.00 mm | 0.80 mm | Original violation |
| 46.70 mm | 2.70 mm | 1.50 mm | Hard-threshold boundary; numerical ambiguity applies |
| 46.75 mm | 2.75 mm | 1.55 mm | Illustrative advisory-guard boundary |
| 46.80 mm | 2.80 mm | 1.60 mm | Clear demonstration candidate with a 0.10 mm hard-clearance margin |
| 47.00 mm | 3.00 mm | 1.80 mm | Allowed upper bound |
These are analytical expectations, not recorded native results. The AI may propose another admissible value. Generate the actual solids and measure them; never substitute this table for a CAD query. Any fixture-specific analytical bound must be displayed separately from finite CAD validation, with its assumptions. It provides no certification for other mechanisms.
A1.2 Controller-owned workflow and human review
Use two sequential, application-constructed Strands SDK roles: the failure analyst from M5 and a repair proposer. The application starts the second role only after it has a confirmed source counterexample and the user requests a proposal. Native subagent delegation, swarms, recursive spawning and autonomous design loops remain disabled. The controller owns phase transitions, permissions, budgets and durable state.
The repair role receives the editable binding, allowed bounds, original parameter value, fixed-policy summary, advisory guard and measured source evidence. Its allowlisted tools describe that scope, read approved evidence and submit a typed propose_revision result. It cannot evaluate geometry, apply changes, edit requirements, read arbitrary files or invoke the failure analyst's search tools. Do not expose the frozen validation scenarios or their results before the final candidate is selected.
Implement this sequence:
- Confirm the source counterexample, original revision and replay metadata. Create and freeze the validation plan described below before the first proposal.
- Run the repair proposer with the remaining parent AI allowance. Validate its output without modifying geometry. Generate proposal IDs in the controller.
- Display the proposed nominal value, displacement, allowed range, unchanged uncertainty and requirement, and evidence-linked rationale. Keep model predictions visibly separate from measurements.
- Require a user action to evaluate a proposed change. The reviewed request creates an immutable candidate revision and permits one source-case screening evaluation. A CLI invocation must name the proposal and include an explicit evaluation action; merely generating a proposal cannot start CAD work.
- Request one AI proposal in the single repair-role invocation. Permit at most eight reviewed source-case screenings in this campaign; additional candidates come from explicit user edits of that proposal, with manual provenance, rather than another agent invocation. Retain their outcomes. Requesting another AI proposal requires a new explicitly started workflow and its declared allowance; never reset the current ledger automatically.
- The user selects one candidate for final paired validation. Freeze that selection and execute the predeclared plan once for the original and selected revision.
- Present results before a separate user action makes the candidate the active design. Keep the original revision and all evidence. Discarding a candidate or restoring the original changes the active reference, not stored history.
If the user iterates after seeing final validation, create a new campaign and new frozen evaluation set. Treat the previously exposed set as regression data. Do not keep calling it held out. The fixed boundary grid is an openly specified regression set; the additional Sobol cases provide withheld evaluation points, not statistical confidence or evidence about new mechanisms.
A1.3 Typed proposal and identity contracts
Use strict Pydantic boundary validation: finite numbers, explicit units, known IDs, no unknown fields and no Boolean-to-number coercion. Reject out-of-range proposals rather than clipping them. Reject an unchanged nominal value as no_design_change without dispatching geometry; use a changed but ineffective value such as 46.1 mm for the negative repair test. An illustrative proposal payload, with placeholder identifiers, is:
{
"schema_version": "1.0",
"source_counterexample_id": "<source-counterexample-id>",
"base_design_revision_id": "<original-revision-id>",
"policy_hash": "<unchanged-policy-hash>",
"change": {
"binding_id": "obstacle_placement_radius",
"new_nominal_value_mm": 46.8
},
"rationale": "Increase nominal obstacle radius while preserving the declared manufacturing offset and clearance requirement.",
"evidence_ids": ["<verified-source-result-id>"]
}
The controller supplies previous values and calculates the delta; it does not trust a model's claimed change amount. Reject stale base revisions, unsupported bindings, evidence from another project and mismatched policy hashes. A proposal has no authority to change its referenced objects.
Maintain three identities:
policy_hash: normalized fixed requirements, motion/uncertainty domains, pair scope, contacts, immutable parameters, allowed design domain and numerical policy.design_revision_hash: trusted template/version, nominal design parameters and the authoritative geometry revision.evaluation_key: policy and design hashes, canonical scenario values, verifier/version and numerical settings.
The original and repaired designs share a policy hash but have different design and evaluation identities. A shared comparison_case_id identifies the same numerical motion/offset values across designs. It does not authorize reuse of the original result as the candidate result. Record separate hashes for the evaluation plan and advisory selection preferences. Hash the actual canonical inputs; placeholder hashes shown here must never appear in generated evidence.
A1.4 Frozen validation plan and resource accounting
Before any proposal, write validation_cases.json and its content hash. Store the actual values, case ordering, generator configuration and software versions. A seed alone is insufficient to reproduce a changing library implementation.
Construct exactly 90 requested attempts per design:
- A fixed grid of 19 angles
0,5,...,90degrees crossed with offsets{-1.2, 0, +1.2}mm: 57 cases. - Thirty-two scrambled Sobol points in two dimensions with initial-campaign seed 20261201, generated using a pinned, tested SciPy/NumPy configuration. For a later campaign following exposed final-validation results, choose and record a new seed and concrete withheld cases; retain the old points as regression data. Map
u[0]toq_rad = (pi/2)*u[0]andu[1]todelta_mm = -1.2 + 2.4*u[1]. Freeze the resulting canonical JSON before proposal; do not regenerate at validation time. - One explicit replay of the source counterexample: one case. This deliberately repeats a condition if it also occurs in the grid. Keep a distinct attempt ID and execute a fresh query.
Convert the degree-defined grid to radians once. Record internal scenario values in radians and millimetres. Preserve the same ordered 90 cases for both revisions: 180 evaluations. Add at most eight source-case screenings: 188 total, within a 200-evaluation repair cap. Reserve the 180 validation evaluations before dispatching screening; optional work cannot consume that reservation. Any newly dispatched retry consumes the remaining allowance; retransmission of the same idempotent request does not. Bound retries and record failures; do not exceed the cap to force completion.
One evaluation credit means one newly requested scenario verification for this one-pair fixture, including invalid evaluation requests, cache hits and failed native attempts. A malformed proposal with no evaluation request consumes its tool/proposal allowance but no evaluation credit. Track actual pair queries and lower-level native calls separately. Use fresh evaluations for final comparison, not cached screening results. Duplicate transport deliveries return the existing attempt status/result without a second dispatch or charge. Record any cache usage outside this comparison explicitly.
The repair cap is a child allowance of the user-visible parent ledger, never a silent reset of the preceding search budget. Reserve or explicitly authorize the remaining repair allowance before starting. Bound AI requests/tokens, wall time and native-process time separately; validate the numerical defaults on the reference machine. Timeouts, cancellation and provider errors preserve completed evidence. An incomplete required validation set is inconclusive.
A1.5 Results, visual comparison and replay
Represent proposal state, execution state and engineering conclusions separately. In particular, source_case_fixed is bool or null with a reason: true for a determinate satisfied retest of the original failing condition; false for a confirmed remaining violation; null for untested, failed or indeterminate retests. It describes only that source condition. Final paired_validation reports each design's campaign outcome: failure_found, no_failure_found, or inconclusive. The candidate can fix the source case and fail another validation case. A confirmed finding survives a later timeout.
An illustrative, unexecuted result excerpt for a 46.8 mm candidate is:
{
"source_case_fixed": true,
"source_case_comparison": {
"original_result_id": "<original-native-result-id>",
"candidate_result_id": "<candidate-native-result-id>",
"original_gap_mm": 0.8,
"candidate_gap_mm": 1.6,
"required_gap_mm": 1.5
},
"paired_validation": {
"plan_hash": "<frozen-case-plan-hash>",
"attempts_required_per_design": 90,
"original_outcome": "failure_found",
"candidate_outcome": "no_failure_found",
"scope": "declared_finite_validation_cases"
}
}
Populate every number from stored native results. Report completed, failed, indeterminate and missing counts; distinguish 90 attempts from the number of unique scenario values. Evaluate the advisory guard separately, with numerical ambiguity represented rather than rounded into success. Do not report search exhaustion as proof that no feasible repair exists.
Show original and revised geometry with synchronized cameras, angle and offset. At a fixed scenario, the obstacle displacement is (R_new-R_old)*(cos(pi/4), sin(pi/4), 0) mm. For the illustrative 0.8 mm edit, its X and Y components are approximately 0.565685 mm each; the manufacturing offset remains unchanged. Both cylinder axial intervals remain z=0..8 mm. Ghosting must distinguish nominal geometry from realized geometry and original design from revised design.
Use the same CAD-to-view conversion for meshes, placement, axes and witnesses: p_view = 0.001*C*p_cad, with C mapping (x,y,z) to (x,z,-y); rotations transform as R_view = C*R_cad*Cᵀ. Apply this conversion exactly once, accounting for exporter behavior. Display a gap marker only for valid native witnesses. An unmeasured slider position is an animation preview until the backend evaluates it. Plots distinguish measured samples from connecting lines and retain the unchanged 1.50 mm requirement.
Export both design revisions, fixed policy, source counterexample, frozen cases, native results, numerical settings, relevant model/tool metadata, review/selection records, budgets and stop reasons. Offline replay reconstructs geometry and verifies results without provider calls. A saved AI trace stays labeled as recorded. Claim neither general safety nor AI superiority from this deliberately small fixture.
A1.6 Acceptance gate
- Native measurements reproduce the original 0.8 mm reference and the illustrative 1.6 mm candidate within the validated numerical tolerance; tests inspect actual dimensions and placements.
- Tampered requirements, changed uncertainty, stale hashes, out-of-bounds/nonfinite values and unsupported edits fail before dispatch. Rejected proposals consume no geometry evaluation.
- The original revision survives proposal, evaluation, activation and undo. Tools cannot bypass review or obtain search/shell/file capabilities from another role.
- Both designs run the frozen plan; missing/indeterminate cases cannot produce validation success. A failure elsewhere retains source_case_fixed=true when that source-case result is valid, but sets the candidate's paired-validation outcome to failure_found. Do not present that candidate as a successful validation.
- Tests cover threshold ambiguity, an ineffective proposal, exhausted allowance, duplicate delivery, retry, cancellation, native failure and replay mismatch.
- The UI's geometry, measurements, revision IDs and scenario values agree. It shows exact tested scope and honest live/recorded status.
- A fresh offline process replays the comparison from public artifacts. Actual Kiro implementation and test evidence are recorded. A1 remains incomplete until these conditions pass; it cannot appear as a finished submission feature solely because the screens or AI narrative exist.
6.6 Verification interfaces
Prefer small typed interfaces. The following is architectural pseudocode; implement concrete types with the pinned libraries:
class GeometryAdapter(Protocol):
def import_assembly(self, asset: AssetReference) -> AssemblyImport: ...
def regenerate(self, template: TemplateReference, parameters: Parameters) -> GeometryRevision: ...
def evaluate_pair(self, request: PairQuery) -> PairQueryResult: ...
def export_view(self, request: ViewExport) -> ExportResult: ...
class Verifier(Protocol):
def evaluate(self, problem: FrozenProblem, scenario: Scenario) -> VerificationResult: ...
class SearchStrategy(Protocol):
def run(self, problem: FrozenProblem, evaluator: Evaluator, budget: Budget) -> CampaignResult: ...
class RepairStrategy(Protocol):
def propose(self, design: DesignRevision, evidence: EvidenceBundle) -> list[RepairCandidate]: ...
Pass serializable requests across process boundaries. Do not pickle native shape handles or assume OCCT objects can safely be shared among worker processes.
7. Local application, jobs, API and interface
7.1 Persistence progression
Use evidence directories for the CLI. Introduce SQLite, SQLAlchemy and Alembic when the viewer needs durable projects or jobs; retain these mature libraries rather than writing a bespoke ORM. A single demo can first use filesystem-backed run manifests with stable IDs. Keep heavy STEP/GLB assets on disk with content hashes. Use one local coordinator, short database transactions, atomic result publication and restart reconciliation. SQLite WAL does not make the application a multi-host database [S10][S11]. Do not implement login systems, organizations or cloud infrastructure for the local MVP.
7.2 CAD worker model
Begin with one bounded worker and explicitly configured multiprocessing spawn. Load geometry and initialize the native kernel inside the worker. Increase parallelism only after measuring memory and throughput on the reference machine.
The coordinator must:
- Persist a job request before starting expensive work.
- Track attempts, process identity, heartbeat, elapsed time, and configured limits.
- Enforce a hard timeout by terminating the owned worker process and replacing it when necessary.
- Distinguish cancellation requested from cancellation completed.
- Preserve partial evidence and mark interrupted jobs on restart.
- Write result files atomically, then commit their metadata.
- Reconcile orphaned temporary files and incomplete attempts without treating them as completed results.
Calling Future.result(timeout=...) or cancelling a future does not by itself terminate native code already running. Build the supervisor around actual process ownership. A plain process pool is acceptable only where the implementation can enforce the required recovery semantics. [S12]
Use cooperative cancellation, a bounded grace period, termination, and kill escalation if required, then reap/join the owned process before reporting cancellation complete or reusing its capacity. Forced termination can corrupt queues/pipes; discard that worker's IPC state and create fresh channels. Initially prohibit worker-created subprocesses. If descendants are later allowed, supervise the whole owned process group rather than assuming termination of the parent stops them. [S12]
Do not run CAD computation on FastAPI's event loop. Do not treat FastAPI BackgroundTasks as a durable scientific job queue. It remains suitable for small noncritical follow-up work; geometry jobs belong in the supervised execution path. [S13]
Record BLAS, optimizer, and kernel thread settings. Avoid nested parallelism that multiplies process workers by numerical-library threads and exhausts laptop memory.
For the first supported Linux profile, propose one CAD worker and one active Strands role process. Start with a 10-second per-scenario native deadline inside the phase deadline, a 1-second cooperative stop grace, and a 2-second terminate grace before kill/reap. These are configured limits to validate, not observed timing guarantees. Do not report cancellation complete or reuse capacity until the process is reaped; if reaping fails, quarantine the slot and report a supervisor error. Set BLAS/OpenMP thread counts before importing numerical libraries and verify the effect. Record peak RSS; claim a hard memory cap only if an OS-enforced mechanism has actually been installed and tested.
7.3 API contract
Introduce a versioned local API after the CLI and evidence contracts work. For the contest, start with the example project and the run/finding/replay/artifact routes; project creation, arbitrary asset upload and specification editing are P2. Implement only routes for supported capabilities.
| Operation | Suggested route | Behavior |
|---|---|---|
| Create/list projects | POST/GET /api/v1/projects | Project metadata, no heavy geometry work |
| Add geometry | POST /api/v1/projects/{id}/assets | Bounded upload; enqueue import/validation where needed |
| Read import result | GET /api/v1/assets/{id} | Occurrences, units, warnings, supported capabilities |
| Store specification | POST /api/v1/projects/{id}/specifications | Validate and create an immutable version |
| Create a run | POST /api/v1/runs | Return run ID and accepted state; support idempotency |
| Query progress | GET /api/v1/runs/{id} | State, budget use, partial findings, completion reason |
| Cancel | POST /api/v1/runs/{id}/cancel | Request cancellation and expose its eventual completion |
| Read findings | GET /api/v1/runs/{id}/findings | Structured, versioned engineering evidence |
| Replay | POST /api/v1/findings/{id}/replays | New attempt tied to the saved scenario |
| Export | GET /api/v1/artifacts/{id} | Scoped artifact access, no arbitrary filesystem paths |
| AI discovery | POST /api/v1/runs with mode=ai | Bind one role to a frozen problem and shared ledger; explicit user action |
| Repair proposal | POST /api/v1/findings/{id}/repair-proposals | Start one restricted role; return pending proposal, no CAD mutation |
| Screen proposal | POST /api/v1/repair-proposals/{id}/evaluations | Reviewed proposal creates immutable candidate and source-case screening |
| Final comparison | POST /api/v1/repair-comparisons | Bind original, selected candidate and frozen plan; reserve paired validation budget |
| Review comparison | GET /api/v1/repair-comparisons/{id} | Exact paired evidence, execution and engineering outcomes |
| Select active revision | POST /api/v1/projects/{id}/active-revision | User selects a reviewed revision with expected current revision; preserve history |
| Optional progress stream | GET /api/v1/runs/{id}/events | Monotonic public events, bounded replay and terminal event |
Use polling first. M5 can add SSE for sanitized progress without changing the job model; WebSockets are not required. Closing/reopening an event stream must not create a new run.
Use Pydantic request/response schemas and consistent errors. Include request/run IDs. Separate validation errors, unsupported capability, native-kernel failure, and budget exhaustion.
Mutation requests carry an Idempotency-Key and immutable referenced IDs. Return 202 with the existing run for a duplicate identical start, 409 for a changed payload or stale revision, 422 for invalid domain data and a typed 429/503 for resource unavailability. Do not return success while work is pending. Public IDs resolve within the current project; callers never supply a filesystem path. Keep proposal state, job state and engineering verdict as separate fields. Only the application endpoints perform review/evaluation/activation; none are runtime-agent capabilities. A1 does not allow Apply when the source case remains violated/indeterminate, final required comparison is incomplete or has any finding/indeterminate case, or the base revision is stale. A satisfied hard requirement with a missed advisory guard is displayed separately; it is not a hidden change to the engineering threshold.
7.4 UI and demo behavior
React + TypeScript + Vite, Three.js + React Three Fiber, optional Drei for camera controls, Plotly.js for engineering curves. Use Tailwind/shadcn/ui and Lucide if useful; do not make a design-system build the critical path. Prefer a single three-panel screen: problem controls, 3D scene, verified results. A run drawer shows history, progress and replay/export. Use a restrained dark CAD-workbench design with high-contrast status colors and ghosted nominal/adverse poses; the Halloween treatment must improve the explanation rather than hide evidence.
- Load a pre-generated synthetic example. Show units, occurrence names, the fixed angle range and tolerance bounds.
- Draw the nominal and failing poses, affected pair, closest points and a gap marker only if the kernel actually returned valid witnesses. Do not compute engineering verdicts from visual meshes. Export a separate GLB node per occurrence and use one documented CAD-to-glTF basis conversion.
- Provide a timeline/angle slider (display only unless a backend evaluation is requested), nominal sweep curve, required clearance line, and best found distance versus evaluation count. Mark invalid/indeterminate samples distinctly; do not interpolate missing points as valid measurements.
- Offer a baseline search button and AI-assisted search button. Show algorithm, elapsed time, completed/failed evaluations, seed, remaining budget and stop reason. Cancel must stop the actual owned CAD process. Use polling before SSE or WebSockets.
- Display confirmed finding with its exact scenario, actual minimum distance, required distance, numerical band, reason codes and immutable hashes; state explicitly which pairs were not checked.
- Allow download of the evidence bundle and replay of a selected failure. If replay mismatches beyond the recorded tolerance, report inconclusive and show why.
- A1 requires synchronized original/candidate views, one shared pose/offset control, a visible nominal-parameter diff, paired measured curves and source-case results, required/completed validation counts, separate advisory-guard status, review/evaluate/apply actions and comparison export/replay. Follow section 6.5; do not label an animation preview as measured or an incomplete comparison as verified.
- When no API key or provider is unavailable, disable live AI with a clear reason; retain baseline search and optionally a labeled saved trace.
Accessibility: keyboard-accessible controls, readable units, text verdicts rather than color alone, responsive layout on laptop. Avoid external fonts/assets unless approved and bundled with notices.
7.5 Local security and judge access
Bind to 127.0.0.1 by default; enforce allowed origins and a local session/token on mutation endpoints, validate Host/origin, avoid arbitrary paths, use safe loaders, limit file size/count and run budgets. Native CAD parsers are untrusted-input boundaries. Workers run with restricted access, no model credentials, and separate job directories. Only user-approved synthetic geometry is used for judging.
Do not expose this single-user local API to the internet. If a functional hosted URL is required, use a deliberately restricted demo with an allowlisted built-in fixture, no arbitrary uploads/code execution, strict bounded jobs, rate limiting, temporary storage isolation, no secrets in frontend, and a reviewed deployment/access plan. If unable to provide safe hosted access, ask organizers whether a public release URL plus reproducible local instructions is acceptable. A recorded video alone is not the functional application URL.
8. Strands Agents SDK and Groq integration
8.1 Selected runtime and implementation boundary
Use the core Python SDK from strands-agents/harness-sdk. Install strands-agents[openai] and construct agents directly with strands.Agent. Do not install strands-harness, call create_harness(), add general-purpose tool bundles, or fork the runtime. The assembled harness is designed for broader autonomous work; this application only needs a scoped model/tool loop, typed outputs, lifecycle controls and an explicit provider model. [A01][A02][A04][A05]
The initial candidate is strands-agents[openai]==1.68.0 from the prior specification. Confirm the actual released wheel metadata, required OpenAI client range, optional extras, installed signatures and artifact hashes before adopting the lock. The rolling main branch supports the needed model/client injection and non-streaming option, but main is not proof that a particular wheel implements the same signature. If a required capability is absent, select the nearest reviewed stable release and record why in ADR-010; rerun all mock and live integration tests. No silent switch of provider or SDK. [A03][A05][A13]
The core SDK is Apache-2.0. Keep upstream license and applicable NOTICE files. Current SDK metadata still requires AWS and OpenTelemetry libraries, and the OpenAI extra includes an AWS token helper; those dependencies are not a reason to initialize AWS credentials, use Bedrock, or enable telemetry. The actual lock defines the audit scope. [A13][A14][A15]
AI integration begins at M5, after deterministic verification, search and replay. B0 remains unchanged. Base installation, ordinary verification, comparison replay and non-AI search must work without Strands, an API key or outbound network. No Groq account is needed to reproduce persisted engineering results; a live model run is a separate feature with separate billing and access requirements.
Only Groq is supported for live inference in the contest release. The OpenAIModel adapter name refers to a compatible client/protocol, not an OpenAI API account or service. Neither model weights nor a local GPU are part of the delivered runtime. The application owns the engineering tools, validation, budgets, evidence, explicit role transitions and user approval; do not implement a competing agent loop.
8.2 Two scoped roles, executed sequentially
Create a fresh agent instance for each role invocation. At most one role runs within a workflow at a time. The controller schedules discovery first; the user may subsequently request a repair proposal. No recursive delegation, autonomous agent spawning, shared conversational memory, swarm or native subagent tool is enabled.
| Role | Allowed tools | Purpose and authority |
|---|---|---|
failure_analyst | describe_problem, evaluate_scenarios, search_failure, read_evidence | Select bounded scenarios, request existing numerical search, and explain recorded failures. Cannot change geometry, tolerances or requirements. |
repair_proposer | describe_problem, read_evidence, propose_revision | Suggest one supported fixture parameter change using verified evidence. Cannot run a search, apply a revision or change acceptance criteria. |
The application supplies the repair role with evidence IDs and the permitted edit schema. It does not transfer hidden reasoning or the discovery agent's complete transcript. Both roles use the same direct SDK construction function and parent workflow ledger.
Store reviewed prompts at src/tolerance_arena/agents/prompts/failure_analyst.md and repair_proposer.md. Each prompt identifies units, tool contracts, limits and the obligation to cite evidence IDs. Prompts must not disclose planted expected answers as instructions to claim a successful search. Keep test oracle data in tests.
.kiro remains development configuration. Runtime agents receive the domain prompts explicitly. They do not read development AGENTS.md, .kiro, CLAUDE.md, local skills or arbitrary repository instructions. The project still creates no CLAUDE.md.
8.3 Direct SDK agent construction: no general-purpose harness
Instantiate a fresh Agent with an explicit provider model and an allowlist of reviewed domain tool objects. The direct SDK does not require the assembled harness defaults. The current constructor supports disabling tool-directory discovery and context management, setting a sequential executor, and supplying plugins, hooks and a session manager explicitly. Do not choose an agentic context mode: that mode can introduce additional tools. Do not register tools as module-name strings or import strands-agents-tools. [A04][A07][A09]
The following Python template uses documented/current-source names. Validate exact installed signatures and behavior before adopting it. model, domain_tools and domain_prompt are application inputs, not model-controlled values.
from strands import Agent, ModelRetryStrategy
from strands.tools.executors import SequentialToolExecutor
def build_role_agent(*, model, domain_tools, domain_prompt):
return Agent(
model=model,
tools=list(domain_tools),
system_prompt=domain_prompt,
callback_handler=None,
tool_executor=SequentialToolExecutor(),
retry_strategy=ModelRetryStrategy(max_attempts=1),
load_tools_from_directory=False,
context_manager=False,
plugins=[],
session_manager=None,
)
No file, shell, network, MCP, code-interpreter, subagent, memory or skill tools; no automatic loading of .kiro/AGENTS.md; no model router, remote sandbox or auxiliary model. The default host execution context is not a security sandbox: reviewed Python domain tools run with process privileges. The parent/worker isolation and IPC gateway are mandatory. Test the actual tool list transmitted to Groq, allowing the SDK's structured-output submission tool only when it has no domain authority. Fail closed if a framework update injects a new capability. Do not expose tool registries, agent objects, clients or dynamic Python callbacks to model inputs.
Use only the bounded in-memory invocation state; no durable agent sessions or shared conversation memory. The application persists domain evidence independently. Keep external telemetry disabled (including inherited OTLP configuration and exporter credentials); verify using an outbound-network-denial test and inspect the actual agent process. Disable raw prompt/response DEBUG logging. The provider may have its own caching and retention behavior; never equate application settings with provider deletion guarantees.
8.4 Tool contracts and validation
Tools are narrow functions over the controller gateway. They never expose Python evaluation, shell commands, filesystem paths, arbitrary HTTP URLs, SQL, uploads or dynamic tool registration. The controller binds the workflow, project and revision; model arguments cannot select another user's resources. To start repair from an older exported counterexample, the user imports/binds that bundle through the normal validated application path. The controller checks hashes, schema, ownership/access and replay compatibility, then adds specific source IDs to this workflow's evidence allowlist. The model cannot import or authorize historical bundles itself.
| Tool | Input and bounded behavior | Output |
|---|---|---|
describe_problem | No model-selected path or project ID. Read the bound revision and current phase. | Units, named parameters, constraints, uncertainty bounds, supported search methods and remaining budgets. |
evaluate_scenarios | One batch containing 1–8 scenarios and application-generated request identities. Validate each finite coordinate against the frozen problem. | Per-scenario validation status and persisted result/evidence IDs; measured values come from the verifier. |
search_failure | An allowlisted classical search method, seed and requested evaluation allocation within remaining discovery credits. | Search status, actual work counts, best verified result and evidence references. |
read_evidence | At most 8 IDs in this workflow's validated evidence allowlist. No path/URL access. | A bounded, redacted summary of stored inputs, measured results and provenance. |
propose_revision | One candidate obstacle_placement_radius_mm value, finite and within [46.0, 47.0], plus a short rationale and evidence references. | A proposal ID and explicit parameter diff. No geometry evaluation or active-revision update. |
For rotating_pin_v1, scenario coordinates are the angle and the obstacle's radial manufacturing deviation. The repairable obstacle_placement_radius_mm is the obstacle centre's nominal polar radius, not the cylinder's physical radius. Keep physical pin/obstacle radii, motion interval, uncertainty interval, checked pair and minimum clearance fixed. Label the field clearly in the UI to prevent that ambiguity.
Use strict application Pydantic models with forbidden extra fields, finite numeric checks, cardinality limits and explicit unit conventions. Validate original parsed JSON values before any SDK/framework coercion: reject booleans as numbers, numeric strings, nonfinite values and unknown keys. Never trust tool type annotations alone to enforce engineering constraints. Validate before launching CAD. Reject unsupported parameter names, changed uncertainty, hidden requirement reductions and IDs from another revision.
propose_revision only creates a reviewable proposal. The user chooses Evaluate proposal to screen the source case, then selects one candidate and chooses Run final comparison for the reserved paired plan. After inspecting that evidence, the user may choose Apply revision. These operations are controller endpoints, not agent tools. A proposal may be rejected or edited without consuming an additional model call. Evaluation consumes the remaining repair allowance. Repeated evaluation requests do not reset phase budgets. Evaluation creates the immutable candidate revision; applying selects that already reviewed revision as active. Preserve the original and its failure evidence.
An agent statement cannot become a geometric result. Resolve every cited evidence ID against the ledger and confirm its revision, input hash and completed verifier status. Reject unsupported claims of a pass, optimum or continuous safety. The controller, not the model, derives campaign outcome.
8.5 Budgets owned by the controller
Apply these defaults to each workflow. The controller may lower limits for a hosted demo; it must not silently raise them.
| Resource | Discovery | Repair | Whole workflow |
|---|---|---|---|
| Evaluation credits | 500 | 200 | 700 |
| Active wall-clock time | 120 s | 120 s | 240 s |
| Outbound model requests | 4 | 4 | 8 |
| Domain tool dispatches | 8 | 8 | 16 |
| Agent invocations | 1 | 1 | 2 |
| Maximum scenarios in one explicit batch | 8 | Not available | 8 |
SDK invocation caps additionally request 4 turns, 2,000 output tokens and 10,000 total tokens per invocation. The initial Groq per-request max_completion_tokens is 2,000 (including any reasoning tokens counted by the provider). These are distinct limits. Keep requests concise and validate real usage; do not assume the invocation cap or a 64 KiB byte limit fits an 8,000 TPM provider allowance. SDK caps are checked between iterations and may overshoot during a call; they reset on the next invocation. Treat them as secondary controls. They are not hard provider cost, HTTP request or CAD limits. [A06]
Reserve a model-request slot immediately before every outbound generation request, including any structured-output correction or provider retry. The fourth request is not four reasoning turns plus an extra formatting call. Deny a fifth request even if the SDK would otherwise continue. Keep both provider HTTP retries at zero and Strands max_attempts=1; each instance gets its own retry strategy. [A09] The adapter must prove that this counts real outbound attempts, rather than assuming a loop hook observes every transport retry.
Charge one evaluation credit for each newly requested scenario, including invalid coordinates and a cache hit. A numerical search charges each scenario it proposes, not one credit for the entire search tool call. For a batch, reserve its full cardinality before accepting it. Reject oversized batches before enumeration and count the rejected dispatch toward the tool cap. Maintain separate counters for requested evaluations, cache hits, invalid proposals and actual native CAD calls.
Idempotent delivery does not create new work: the same controller-issued request ID with the same canonical payload returns its recorded result without a second debit. The same ID with a different payload is an error. A fresh request ID consumes a credit even if its coordinates duplicate a previous scenario. Tool IDs supplied by the model/provider are not trusted as unique ledger keys.
Charge domain tool dispatches before execution, including invalid or rejected calls. A retried delivery with the same application request identity replays the result. Structured-output submission is accounted through model requests and tokens; it is not an extra geometry capability or a free model request.
Measure active time with a monotonic clock in the parent controller. It includes queue wait, model I/O, dispatch, verification and serialization while a phase executes. Suspend compute deadlines only in explicit user-review states with no agent or CAD job running. Persist consumed time and credits. Browser reconnects, worker restarts and revision reviews cannot replenish them. Use a separate retention timeout for abandoned reviews.
8.6 Invocation and typed results
Strands supports Pydantic output models through structured_output_model on normal agent invocation; use that supported tool-capable workflow, not the separate provider-native parse method. Groq native JSON Schema Structured Outputs cannot currently be combined with tool use or streaming [A19]. Inspect the actual transmitted requests: domain tool calls must not carry response_format with native JSON Schema. Any SDK schema submission or correction consumes the same request allowance. Successful parsing establishes shape, not factual correctness. [A08] Define FailureAnalysis with a summary of at most 1,000 characters, at most 8 evidence IDs and a suggested_next_action enum of inspect_finding, request_repair, run_baseline or stop. Limit each tool result to 16 KiB of public structured data and the assembled input to 64 KiB before model admission; expose a typed size-limit failure instead of silently dropping engineering fields. Validate these initial product limits with the selected model. Any prose explanation is advisory; numerical and verdict cards render from deterministic records. Do not give it authority to set campaign outcome, clearance measurements or approval state.
This invocation is a documentation template. The application supplies the validated prompt, role agent and output model; the installed-version acceptance test must exercise the complete combination.
import threading
async def invoke_analysis(agent, prompt, FailureAnalysis):
cancel_signal = threading.Event()
# Register this signal with the parent controller's Stop/deadline handler.
result = await agent.invoke_async(
prompt,
limits={
"turns": 4,
"output_tokens": 2000,
"total_tokens": 10000,
},
cancel_signal=cancel_signal,
structured_output_model=FailureAnalysis,
)
return result
Create the threading.Event inside the agent process. A child-side IPC listener sets it when the parent sends a cancellation request; do not pickle or attempt to share the threading.Event itself across processes. Register that bridge before invocation, and retain parent-owned terminate/kill/reap enforcement if the child stops responding. Use controller progress events first. If later enabling SDK stream_async for UI progress, use the same supported invocation controls; keep provider streaming off until its separate compatibility test passes. Normal completion, budget exhaustion, cancellation, blocked output, missing structured output and raised SDK exceptions remain distinct states. A failed summary does not erase a verified counterexample; an empty response never creates a successful campaign.
8.7 Process supervision and persistence
Run the agent in a supervised process separate from the parent ledger and the native CAD workers. All tool calls cross the typed gateway. Keep provider credentials available only to the agent process; native workers need no credentials or outbound network access.
On Stop or deadline, deny new work, set the invocation's cancellation signal, stop queued gateway requests, and request graceful shutdown. After the configured short grace interval, terminate, then kill and reap the remaining agent and CAD processes. Record which requests finished and which became cancelled or unknown. Never depend on a timed-out future to stop OCCT.
SDK cancellation is cooperative for running tools. Python agent.cancel() invoked while idle can cancel the next invocation, so prefer the caller-owned signal and explicit process state. [A06][A07] Stopping the local process does not prove that a remote provider stopped generating or billing; mark missing final usage as unknown or estimated.
Persist gateway decisions and completed verifier results before acknowledging them. Recovery may replay a recorded result, but must not silently restart an interrupted agent with a replenished budget. Export sufficient domain evidence for offline replay without requiring Strands, an LLM session, private chain of thought or a live model service.
8.8 Groq provider configuration, account limits and request admission
Provider: Groq's OpenAI-compatible Chat Completions endpoint https://api.groq.com/openai/v1. Use strands.models.openai.OpenAIModel with an injected OpenAI Python AsyncOpenAI client, explicitly configured with the Groq key and base URL. Do not use OpenAI Responses API, default OpenAI URLs, Groq's built-in tools, remote MCP, Bedrock, LiteLLM, a custom inference loop, or a second provider in the submission. The compatibility layer is not a promise that every OpenAI API parameter is accepted. [A05][A16][A17]
| Environment variable / setting | Value / rule |
|---|---|
GROQ_API_KEY | Required only for live AI, server/agent process secret. Never a VITE_ variable or a CLI argument, exported artifact, repo file or logged value. |
TOLERANCE_ARENA_MODEL_ID | Default openai/gpt-oss-120b; optional explicit openai/gpt-oss-20b. Reject anything else in the Community release until reviewed and added to the allowlist. |
TOLERANCE_ARENA_REASONING_EFFORT | Default medium; allow low, medium, high. Use a reviewed low setting for rate-limited smoke tests if necessary; record it. |
| Provider base URL | Constant, not supplied by a model/user request. No redirects or fallback to api.openai.com. |
temperature | Initial 0.2, a tunable demo setting; not a reproducibility guarantee. Compare with the provider-recommended settings if calls are unreliable. |
max_completion_tokens | Initial 2,000 per request; provider may count reasoning. The earlier 4,096 example is not the default here because the existing workflow has tighter budgets. |
parallel_tool_calls | False, because GPT-OSS 20B and 120B do not support parallel tool calls. Sequential SDK executor is also required. |
stream | False for M5; verify a complete non-streaming tool round trip first. UI progress is controller events/polling, independent of provider streaming. |
The .env.example contains only placeholders and non-secret defaults. Use environment/approved secret injection in the agent subprocess, not global frontend configuration. No key, missing extra or invalid settings disables live AI with a clear diagnostic; deterministic operations remain usable. An authorized account and model access must be checked by a bounded live smoke test, not assumed from a published model card. Do not request account access, paid usage or key disclosure without authorization.
Provider configuration template: the current OpenAI adapter source accepts an injected client, a model ID, stream and params; the application owns client lifetime. Test the exact candidate wheel and client API. Use normal HTTPX types, not an assumed alternative transport. admission_hook is an application async callable with the contract below; this code is not a complete runnable application. [A05][A20][A21]
from contextlib import asynccontextmanager
import httpx
from openai import AsyncOpenAI
from strands.models.openai import OpenAIModel
GROQ_BASE_URL = "https://api.groq.com/openai/v1"
ALLOWED_MODELS = {"openai/gpt-oss-120b", "openai/gpt-oss-20b"}
ALLOWED_EFFORTS = {"low", "medium", "high"}
@asynccontextmanager
async def provider_model(*, api_key, admission_hook,
model_id="openai/gpt-oss-120b",
reasoning_effort="medium"):
if not api_key or model_id not in ALLOWED_MODELS:
raise ValueError("Missing Groq key or unsupported model")
if reasoning_effort not in ALLOWED_EFFORTS:
raise ValueError("Unsupported reasoning effort")
timeout = httpx.Timeout(
20.0, connect=5.0, read=20.0, write=10.0, pool=5.0
)
async with httpx.AsyncClient(
transport=httpx.AsyncHTTPTransport(retries=0),
timeout=timeout,
follow_redirects=False,
trust_env=False,
event_hooks={"request": [admission_hook]},
) as http_client:
async with AsyncOpenAI(
api_key=api_key,
base_url=GROQ_BASE_URL,
max_retries=0,
timeout=timeout,
http_client=http_client,
) as client:
yield OpenAIModel(
client=client,
model_id=model_id,
stream=False,
params={
"temperature": 0.2,
"max_completion_tokens": 2000,
"reasoning_effort": reasoning_effort,
"parallel_tool_calls": False,
"extra_body": {"include_reasoning": False},
},
)
For GPT-OSS, use Groq's include_reasoning parameter rather than reasoning_format, which its GPT-OSS documentation says is unsupported. The OpenAI SDK's extra_body passes a provider extension into the request; verify that Strands preserves it and that Groq's response remains tool-compatible. If omission of reasoning prevents a valid multi-turn tool interaction, test a provider-supported alternative and keep any returned reasoning in ephemeral internal state only; never show or export it. No external reasoning traces or raw model messages are required for offline replay. [A18] The temperature, non-streaming behavior, sequential tool flag and completion parameter are integration candidates, not proof of model quality or accepted request format. A 400 is an integration failure; diagnose the exact rejected parameter using sanitized metadata, adjust the approved configuration, and rerun the gates. Never silently drop the endpoint/key/allowlist or switch services.
Create/invoke the role within this async context in one event loop. Use reviewed explicit proxy/custom CA settings only if required, preserving TLS verification and admission controls. Do not reuse the injected client across processes/event loops. Tool schemas contain only local function tools; no Groq built-in tools, remote connections, provider-hosted code execution, web search, automatic cache routing or extra model calls. Do not configure response_format for JSON Schema alongside domain tools. Prefer normal structured_output_model invocation as described in 8.6. If the locked version cannot combine the SDK schema tool with Groq, use the SDK's existing tool loop plus a narrow local output-validation adapter, or a separate schema-only final request within the same budget; prove the actual transport shape. Do not silently accept free-form text as a structured proposal, create a second orchestration loop, or report a failed summary as success. Any fallback is a reviewed M5 decision.
Request admission contract. The async HTTPX request hook validates the final prepared request before transmission. Accept only POST to https://api.groq.com/openai/v1/chat/completions (normal HTTPS port, no user info, unexpected query or redirects). Reject unknown model, unapproved parameter set, native JSON Schema mode plus tools, server tools, unexpected tool manifests, missing limits, invalid body, excessive message size and forbidden outbound data. The body must contain only the bound public synthetic fixture and reviewed role instructions. Validate tool declarations (local functions only, no dynamic registrations), compare the model against the phase's immutable configuration and inspect the effective request rather than relying on the input params dictionary. An approved SDK structured-output function may appear only with the expected name/schema and no domain authority. Verify raw parsed tool argument shape before framework coercion at the gateway. If an adapter discards malformed originals or coerces unsafe values, reject/replace that integration path rather than weakening validation.
Before every send, obtain an atomic, persisted reservation from the parent ledger through bounded IPC. Parent checks phase/workflow request counts, cancellation, remaining active time, selected model and rate/spend admission policy. A missing, late or denied acknowledgment raises and sends nothing. Every prepared attempt, even with the same body, has a new attempt ID. Never place secrets, authorization headers or raw messages in the ledger. If a provider wraps admission errors, the controller's recorded reason is authoritative. SDK max_attempts=1, OpenAI max_retries=0 and transport retries=0 are defense in depth, not the actual request cap. The fourth request includes any formatting call or correction, and the fifth is denied; both roles consume the same workflow allowance. If a transport error occurs after admission, count the attempt, record unknown remote billing where applicable, do not refund it or silently retry.
Rate limits and cost: Groq's public model cards give approximately 500 tokens/s for GPT-OSS 120B and 1,000 tokens/s for 20B, not end-to-end latency guarantees. At this revision the advertised non-cached per-million-token prices are $0.15/$0.60 (120B input/output), $0.075/$0.30 (20B); check current price and billing at setup. Published free-tier summaries list 30 RPM, 1,000 RPD, 8,000 TPM and 200,000 TPD for both; actual org/project limits and model access may differ. [A22][A23][A24] A four-request conversation can exceed the TPM limit because prompts accumulate. Keep tool descriptions and returned evidence compact, meter actual usage, enforce a conservative admission policy against the configured/account-observed token headroom, and check the response's rate-limit headers. The 64 KiB input bound is a data-size cap, not a tokenizer. Start with small synthetic prompts and measure the first live round trip before a full workflow. Do not burn paid credits merely to exercise a rejected tool. If insufficient headroom or 429, expose provider_rate_limited with available retry/reset metadata; retain evidence and stop without automatic retry or reset of the existing phase. A user may explicitly start another workflow under the configured spend/usage policy. Switching to 20B is an explicit configuration decision for a new run, not a hidden fallback. Avoid artificial waits extending a compute deadline. Provision enough account capacity for the judge demo; if not possible, label saved live evidence and provide deterministic replay, while treating live integration/access as its own outstanding gate.
Capture public sanitized metadata: provider groq, exact model ID and SDK/client versions, approved settings, attempted and completed requests, provider request ID when present, reported prompt/completion/total and cached/reasoning token fields when available, latency and terminal status. Distinguish unknown usage from zero and compute cost estimates from the observed price version; no fabricated counts or hard dollar claim from soft caps. Do not forward Groq secrets to the CAD process, browser, GitHub or competition form. Restrict initial live data to public synthetic dimensions/evidence; confirm actual provider data controls and applicable service terms before hosting. [A25]
Transport tests: use a scripted OpenAI-compatible provider and HTTPX mock transport (network denied) for ordinary success; sequential local tool call and final output; five generations; schema-output correction; 400/401/429/500; connection failure; unexpected tool/response format; unknown model/endpoint; redirects; and cancellation while admission is pending. Assert at most four admitted sends per phase and eight per workflow, no provider retries, no requests to non-Groq URLs, no provider-hosted tools, correct secret redaction and resource cleanup. Test missing usage and a slow provider response against the parent deadline; non-streaming HTTP read timeout is not the overall workflow timeout. If later enabling streaming, separately verify Groq's supported stream fields, partial tool assembly, usage and cancellation before shipping. Preserve unknown remote usage after a forced stop.
No separate OpenAI, Anthropic or AWS account is required for this inference configuration. Groq runtime billing and Kiro/Claude development credits remain separate. Keep API credentials out of the release and offer the deterministic offline workflow even when no live key is configured.
8.9 Public progress events and demo behavior
Strands' Python stream includes text, tool and final-result dictionaries; some events also contain raw arguments or reasoning. Translate selected events into an application schema instead of forwarding the SDK stream. [A10] Use POST to start work and request cancellation; polling is sufficient initially. If adding live streaming, use GET SSE to observe the existing run; the official browser guide also uses separated run creation/subscription and warns against trusting tool IDs as durable unique identifiers. [A11]
Emit only public workflow facts: phase started, proposal validated, verifier running, measured result, repair proposed, evaluation finished and terminal status. Build numerical displays from stored verifier records. Show reviewed concise explanations and evidence links; do not display hidden reasoning or partially streamed tool arguments as validated geometry.
Give application events monotonically increasing IDs and reconnect replay. Emit one terminal event even after failure. A browser disconnect does not create a second campaign. The demo shows a failure, a proposed bounded change, the user's evaluation action, measured before/after results and optional application of the new revision. Label prerecorded evidence replay clearly whenever live AI is unavailable.
8.10 M5 acceptance checks and remaining uncertainties
Before enabling the AI button:
- Install the core SDK with only its OpenAI extra in clean Python 3.12; record resolved versions, hashes, licenses and native distributions. Confirm the OpenAI adapter constructor, non-streaming response conversion and typed output workflow; verify the actual emitted tool schema and Groq endpoint. A resolver or import failure blocks AI integration, not deterministic development.
- Use a scripted provider with network denied. Inspect tool declarations it receives and exercise permitted tools. Do not rely on an undocumented registry introspection method.
- Demonstrate that shell, code, file, web, memory, skills, subagents, background tasks, automatic project instructions and external telemetry are absent from this profile. Include a hostile fixture label requesting each prohibited capability.
- Test malformed values, NaN/infinity, out-of-bounds scenarios, cross-workflow evidence IDs, changed constraints, duplicate deliveries, altered duplicate payloads, exhausted budgets and actual termination of a blocked worker.
- Verify that proposal generation cannot evaluate or apply changes, and that user evaluation/apply actions preserve the parent revision and budget ledger.
- Run a metered live Groq smoke test on the public fixture with the selected GPT-OSS model: one real local-tool round trip, then an actual bounded discovery invocation with structured output. Test the repair role in M6. Record model, usage, latency, rate-limit behavior and failures; compare discovery against the deterministic baseline without claiming AI superiority from one demo.
- Verify that replay and normal search issue zero model requests and that polling refreshes cannot repeat side effects. Apply the same reconnect test to SSE if that optional transport is implemented.
This specification verifies published metadata and documented API surfaces. Installed package behavior, complete dependency clearance, provider quality, native performance and end-to-end reliability remain implementation gates. Passing them demonstrates a bounded AI-assisted workflow, not an engineering safety certificate.
9. Technology stack and dependency register
9.1 How to read this register
This register records the libraries and alternatives discussed. It is not an instruction to install all of them. It is also not an exact-wheel license approval.
Status terms:
- Core: needed for the first engineering implementation.
- Introduce when used: approved architectural choice, added at its milestone.
- Optional: useful for a specific measured requirement.
- Reference/fallback: separate comparison environment or an alternative if the main path fails.
- Deferred: planned future capability.
- Not selected: discussed but not part of the current architecture.
License labels below are upstream license families used for planning. Verify the exact version, license files, exceptions, and bundled native components in M0 and again for each shipped artifact. A permissive wrapper does not relicense its native dependencies. A development manifest does not prove the resolved dependency graph of a stable release.
9.2 CAD and geometry
| Dependency | Role and status | License planning note / required check |
|---|---|---|
| Python | Core runtime, CPython 3.12 initial target | PSF and associated component licenses; record interpreter build |
| build123d | Core, provisional high-level modeling/import/export | Apache-2.0; verify chosen release and complete tree [S02][S04] |
cadquery-ocp-novtk / OCP | Core native bindings through build123d | Apache-2.0 bindings; OCCT and bundled code remain separately licensed [S03][S14] |
| OCCT | Core B-rep kernel | LGPL 2.1 with upstream exception; exact binary compliance required [S15][S16] |
| Direct OCP APIs | Narrow adapter implementation detail | Same underlying component obligations; not a separate license escape |
| CadQuery | Reference/fallback high-level CAD | Apache-2.0; inspect actual CasADi/NLopt/VTK and other dependency branches before adopting [S17] |
| CADCLAW | Reference and possible compatible code reuse | MIT code; separate runtime and per-asset rights; preserve attribution [S05][S06] |
cadquery-ocp full distribution | Reference/fallback environment | Do not mix with the no-VTK distribution without verified compatibility |
| VTK | Reference/transitive or future visualization need | BSD-style upstream license; audit bundled third-party libraries; not banned for being large |
| Trame and related viewers | Reference/transitive, not required by selected browser UI | Check exact selected packages and versions; do not strip required dependencies by assumption |
| Pillow | Reference/transitive or image-export need | Permissive upstream licensing; no direct requirement until used |
| Manifold | Optional mesh Boolean experiments | Apache-2.0 upstream; cannot replace industrial B-rep import/verification by itself |
| STEPcode | Not selected as kernel replacement | BSD-style STEP tooling; parsing support is not a complete CAD kernel |
| Truck | Deferred Rust CAD research | Verify release/license and STEP/Boolean behavior; not an MVP replacement |
| Fornjot | Not selected | Recheck maintenance and capabilities if reconsidered; no dependency on an unverified project-status claim |
| FreeCAD | External manual inspection/reference tool | LGPL and component-specific licenses; distribution is a separate decision |
| Commercial CAD SDKs | Not selected for contest | Vendor contracts, redistribution, deployment, and data rights require individual review |
Build123d itself may bring geometry, graph, drawing, font, material, and file-format packages such as anytree, svgpathtools, ezdxf, fontTools, ocpsvg, ocp_gordon, trianglesolver, lib3mf/py-lib3mf, IPython, and other release-specific dependencies. These examples are audit targets, not a frozen inventory. Do not claim that a package is absent transitively merely because it is absent from one direct manifest. [S04]
9.3 Mathematics, optimization, and acceleration
| Dependency | Role and status | License planning note / required check |
|---|---|---|
| NumPy | Core arrays, sampling, transforms | BSD-3-Clause upstream; inspect bundled BLAS and runtime libraries |
| SciPy | Core numerical methods and baseline search | BSD-3-Clause upstream; inspect binary components [S09] |
| NetworkX | Core when assembly graph validation is implemented | BSD-3-Clause upstream; reuse rather than writing a graph library |
| SymPy | Optional symbolic derivation and later constrained kinematics | BSD-3-Clause upstream; not automatically a numerical runtime requirement |
| Optuna | Introduce when persistent studies/trials are useful | MIT upstream; complements rather than duplicates the initial SciPy loop |
| Numba | Optional, only for measured Python numeric bottlenecks | BSD-2-Clause upstream; compilation/startup and dependency cost must be measured |
| llvmlite / LLVM | Transitive if Numba is selected | Distinct license texts and LLVM exceptions; inspect shipped artifacts |
python-fcl | Optional mesh/proximity acceleration | BSD-family Python binding; audit native dependencies and supported shape queries |
| FCL | Native dependency of optional collision path | BSD-family license; do not infer continuous-query support for every shape pair |
| Eigen | Potential native dependency | Primarily MPL-2.0 with release/component-specific details; review actual compiled use |
| libccd / OctoMap | Potential FCL dependencies | Verify exact BSD-style licenses, versions, and binary inclusion |
| CasADi | CadQuery branch or later specialist solver; not independently selected | LGPL-3.0-or-later upstream; manual distribution review |
| NLopt | CadQuery branch or future alternative optimizer | Build-dependent licenses; inspect actual algorithms/binary, not an assumed MIT-only configuration |
| OpenBLAS, BLAS/LAPACK, Fortran/GCC runtimes | Possible native wheel components | Retain component licenses and applicable runtime exceptions; inspect wheel contents |
| MLflow | Optional later experiment tracking | Reassess only if run manifests plus Optuna are inadequate; audit chosen deployment and dependencies |
| OR-Tools | Not selected for this geometric MVP | Discussed earlier for operational optimization; add only for a concrete compatible problem |
Other unrelated domain libraries are not dependencies of this project.
9.4 Application, CLI, AI, and persistence
| Dependency | Role and status | License planning note / required check |
|---|---|---|
| Pydantic | Core schema validation | MIT upstream |
| PyYAML | Core human-authored engineering configuration | MIT upstream; use safe parsing and input limits |
| Typer | Core CLI when commands are implemented | MIT upstream; retain mature CLI behavior |
| Rich | CLI diagnostics and tables | MIT upstream |
| FastAPI | Local server milestone | MIT upstream; do not import it into the core |
| Uvicorn | Local ASGI server | BSD-3-Clause upstream; choose extras deliberately |
| Starlette | FastAPI transitive dependency | BSD-3-Clause upstream; exact version from lockfile |
| SQLAlchemy | Application persistence | MIT upstream; retained rather than a custom ORM |
| Alembic | Application migrations | MIT upstream; introduced with persistent application schema |
SQLite / sqlite3 | Initial local database | SQLite is public-domain software; Python wrapper has its own distribution context |
| PostgreSQL | Later deployment only; not part of the contest | PostgreSQL license; actual extensions and drivers require audit |
| HTTPX | Direct optional AI transport and application/test HTTP client | BSD-3-Clause upstream; hook counts real outbound attempts; Strands owns the provider loop |
| OpenAI Python client | Optional AI extra, used only as a Groq-compatible client | Apache-2.0 upstream [A20]; exact locked license and dependencies must be checked; no OpenAI endpoint or account required |
| Strands Agents SDK | Optional runtime integration at M5, strands-agents[openai] | Apache-2.0; direct Agent, scoped tools, Groq only; detailed register below |
| Pydantic AI / Pi / OpenAI Agents SDK / other harnesses | Reviewed alternatives, not selected | Do not install alongside Strands or silently replace the owner's selection; reassess only for a documented blocker |
| LiteLLM OSS SDK | Not selected initially; possible later alternative | Separate OSS and enterprise licensing; audit exact packaged files if reconsidered |
| LiteLLM Enterprise | Not selected | Commercial terms; do not accidentally ship enterprise code |
| LangChain / LangGraph / CrewAI | Not selected initially | Framework need, exact package license, and hosted-service terms must be reviewed separately |
argparse, json, tomllib, logging, pathlib, uuid, dataclasses, typing | Standard library available as appropriate | Not competing frameworks to reimplement; Typer/PyYAML remain selected for their user-facing roles |
multiprocessing / concurrent.futures | Local process orchestration | Standard library; obey actual process cancellation and serialization semantics [S12] |
The former HTTPX-only orchestration choice is superseded. Keep HTTPX where the resolved stack or a real application transport uses it. Pydantic remains the domain-schema library; Pydantic AI is a different, unselected runtime. An application gateway enforcing CAD policy is still required even though Strands supplies the model/tool loop.
9.4.1 Strands dependency addendum
These are source-level observations checked against the current SDK main manifest on 28 November 2026. They are not a resolved lockfile or a complete SBOM. The published candidate wheel may differ from main. Inspect its METADATA (Requires-Dist, extras and license files) before approving the lock.
| Package | Selection or observed requirement | License planning note | Action |
|---|---|---|---|
strands-agents[openai] | Initial candidate 1.68.0 | Apache-2.0, LICENSE/NOTICE [A03][A13][A14][A15] | Use core SDK, not assembled harness; verify signatures and full lock |
openai | Current main OpenAI extra declares >=1.68.0,<4.0.0 | Apache-2.0; confirm resolved release | Use AsyncOpenAI only against explicit Groq endpoint; inspect native/transitive wheels |
httpx | Current main SDK >=0.28.1,<1.0.0; explicitly import in AI adapter | BSD-3-Clause | Hook admission, HTTPS, timeout, mock transport; audit httpcore/TLS transitives |
boto3, botocore | Current SDK base requires >=1.26.0,<2.0.0 and >=1.29.0,<2.0.0, respectively | Apache-2.0 upstream | Audit if installed; no AWS runtime account or credentials used |
aws-bedrock-token-generator | Current main OpenAI extra >=1.1.0,<2.0.0 | Inspect actual package source and license files; no inferred clearance | If resolved, include in SBOM; do not initialize or use Bedrock |
pydantic | Current SDK base >=2.4.0,<3.0.0 | MIT upstream; native pydantic-core separately inspect | Reuse engineering schemas; reject unsafe/coerced raw inputs |
| OpenTelemetry | Current SDK base includes API, SDK and threading instrumentation | Apache-2.0 upstream; inspect resolved packages | Retain required packages, no exporter extra, no external traces by default; test network behavior |
| SDK support packages | docstring_parser, jsonschema, MCP, PyYAML, typing-extensions, watchdog and dependencies [A13] | Individual license checks | No MCP server/tools merely because MCP package is installed |
Full strands-harness, Anthropic provider extra, Monty, other provider extras, SDK tool bundles, LiteLLM | Not selected | Reassess only through explicit ADR and artifact audit | Do not add in M5; if unexpectedly present transitively, investigate rather than manually deleting required files |
| Groq service and hosted GPT-OSS models | External inference service, no model weights redistributed | Separate service/model terms; API access not granted by SDK license | Check configured account, model availability, data terms and charges |
The core SDK still has a real dependency footprint; eliminating the assembled harness does not eliminate mandatory AWS, MCP or telemetry packages. Keep the base deterministic installation separate from the optional AI extra. Add only dependencies required by this integration, and do not copy an upstream source tree into Community. Verify exact resolved wheel licenses and native components at release.
9.5 Frontend
| Dependency | Role and status | License planning note / required check |
|---|---|---|
| React / React DOM | Local web UI | MIT upstream |
| TypeScript | Frontend language | Apache-2.0 upstream |
| Vite | Frontend development/build | MIT upstream; pin compatible Node version and lockfile |
| Three.js | 3D rendering | MIT upstream; inspect bundled loaders/decoders/assets actually used |
| React Three Fiber | React 3D integration | MIT upstream |
| Drei | Selective 3D helpers | MIT upstream; avoid importing unnecessary asset/network dependencies |
| Plotly.js | Engineering plots | MIT upstream; use an appropriate bundle and preserve notices |
| Tailwind CSS | Optional styling | MIT upstream; add if it improves the UI workflow |
| Lucide | Optional icons | ISC upstream; retain notices |
| Zustand | Optional client-only state | MIT upstream; add only for a real state-management need |
| TanStack Query | Optional API/query state | MIT upstream; distinguish server state from viewport state |
| Fonts, sample models, textures, decoders | Explicit asset inventory | Each asset/component has its own license and redistribution rights |
Choose one Node package manager and commit its lockfile. npm with package-lock.json is an adequate default. Do not keep competing frontend lockfiles.
9.6 Testing, packaging, and operational tools
| Dependency/tool | Role and status | License or terms treatment |
|---|---|---|
| uv | Python environment, locking, packaging | MIT or Apache-2.0 upstream; pin tooling in CI [S18][S19] |
| pytest / pytest-cov | Meaningful unit/integration tests | MIT upstream families; inspect chosen versions |
| Hypothesis | Geometry/specification properties and input validation | MPL-2.0 upstream; development use does not by itself relicense the tested application |
| Ruff / mypy | Formatting, linting, typing | Permissive upstream licenses |
| pre-commit | Local developer checks | MIT upstream |
| Bandit | Optional Python static security checks | Apache-2.0 upstream; evaluate findings rather than treating a clean run as proof |
| gitleaks | Secret scanning | MIT upstream; no guarantee that every secret is detected |
| pip-licenses | Python package inventory | Metadata inventory aid, not native-binary clearance |
| pip-audit | Python vulnerability checks | Security scope differs from license review |
| Syft | Artifact and image SBOMs | Apache-2.0 upstream; combine with manual/native inspection |
| ScanCode Toolkit | Optional source/license scanning | Review tool license and generated-output terms; development/compliance tool |
| OSS Review Toolkit | Later compliance automation if needed | Apache-2.0 upstream; do not build a large compliance platform for the first spike |
| Trivy | Image/security scanning | Apache-2.0 upstream; actual image still needs a licensing inventory |
| Docker Engine/Moby and Compose | Reproducible local packaging when useful | Apache-2.0 upstream components; image contents have separate licenses |
| Docker Desktop | Optional developer product, unnecessary on initial Linux target | Separate vendor subscription terms |
| GitHub Actions | CI service and selected actions | Service terms plus each action's license; pin actions appropriately |
| Redis / Celery | Deferred job infrastructure | Check exact release licenses and service terms; do not assume historical Redis licensing |
| S3 or compatible object storage | Deferred remote artifact storage | Service/client terms and data handling; not a single OSS dependency |
| Kubernetes | Not selected initially | Introduce only for a measured operational requirement |
9.7 FEA, desktop, and Rust alternatives
These are planning entries only and must not enter the initial production lockfile by default.
| Dependency/group | Status and intended use | Condition before adoption |
|---|---|---|
| scikit-fem | Optional later finite-element assembly | BSD-3-Clause upstream; needs a complete meshing, model, solver, and validation plan |
| PyniteFEA | Optional later structural analysis | MIT upstream; validate that its supported element/model classes match the problem |
| Gmsh | Deferred meshing | GPL/commercial licensing options require architecture-specific review; no automatic closed-source embedding |
| CalculiX | Deferred external solver | GPL obligations depend on actual integration and distribution; subprocess invocation is not an automatic exemption |
| FEniCSx / PyVista | Earlier physical-engineering alternatives; not selected | Reevaluate numerical need, native tree, and licensing if FEA becomes a product capability |
| PyQt / PySide6 | Not selected for current web UI | GPL/commercial or component-specific LGPL/GPL/commercial terms; no need to add a desktop toolkit now |
| PyO3 / Maturin | Future Python-Rust extension route | Introduce only after profiling, with wheel/release testing and license review |
Parry (parry3d-f64) / Rapier | Future native geometry or dynamics experiments | Validate mesh approximations and supported queries; dynamics are outside the rigid-geometry MVP |
| Rayon / nalgebra / argmin | Future parallel numeric extension | Demonstrate benefit over the existing Python/native path; audit selected crate graph |
opencascade-rs, cxx, cxx-build | Earlier Rust CAD route, not selected | Reconsider only if the Python adapter cannot serve a demonstrated requirement |
| Tokio / Axum / Reqwest / SQLx | Earlier Rust application route, not selected | Do not build a second server/runtime stack alongside the chosen Python application |
| Serde / serde_json / thiserror / anyhow / tracing | Earlier Rust support libraries | Relevant only to an approved native/Rust component; exact crate licenses then |
| proptest / criterion | Future Rust testing/benchmarking | Add with an actual Rust component, not a placeholder crate |
Rust does not automatically accelerate an OCCT call already running in C++. Profile orchestration, data conversion, mesh queries, and memory before deciding what to move.
9.8 Dependency groups
The following manifest is the eventual grouping plan, not the B0 installation. Introduce groups when their milestone begins. Resolve the unpinned CAD/application packages during M0 and retain exact versions/hashes in uv.lock; validate the observed Strands candidate pins at M5. A version in this sketch is not an installed test result or license clearance.
[project]
name = "tolerance-arena"
version = "0.1.0"
requires-python = ">=3.12,<3.13"
license = "EUPL-1.2"
dependencies = [
"build123d",
"cadquery-ocp-novtk",
"numpy",
"scipy",
"pydantic",
"networkx",
"pyyaml",
]
[project.optional-dependencies]
cli = ["typer", "rich"]
server = ["fastapi", "uvicorn"]
persistence = ["sqlalchemy", "alembic"]
agents = ["strands-agents[openai]==1.68.0", "httpx"]
# Initial candidate, validate wheel metadata and Groq integration at M5.
optimization = ["optuna", "sympy"]
[dependency-groups]
dev = [
"pytest", "pytest-cov", "hypothesis", "ruff", "mypy", "pre-commit"
]
compliance = ["pip-licenses", "pip-audit"]
The Python upper bound reflects our first supported application target, not an assertion that build123d only supports Python 3.12. Expand the support matrix after CI validation.
Declare cadquery-ocp-novtk directly once application code imports OCP; do not rely on an undeclared transitive import. Resolve its version jointly with the chosen build123d release. The sketch deliberately omits untested version bounds.
Do not introduce acceleration or FEA extras until separately evaluated. Optional groups can still affect dependency resolution; they are not a way to ignore incompatible native packages. Keep incompatible CAD reference stacks in separate projects/environments and lock them separately. uv documents both locking and resolution across optional dependencies. [S18][S19][S20]
Commit uv.lock for the application and a frontend lockfile when the frontend exists. Use locked installs in CI. Record the exact native-library versions and binary hashes in addition to Python package versions. Avoid unexpected floating upgrades during experiments.
10. EUPL-1.2 licensing, ownership and publication gate
10.1 License and scope
Use the complete, unmodified official English EUPL-1.2 text from [H3] as root LICENSE. Put EUPL-1.2 in package license metadata and appropriate first-party SPDX headers. State “EUPL v. 1.2 only” in the README and first-party notice; do not invent an EUPL-1.2-only SPDX identifier or add restrictions inside the license. Include LICENSE in source and application packages. Check actual GitHub license detection in its About section before submission.
EUPL is OSI-approved and permits commercial use. Its source and reciprocal distribution/communication obligations apply according to its terms. Choosing version 1.2 only does not remove its compatible-license clause. The license does not prohibit competitors or guarantee a startup moat. [H3][H13]
The first-party Community release includes the verifier, scenario search, Strands adapter, prompts, public fixtures, replay, UI, bounded numeric repair and before/after comparison, tests and build instructions needed for the advertised demonstration. These components share the Community license. There is no private implementation needed to reproduce the submitted feature. Preserve the original licenses of incorporated third-party material; this document does not relicense it.
Future general CAD repair, PLM integrations, customer datasets and private benchmark collections remain outside this submission. A separate commercial service requires an assessment of its actual code, ownership and integration; calling it Enterprise does not establish a different license entitlement.
10.2 Strands and other dependencies
The selected Strands Agents SDK repository carries Apache-2.0 and a NOTICE. The European Commission identifies permissive Apache, MIT and BSD licenses as inbound-compatible with EUPL. Preserve applicable upstream license, attribution, NOTICE and modification notices in distributed artifacts. This permits the planned dependency relationship; it is not clearance of every transitive package or future proprietary combination. [H13][H14]
Keep the dependency register in section 9, including useful optional and deferred libraries. Activation depends on an implemented feature and a resolved, reviewed package graph. Do not remove a permissive dependency because it is substantial, or replace a tested library with custom code solely to reduce the manifest's length.
The core SDK and selected OpenAI extra can still bring AWS, MCP and telemetry packages. Record the actual resolved dependencies, including native components and telemetry libraries. SDK licenses do not grant Groq API access, credits or hosting rights. Keep deployed model billing separate from development-tool subscriptions.
Review LGPL/MPL/EPL, GPL/AGPL, dual licenses, exceptions, source-available terms and unknown metadata in the context of the combined work and distribution. No license family receives automatic approval or a blanket prohibition here. Resolve conflicts before including an affected component in a release. A Python wrapper, subprocess, HTTP interface, separate repository or container does not automatically settle copyright dependence or copyleft obligations.
10.3 OCCT and native distribution
The OCP wrapper's Apache license is separate from OCCT's LGPL-2.1 with its additional exception. The exception concerns specified header-material incorporation in object code; it does not cancel every redistribution duty. Consult the selected release's license and exception, not only a package badge. [S14][S15][S16]
For each shipped wheel, executable or container, identify linked libraries, source versions, modifications, notices and the applicable source/replacement or relinking requirements. Retain required recipient rights. Make required corresponding kernel source and build information available through the chosen compliant distribution route. Inspect the actual libraries bundled in the OCP wheel; do not treat its top-level Apache metadata as the license of the entire binary payload.
A public source repository, browser bundle, hosted backend and downloadable image have different contents and obligations. Prefer source with locked installation instructions for the first release. This reduces packaging work but does not remove attribution, ownership or source obligations that apply to the actual release.
10.4 Required audit evidence
Before publishing, identify the exact material being released and complete its applicable checks. Before distributing binaries or an application package, produce all of the following:
- Direct and transitive package inventory with exact versions, hashes, upstream source and selected extras.
- Native shared/static library inventory and source provenance, including bundled libraries.
- Frontend bundle and third-party asset inventory, including fonts, examples and media.
- SPDX expressions checked against the chosen release files; unresolved entries stay marked unresolved.
- Required copyright, attribution, license, NOTICE and exception texts.
- A record of modifications and the obligations they trigger.
- Corresponding-source, build, replacement or relinking materials where required.
- An SBOM for each shipped artifact, including container OS packages when distributing an image.
- Reviewed exceptions with an owner, affected versions/artifacts and a re-review trigger.
- A clean installation and reproduction check of the release candidate.
Retain LICENSE, THIRD_PARTY_NOTICES.md, compliance/dependency-inventory.json, compliance/approved-exceptions.yaml, relevant license texts, asset provenance, Python/npm locks and applicable release SBOMs. Record an empty exceptions list when none are approved. Keep reports free of credentials and private paths.
pip-licenses, Syft and other selected audit tools provide evidence; a scan result is not a legal opinion. Resolve missing or conflicting metadata against actual artifacts. A vulnerability check addresses a separate question. This specification contains a planning license inventory, not a completed wheel, container or transitive-license clearance. Block affected publication or redistribution until required evidence is complete; record the reason and permitted alternative.
10.5 Ownership and contributions
Identify the actual copyright holder before publication. Do not invent a company or assign rights through generated documentation. Confirm employment/IP obligations and permission for reused code, CAD, media and examples. Use synthetic fixtures whose origin and redistribution rights can be documented.
DCO-style declarations record origin; they are not copyright assignments and do not themselves grant an alternate proprietary license. Establish reviewed contributor terms before accepting outside contributions. A CLA may grant additional rights if its actual wording provides them; its name alone proves nothing. No agent may assume that the project can commercially relicense all contributions or third-party code.
Keep private planning, customer information and unreleased commercial code out of the public repository and public development context. Run the history and artifact review from section 2.1 before making the repository public. License detection, notices and a clean current tree are individual checks, not substitutes for the complete release gate.
11. Step-by-step implementation plan
Implement one gate at a time. B0 is a subset of H0/M0/M1/M2, not completion of those milestones. M3 is the first engineering MVP. M5 adds the selected runtime; M6 adds the advanced Community feature; M7 prepares the release. Work after a failed gate addresses the failure or narrows an unsupported capability, rather than scaffolding later features.
B0: Claude Code or Codex bootstrap, then stop
Scope: the existing single-fixture measurement proof. Use the actual remaining allowance, not an inferred token quota.
- Read this document and any existing repository instructions. Identify the current commit and preserve existing work.
-
Create only essential files: official EUPL-1.2 license, README, minimal
pyproject.tomland lock,AGENTS.md, initial.kiro/steering/,.kiro/specs/clearance-verifier/{requirements,design,tasks}.md, and a concise progress/development log. Do not generate the entire planned directory tree. - On CPython 3.12, resolve a stable build123d/OCP combination in a clean environment. Start from the published candidates in section 9, but inspect the actual resolver result. Install only packages used for this step.
- Create the two physical cylinders from section 2.3. Measure actual B-rep clearance at q=45°, delta=0 and delta=-1.2 mm, and several additional poses.
- Implement the independent analytical helper separately from the native adapter. Validate dimensions, placements, units and a common rigid transform.
- Add a small CLI, with text/JSON outputs, finite sweep and distinct failure states. A query error cannot fall back to the oracle or a passing value.
- Run focused tests: nominal/adverse values, domain/nonfinite rejection, a threshold-band case, transform invariance and a native failure path. Record the actual commands, outputs and environment.
- Save a coherent checkpoint and handoff: what passed, what failed, exact dependency versions, unresolved H0/M0/M1/M2 work, and the next Kiro task.
Acceptance: real native measurements agree with the oracle within the justified comparison tolerance; the nominal case satisfies and the adverse case violates the 1.5 mm requirement; the sweep reports its finite scope; a fresh process can repeat the commands.
Hard stop: after that checkpoint, or earlier if quota/access/blockers require it. Do not implement the Strands integration, provider calls, repair, generic CAD import, general collision/containment, optimization, evidence bundles, API, database, frontend, Docker or commercial features in B0. Try at most one focused compatibility repair before handing off a documented native blocker. An incomplete B0 is an incomplete handoff, not a passed gate.
H0: Project and contest readiness
- Confirm eligibility, rights to new work, actual Kiro access and the current contest rules. Treat credit approval as pending until observed.
- Develop in the agreed private Community repository. Keep the private product/commercial plan outside its files and history. No second proprietary runtime is required for the submission.
-
Track the canonical
.kirotree andAGENTS.md; create truthfuldocs/KIRO_USAGE.mdand development records. NoCLAUDE.md. - Choose the supported target: Ubuntu 24.04 x86-64, CPython 3.12, uv; compatible Node LTS/npm when the viewer is introduced.
- Decide the judge access route early. A restricted hosted synthetic-fixture demo is the preferred working URL; a local release alternative needs organizer confirmation if its acceptability is uncertain.
Gate: a clean project with explicit ownership, current eligibility/access status, one developer instruction system, and a public-safe release plan. No real customer models or unapproved assets.
M0: Native compatibility and process supervision
-
Resolve and lock the selected CAD packages; inspect their release metadata and native libraries. Produce
arena doctorwith OS, Python, adapter/OCP/OCCT versions and capabilities. - Run separation, touching, overlap, inclusion and invalid-shape fixtures appropriate to the advertised query scope. Treat unsupported classification as unknown.
- Validate cylinder regeneration, transforms and the GLB export scale/orientation. STEP round trips and repeated occurrence tests are required only before advertising those import capabilities.
-
Launch a CAD worker with explicit
spawn; exercise query failure, process crash and hard timeout, including terminate/kill/reap and fresh IPC. - Record measured startup time, per-scenario latency and peak memory. Review native license obligations and create the CAD ADR.
Gate: required geometry and display functions work in the real installed environment. No mocked engineering result, mixed full/no-VTK OCP namespace, or mesh-only substitute. If blocked, try narrow direct OCP access before evaluating CadQuery in its separate environment.
M1: Typed verifier and evidence contract
- Implement versioned domain models, safe YAML/JSON parsing, unit normalization, immutable policy/design objects and canonical hashes.
- Implement geometry relation, clearance verdict, execution state and campaign conclusion separately.
-
Implement the supported
fixture,validate-spec,verifyanddoctorcommands. Addinspectonly for supported inputs. - Persist measured values, witnesses when available, reasons, input identities and numerical settings.
- Test threshold ambiguity, invalid/empty scopes, inclusion interpretation, stale bindings, unsupported shapes and failed native queries.
Gate: the same verified inputs yield the expected result classes without a model, web server or network. One violation never becomes a whole-assembly safety statement.
M2: Motion and manufacturing variation
- Generalize the fixture to explicit fixed/revolute transforms and real parameter/offset bindings. Reject unsupported closed chains and inconsistent units.
- Validate q=45° at nominal/adverse offsets, both endpoint poses, nested transforms where supported and realized geometry after offset application.
- Implement sampled sweeps and explicit sample spacing. Reproduce the coarse 0/30/60/90° miss and the known 45° finding.
- Export geometry with one occurrence transform and one documented CAD-to-view conversion. Verify witnesses and meshes align.
Gate: the native engine reproduces the positive-distance violation and correctly labels the sampled scope. The analytical reference remains a test oracle for the declared fixture.
M3: Bounded search, counterexample and offline replay
- Implement fixed diagnostic cases and at least one seeded baseline. Add Sobol and SciPy differential evolution once the budget/evaluator interface works.
- Count evaluation credits and actual native queries separately; include rejected requests, retries, cache behavior, confirmation queries and optimizer polishing in the declared accounting.
- Persist the counterexample, frozen problem, concrete scenario, result, environment and replay policy.
- Replay in a fresh process without importing or calling the agent runtime. Reject stale inputs and report numerical/verdict mismatches.
- Test cancellation, restart reconciliation, zero/invalid budgets and exhausted searches. Preserve findings when later work stops.
Gate, engineering MVP: a real bounded failure can be discovered, exported and replayed without an LLM. Record latency and success across fixed seeds; do not claim AI advantage.
M4: Local application and evidence viewer
- Add FastAPI run, status, findings, replay and artifact routes around the same coordinator. Keep evidence files first; add SQLAlchemy/Alembic only when durable project indexing is needed.
- Build the React/Three.js viewer, units/bounds panel, selected measured case, clearance plot and replay/export controls.
- Use polling first. Test artifact scoping, cross-origin controls, worker cancellation, missing runs, restart recovery and frontend/backend identity parity.
- Test a clean installation and the intended restricted judge-access deployment.
Gate: a user can run the fixture, inspect a verified failure and replay it through the UI. The engine works offline after installation. The viewer does not compute engineering verdicts.
M5: Actual core Strands SDK + Groq integration
-
Install
strands-agents[openai]==1.68.0as the initial candidate plus direct HTTPX; resolve and lock the SDK/client/transport, validate signatures and non-streaming support. Keep base installation independent of AI; record any version change in ADR-010.uv sync --extra agentsis the target when the optional dependency group has been added, not a B0 instruction. -
Implement
agents/strands_runtime.pyaround directstrands.Agentandagents/provider_config.pyaround the injected GroqOpenAIModelin section 8. UseGROQ_API_KEY, explicit model/effort allowlists and a redacted.env.example. Do not write a replacement model/tool loop. - Connect scoped domain tools to the coordinator ledger. Keep provider keys outside CAD workers; keep prompts and all advertised runtime code public.
- Run the no-network scripted-provider gate: actual Groq endpoint and request shape, non-streaming tool loop and schema output, allowlisted tools, no automatic context/session/memory files, no remote tools or external telemetry; prove real send counting, zero retries and negative-path handling.
- Test malformed/out-of-bounds requests, duplicate calls, budget exhaustion, transport errors, cancellation during a tool, missing credentials and structured-output validation failures.
- With separately authorized Groq runtime credentials, run a small live GPT-OSS 120B smoke test (20B only as explicit recorded alternative) followed by bounded discovery. Record actual model, versions, tool/evidence IDs, reported usage/latency, observed rate limits and stop reason. No automatic model/provider fallback; handle 429, missing key and unsupported parameters visibly.
- Compare the live run with the declared numerical baseline. Export a sanitized, labeled recorded trace for offline inspection.
Gate: the actual selected Strands SDK and Groq model reach the real verifier through typed tools, and the app renders only validated evidence as engineering fact. Missing access blocks the live-AI claim; a recorded trace is not a substitute for this integration test.
M6: Required advanced Community feature A1
-
Add immutable revision proposals and the separate
policy_hash/design_revision_hashmodel from section 6.5. - Freeze and hash the final validation cases before proposing a repair. Do not disclose their results to the repair role during selection.
- Instantiate the restricted repair role through the same direct SDK constructor. It may propose only the allowed nominal obstacle-radius change and cite stored evidence.
- Show the proposed edit, units, limits and fixed requirements for user review. The backend validates it before creating a candidate; the model cannot apply it.
- On “Evaluate proposal,” regenerate real candidate geometry and screen the source case. On “Run final comparison,” evaluate the selected original/candidate pair against the reserved 180-credit paired plan within the 200-credit repair allocation.
- Render synchronized before/after geometry, measured source-case values, both clearance curves, completion counts, changed dimension and unchanged requirement/bounds.
- Add apply/undo as active-revision selection, preserving original files and evidence. Add a self-contained comparison bundle and offline comparison replay.
- Run positive and negative A1 tests: valid improvement, threshold ambiguity, invalid edit, infeasible range, stale identity, policy tampering, interrupted validation and replay mismatch.
Gate: a real AI proposal can become a reviewed candidate, pass the specified paired native checks, and be replayed offline. The expected illustrative case is 46.0→46.8 mm and 0.8→1.6 mm at the same adverse pose; actual UI numbers come from the kernel. No global safety or optimality claim.
This feature is part of the requested submission target, not an optional afterthought. If M6 cannot pass before release freeze, disclose that and obtain a deliberate scope decision; do not label a partial or scripted comparison as the completed advanced feature.
M7: Public release and submission
- Complete the actual Kiro spec, correctness, hook and implementation evidence; record Claude/Codex work truthfully.
- Resolve source/asset rights and exact shipped-artifact license obligations. Include the Strands Apache/NOTICE and native OCCT material where applicable.
-
Inspect all publishable history, branches/tags and attached artifacts for secrets or confidential material. Prepare the complete Community source and tracked
.kiro. - Perform a fresh-clone locked install, deterministic workflow, live-runtime smoke test when available, A1 comparison and offline replay. Verify the documented judge URL.
- Make the prepared Community repository public under the owner's publication plan, verify license detection and anonymous access, and freeze the submission tag.
- Produce the short demo, supported-scope README, dependency/asset notices and factual Kiro writeup. Submit before the official deadline.
- Keep the submitted version and judge access available through the judging period; identify later changes separately.
Gate: advertised behavior, source, evidence and judging access agree. Native execution, dependencies and tool usage have actual records. No private code, paid enterprise entitlement or owner API key is needed to reproduce deterministic verification and comparison.
Optional M8: Later Community improvements
After the submitted path works: counterexample reduction, supported STEP-plus-sidecar UI, more fixtures, extra numerical strategies, persistent project indexing and improved report export. Each extension retains the same public verifier and explicit supported scope. General CAD redesign, proprietary connectors, organization controls and distributed commercial operations remain outside this document.
11.1 Working calendar and cut decisions
Dates are planning windows. Start from the real checkpoint; do not replay completed milestones or assume credit approval.
| Window, 2026 | Focus | Decision |
|---|---|---|
| Now, until B0 stop/access | Claude/Codex single-fixture proof | No Strands, viewer or repair work yet |
| As soon as Kiro is available | IDE requirement review; CLI completes M0–M3 | Establish verified counterexample and replay before new UI work |
| 29 Nov–1 Dec, subject to gates | M4 viewer and M5 Groq/Strands integration | Keep one fixture and one tested provider; request credits before the official cutoff |
| 1–2 Dec | M6 repair and comparison; IDE properties and hooks | Protect the single advanced feature by cutting unrelated extras |
| 3 Dec | Feature freeze, clean install, public repository, working URL and video | No new feature implementation |
| 4 Dec, before 14:00 PST / 16:00 Mexico City / 22:00 UTC | Final submission check and entry | Submit early; do not depend on the final minutes |
First remove arbitrary import UI, extra mechanisms, optional optimizers, persistent-project polish, multi-agent delegation and extra charts if time is tight. Preserve the measured verifier, evidence, replay, real Strands integration and the bounded comparison. If those cannot pass the gates, the owner decides whether to submit a smaller accurately described project or continue outside the contest. Do not weaken engineering checks, fabricate Kiro usage or hide an unfinished feature to meet the schedule.
12. Shared coding-agent and Kiro workflow
12.1 Purpose, ownership and phase transition
Use one canonical Kiro-native project contract from the first commit. .kiro/steering/ contains persistent standards; .kiro/specs/<feature>/requirements.md, design.md and tasks.md govern each feature. A concise AGENTS.md is the repository entry point and index, not another independent spec. Both Kiro IDE and CLI support workspace steering and AGENTS.md; current docs describe a shared harness and configuration, with surface-specific capabilities [H2][H4][H11]. Claude Code does not natively discover or execute .kiro merely because it exists. It must be instructed to read the same actual files every session. This is explicit context loading, not model training.
Role allocation: Claude Code establishes only the B0 single-fixture prototype. Kiro CLI becomes the default implementation tool after authorized access, including outstanding geometry work, motion, search, replay, the local application, Strands runtime and repair comparison. Kiro IDE owns native EARS/spec refinement, correctness properties, hooks, bugfixes and integration review. The owner reviews engineering assumptions and approves release. Codex is an owner-selected substitute for Claude, not a required parallel workflow.
| Work package | Primary implementation owner | Review / handoff evidence |
|---|---|---|
| B0 subset of H0/M0/M1/M2 | Claude Code (remaining quota) | Native cylinder measurements, independent formula, CLI, basic sweep, real test evidence, honest checkpoint |
| Remaining H0/M0/M1 | Kiro CLI, Kiro IDE review | Resolve unfinished compatibility, typed verifier and error semantics, license inventory |
| M2 joint transforms, bindings, uncertainty | Kiro CLI | Kiro IDE reviews properties and verifies generated geometry, bounds and sampling limits |
| M3 search, budgets, evidence, replay | Kiro CLI | Kiro IDE correctness and independent replay in a fresh process |
| M4 minimal FastAPI/worker/viewer | Kiro CLI | Kiro IDE end-to-end checks, same evidence and coordinate/units mapping |
| M5 live bounded AI analyst | Kiro CLI | Kiro IDE reviews frozen requirements, tool bounds and evidence; authorized actual provider run |
| Optional review after Claude renewal | Claude Code, only explicitly assigned | Review diff or small disjoint support task; actual contributions logged; no ownership of reserved work by default |
| M6 required repair comparison | Kiro CLI | Kiro IDE validates policy immutability, paired evidence and offline replay |
| M7 validation and release | Kiro IDE + CLI; owner | Native correctness/hook evidence, actual smoke tests and truthful contribution record |
| Optional M8 | Kiro CLI after the required release path | Separate future Community usability improvements |
These are planned owners, not a claim about completed work or a quota/code percentage. No fixed Kiro percentage or exclusive-use rule has been established from the cited rules. If access arrives early, transfer the next incomplete task immediately; do not rewrite functioning code solely to create Kiro attribution. If access is delayed, prioritize a genuine smaller submission or continue outside the contest. No external assistant can mark a native Kiro activity as executed on Kiro's behalf.
When to choose each surface:
- Kiro IDE: initiate/review feature or bugfix specs; analyze EARS acceptance criteria; extract correctness properties in design; run linked property-based tests in execution; investigate real counterexamples and configure/trigger supported native hooks. Perform these activities early enough to influence implementation, not solely during release. Record when the native workflow actually ran.
- Kiro CLI: implement approved tasks, run terminal tests, iterate on native CAD/search/AI integrations, fix defects and prepare small reviewed commits. Use shared check scripts and actual supported hooks. CLI can write and execute Hypothesis tests; it does not currently offer the IDE's dedicated spec Correctness workflow [H2][H12].
- Claude Code: B0 only while quota is constrained; after renewal, optional independent review or explicitly reassigned disjoint support work. Load Kiro steering and the assigned feature spec explicitly, run ordinary shared scripts and report actual evidence. Never claim to execute Kiro-native features. Do not create or load a project
CLAUDE.md, nestedCLAUDE.md,CLAUDE.local.md, separate Claude-specific project instructions, or a parallel task system. - Human owner: approve requirements and architecture changes, confirm actual geometry and data provenance, make scope/license decisions, review diffs and test evidence, authorize paid calls and publication. A passing property test is evidence, not formal verification of the mechanical assembly.
12.2 Repository layout
tolerance-arena/
LICENSE
README.md
AGENTS.md
THIRD_PARTY_NOTICES.md
CONTRIBUTING.md
SECURITY.md
pyproject.toml
uv.lock
.gitignore
.kiro/
steering/
product.md
tech.md
structure.md
engineering-invariants.md
development-workflow.md
security-and-license.md
specs/
cad-compatibility/
requirements.md
design.md
tasks.md
static-verifier/
requirements.md
design.md
tasks.md
motion-and-uncertainty/
requirements.md
design.md
tasks.md
search-and-replay/
requirements.md
design.md
tasks.md
local-demo/
requirements.md
design.md
tasks.md
ai-failure-analyst/
requirements.md
design.md
tasks.md
repair-comparison/
requirements.md
design.md
tasks.md
hooks/
engineering-checks.json
task-validation.json
docs/
community-spec.md
adr/
progress.md
development-log.md
KIRO_USAGE.md
demo-script.md
limitations.md
src/tolerance_arena/
domain/
cad/
geometry/
kinematics/
uncertainty/
verification/
search/
evidence/
agents/
strands_runtime.py
provider_config.py
tool_gateway.py
prompts/
failure_analyst.md
repair_proposer.md
repair/
application/
persistence/
api/
cli/
fixtures/
rotating_pin/
analytical/
LICENSES.md
tests/
unit/
integration/
properties/
e2e/
frontend/
package.json
package-lock.json
scripts/
check-fast.sh
check-geometry.sh
check-release.sh
compliance/
.github/workflows/
Create directories and feature files only as relevant work starts. During B0 use a small flat package and the single clearance-verifier feature spec; migrate into the planned modules only when Kiro needs those boundaries. The layout is a plan; an agent must not generate empty packages, untested hooks or cosmetic artifacts merely to fill it. Store public sanitized logs, never raw private sessions, keys or unrelated conversations. Local secrets and run caches can be ignored outside .kiro; nothing under .kiro may be ignored for the submission.
12.3 Single root entry point and Claude Code startup (copy-ready)
Create AGENTS.md with the following content, adjusting paths if the repository changes:
# ToleranceArena contributor instructions
Read docs/community-spec.md and .kiro/steering/product.md, tech.md,
structure.md, engineering-invariants.md, development-workflow.md, and
security-and-license.md before changing implementation. Read the active
feature's requirements.md, design.md and tasks.md under .kiro/specs/.
Use docs/progress.md to locate the active milestone. These files are the
shared project contract for Codex, Claude Code, Kiro and humans.
During B0, read the minimal steering files that have been created and the
clearance-verifier spec; add later steering only when its scope starts.
Finish B0 or hand off an earlier coherent checkpoint, then stop.
Do not implement runtime Strands, the viewer or repair during B0.
Implement the smallest unmet acceptance criterion. Preserve the frozen
engineering requirement, bounds, units, result semantics, public scope
and EUPL-1.2 licensing. Do not add unnecessary dependencies or fabricate
results. Execute the applicable scripts/check-fast.sh and
scripts/check-geometry.sh once implemented. A completed task needs actual
passing evidence. Update the active tasks.md, progress and development
log. Identify which tool actually did the work. If a Kiro-only feature
cannot be run in this environment, mark it pending Kiro validation.
Never claim that preparing configuration is Kiro execution.
Do not create or rely on CLAUDE.md, CLAUDE.local.md or a separate
Claude-specific project instruction tree. Load the canonical .kiro
files explicitly if your tool does not discover them natively.
Do not expose secrets or private material, publish externally, or run
paid provider calls without appropriate authorization. If an instruction
conflicts with the engineering invariants, stop that change and record it.
No Claude-specific repository memory. Do not create CLAUDE.md or CLAUDE.local.md, including in nested directories. Do not run /init in Claude Code to generate a competing instruction document. Do not hide these files through .gitignore as a way to imply that a different tool was used. Keep the actual contribution record. AGENTS.md is supported by Kiro and Codex [H4][H8]; Claude Code reads it by explicit instruction or explicit prompt injection, not assumed native discovery.
For initial bootstrap before AGENTS.md exists, start a fresh Claude session with the prompt in section 12.7 and the path to this spec. After bootstrap, from the repository root, use the documented append flag to load the exact shared entry point [H7]:
claude --safe-mode --append-system-prompt-file AGENTS.md
Claude's documented --safe-mode skips automatic loading of project/user CLAUDE.md and other customizations while retaining authentication, built-in tools and normal permissions (managed settings still apply). It is useful here because the project contract must come from .kiro, not inherited Claude memory. Confirm both flags with claude --help and verify a fresh session on the installed release; this command is not yet executed for the project. Do not use --dangerously-skip-permissions. If the installed version does not support this workflow, use a clean supported configuration and explicitly paste the shared entry instructions in a fresh session after checking that no unwanted memory is loaded; do not bypass organizational controls. Avoid --bare as a default because its authentication and customization behavior differs.
At the start of every session, before any write, the agent must identify the assigned milestone, current commit and task ID; read the applicable .kiro/steering/*.md files and active requirements.md, design.md, tasks.md plus current docs/progress.md; and report a short readback of the scope, acceptance criteria, invariants, license and test commands it will follow. Resolve missing files or conflicts before editing. The system prompt append loads the entry point, not the entire .kiro tree: the file reads remain mandatory. Repeat after context compaction if needed and on switching tasks. Do not maintain a second copy of .kiro under another framework. Kiro-specific hooks are run natively only in Kiro; Claude calls their reviewed underlying shell scripts and records those runs as Claude work.
12.4 Steering files and spec templates
| File | Mandatory contents |
|---|---|
product.md | Community purpose, Frankenstein category, demo flow, P0/P1/P2 scope, truthful limitations |
tech.md | Python 3.12/uv, provisional build123d/OCP, NumPy/SciPy, retained application/UI dependencies, core Strands Agents SDK + Groq (GPT-OSS 120B/20B), no GPU/training, separate fallback env |
structure.md | Domain boundaries, one verifier, CAD worker isolation, evidence ownership, test layout |
engineering-invariants.md | Requirements REQ-01..16, unit/frame rules, separate result levels, fixed uncertainty and constraints, independent replay, no proof from sampling |
development-workflow.md | Role allocation from section 12.1; gate/evidence logging; explicit .kiro reads; no Claude memory file; native Kiro IDE correctness, CLI implementation, shared scripts, honest attribution |
security-and-license.md | EUPL-1.2, provenance, native audit, safe local app, opt-in model calls, public-only context |
Use Kiro's documented steering metadata; foundational always-included instructions may use inclusion: always YAML front matter where the installed version supports it. Check native discovery and inclusion in Kiro rather than assume. Each feature spec has three canonical artifacts [H2]:
requirements.md: user story, scope, unique requirement IDs, testable EARS-style acceptance conditions, non-goals.design.md: typed contracts, execution flow, error cases, geometry/algorithm assumptions, tests and decisions.tasks.md: ordered checkboxes linked to requirement IDs, concrete implementation files, commands and gate evidence. Do not mark completion merely because code was generated.
Example requirement for search/replay:
## SR-01: Confirmed failure evidence
When a valid bounded scenario violates the frozen clearance requirement,
the verifier shall return a violated verdict with the measured distance,
threshold, occurrence IDs, scenario values and required replay metadata.
If a geometry query fails, the verifier shall return an indeterminate
result unless another independently confirmed violation establishes the
campaign finding. A finite search shall not imply global safety.
## SR-02: Replay
When a valid saved counterexample is replayed in a compatible environment,
the system shall reproduce the verdict and measurement within the recorded
numerical tolerance without calling an AI provider.
Example tasks:
- [ ] SR-T01 (SR-01): implement candidate validation and frozen hashes.
- [ ] SR-T02 (SR-01): implement bounded classical search and actual evaluation accounting.
- [ ] SR-T03 (SR-01): confirm candidate with B-rep verifier and save evidence.
- [ ] SR-T04 (SR-02): implement fresh-process replay and mismatch handling.
- [ ] SR-T05 (SR-01, SR-02): execute analytical, property and integration tests; attach observed commands/results.
Prepare draft specs with Claude Code/Codex when needed before Kiro access. Once available, use Kiro IDE to inspect and refine the actual drafts with native spec tooling. For reserved engineering features, approve the EARS requirements and design properties before Kiro CLI implements their tasks. For Kiro custom agents (optional), explicitly include steering resources using the installed version’s documented format; do not assume default steering inclusion for custom agents [H4]. Preserve original authorship in the development log. Do not create fictitious task completion metadata, backdated commits or fabricated Kiro transcripts.
12.5 Hooks and shared checks
Kiro's current standalone hook format uses JSON files in .kiro/hooks/; exact schema and events vary by IDE/CLI version [H5][H6]. Avoid writing speculative configuration and claiming it is valid. Use native Kiro hook creation or validate against the installed version. Implement the following hook behaviors with bounded shell scripts, then run them through actual Kiro:
| Hook | Trigger intent | Actual command/check |
|---|---|---|
| Engineering fast checks | Relevant Python changes or post-task | bash scripts/check-fast.sh (Ruff, typing, focused unit/schema tests) |
| Native geometry regression | Post-task for geometry/kinematics/replay work | bash scripts/check-geometry.sh (selected analytical and replay tests, strict timeout) |
| Release checks | Explicit developer action or release task | bash scripts/check-release.sh (clean install/build, license inventory, secret scan, end-to-end demo) |
Use Kiro IDE or CLI version supporting the selected triggers. The built-in spec Correctness/property-based-testing workflow is documented for the IDE [H2]; ordinary Hypothesis tests work independently of any Kiro surface. Do not require MCP, custom agents or Kiro powers for the core. Add them only if useful and actually exercised. No automatic dependency installation, network upload, paid API calls or publishing in hooks. Avoid recursive save loops; fail visibly on nonzero command exit. Check scripts are ordinary repo tools that Claude/Codex and CI can execute before Kiro is available; mark hook registration/trigger verification as pending until tested in Kiro.
12.6 Handoff checklist and daily execution cycle
When authorized Kiro access/credits become available:
- Record the current commit, assigned task IDs, actual test commands/results, CAD environment and blockers in
docs/progress.md. Preserve reviewed work; no destructive reset. Review data-sharing settings and keep private material outside this repo. - Open the same repository in Kiro IDE. Confirm the installed version recognizes the actual
.kirosteering/specs andAGENTS.md. Refine requirements and design for the next reserved feature. Use the native Correctness workflow to extract testable properties and review them for usefulness, before implementation where possible. - Switch to Kiro CLI for the approved implementation tasks. Run baseline checks, finish pending B0/H0/M0/M1 work, implement M2 then M3, M4, M5 and M6 in gate order. Pass each gate with evidence. The IDE can implement fixes too; CLI/IDE are not separate codebases.
- Return to the IDE at the end of each engineering feature: execute the linked property tests, examine failing inputs if any, and repair actual defects using a native bugfix spec or task where appropriate. Never weaken an invariant just to make a test pass; review an incorrect property against the requirement. Keep ordinary regression tests executable outside Kiro.
- Create/validate Kiro-native hooks in the actual installed IDE; trigger them on a real supported event. Confirm the underlying command ran and inspect the output. Log successful checks even when no defect is found. Do not manufacture an anecdote.
- Kiro CLI owns M4 by default. After actual Claude quota renewal, Claude may perform independent review or an explicitly reassigned disjoint support task only after the relevant API/evidence contracts are agreed. Use separate branches or Git worktrees for disjoint code ownership. Assign one writer to each active feature spec/task file; merge changes through review. No two agents edit the same files or check off the same task concurrently. Integrate with an actual end-to-end test, not a mocked successful result.
- At each handoff, provide the exact base commit, feature path, task IDs, changed files, commands and observed results, known failures, next task and ownership. Re-read the shared instructions; do not import a private transcript or tool-specific memory into the repo. Log actual tool contributions.
- Before release, verify
.kirois tracked and public-safe, test the tagged build, and assemble the Devpost explanation from recorded evidence. Explain distinct contributions from IDE, CLI and Claude/Codex truthfully.
Create docs/KIRO_USAGE.md as an evidence index, initially with empty/pending entries. For each real Kiro activity record date, installed version/surface, feature/task/requirement IDs, actual steering/spec/hook used, commit or diff, executed test/command, observed output or linked sanitized evidence, result, and any limitation. Distinguish planned, executed, passed, failed, and blocked. Use docs/development-log.md for the full chronological record including Claude/Codex work. No secrets or raw private transcripts. A useful write-up compares how the IDE's property extraction and CLI's implementation fit together, using an actual example rather than a prewritten success story.
If credits are delayed or rejected, use available authorized Kiro access and contact organizer support if necessary. If there is no meaningful Kiro contribution, do not claim the configuration or external-agent work as evidence of it. Contest eligibility is not guaranteed by this workflow.
12.7 First prompt for Claude Code or Codex (quota-limited bootstrap)
Copy the following as the first implementation request. The full spec is authoritative, but section 11 B0 is the only authorized initial scope.
Build only B0 of ToleranceArena Community Edition for Kiroween, EUPL-1.2
only. Read the B0-specific portions of docs/community-spec.md first:
Start here, sections 2.3, 4.1-4.4, the applicable dependencies in 9,
10.1-10.3, section 11 B0 and the applicable instructions in 12.
Read other sections only when needed to resolve a relevant contract.
Use the actual available allowance; an earlier percentage is not a current
quota reading. Keep the work small and implement/test directly.
Quota renewal and Kiro access are uncertain.
Use AGENTS.md as a short entry point to the canonical .kiro/steering and
.kiro/specs configuration. Create minimal steering and a clearance-verifier
requirements.md, design.md, tasks.md. Read them explicitly before editing.
Never create or use CLAUDE.md, CLAUDE.local.md, /init-generated memory,
or an alternative instruction system. Record the actual tool used.
Do not pretend to have run native Kiro tests or hooks.
Install Python 3.12 / uv / stable build123d with compatible OCP/OCCT.
Resolve only the libraries used by B0; retain the full approved stack for
later. Create actual equal-height cylinders: moving pin radius 2 mm on
40 mm orbit, stationary obstacle radius 2 mm at 46 mm polar radius and
45 degrees, height 8 mm, +Z pivot, q in [0,90] degrees, obstacle radial
offset in [-1.2,+1.2] mm. Required gap 1.5 mm. Check pin/obstacle only.
Use real native distance and an independent analytical oracle; nominal
q=45, offset=0 is 2.0 mm; adverse q=45, offset=-1.2 is 0.8 mm.
Validate these and additional valid poses, common rigid transform and
invalid/failing queries. A failed native calculation cannot be a pass.
Create one minimal CLI and finite sampled sweep. State checked scope;
no-finding does not prove safety. Do not hardcode native measurements.
Save real dependency versions, test commands/results, and a working
checkpoint with a short handoff listing open full milestone tasks.
Do not mark H0/M0/M1/M2 complete just because B0 succeeds. Stop after
B0 or earlier if blocked or quota is running low. No general import,
frontend, API, database, runtime AI, adversarial optimizer, full replay,
redesign, Docker, or commercial features now. No publication or paid
provider calls without approval.
Once Kiro access arrives, Kiro IDE refines native specs and correctness;
Kiro CLI completes remaining M0/M1 and implements M2-M6 in order.
Reserve these tasks, including the viewer, for genuine Kiro work.
At handoff, include exact commands for reproducing B0 and any failed command output. Do not spend the last available quota drafting another full specification.
12.8 First prompts for Kiro IDE and Kiro CLI
Kiro IDE, initial handoff and feature correctness:
Open the existing ToleranceArena Community repository. Read AGENTS.md,
.kiro/steering, docs/community-spec.md, docs/progress.md and the active
feature spec. Review the actual commit and earlier test results. Confirm
native spec and steering recognition. Use Kiro's native spec workflow to
refine EARS requirements, design and task links for the next reserved
feature. Extract correctness properties, including rigid-transform
invariance, valid uncertainty bounds, requirement immutability,
replay agreement and failure-state semantics as applicable. Review the
properties against the engineering contract. Do not change a requirement
or tolerance to make a failing test pass. Configure and validate the
native regression hooks for this installed version. After implementation,
run the linked property-based tests; investigate real failures and
repair them, then rerun the checks. Record actual task/test/hook evidence
in docs/KIRO_USAGE.md, including a failure if one really occurred.
Kiro CLI, substantive implementation:
Continue from the reviewed current commit and active Kiro feature spec.
Read AGENTS.md, .kiro/steering, the active requirements/design/tasks,
docs/progress.md and previous test evidence. Identify the next incomplete
Kiro-owned task. Complete outstanding B0/H0/M0/M1 tasks, then implement
M2 motion/uncertainty and M3 bounded search, evidence and deterministic
replay. Implement the minimal M4 API/worker/viewer, then M5 bounded AI
failure analysis with the restricted core Strands SDK, Groq provider, and deterministic verifier.
After M5 passes, implement M6: one permitted radius proposal, reviewed
regeneration, fixed-policy paired retest, synchronized comparison and
offline replay. M7 handles the public release. Do not recreate the agent
loop or enable generic tools/delegation.
Use real CAD queries, actual constraints and shared regression scripts.
Run relevant ordinary property tests and preserve their evidence. Do not
claim the CLI executed the IDE-only native Correctness workflow. Pass
each engineering gate, update the active task/progress and record actual
Kiro contribution. Report blockers and hand back to the IDE for native
correctness review. Preserve EUPL-1.2 and public-only scope.
Claude Code, optional independent review or explicitly reassigned support after quota renewal:
Load the same canonical .kiro configuration and current approved feature
spec. Kiro owns implementation by default. Work only on an explicitly
assigned independent review or disjoint support task after quota renewal. Do not edit the Kiro-owned verification/search/AI tasks
without explicit reassignment. Use stable typed API and evidence contracts;
if a contract is missing, report the blocker. Run shared checks and log
actual Claude Code work, including any review findings. Do not create
CLAUDE.md or use alternate project instructions. Keep independent
review findings separate from claims of implemented fixes.
13. Testing and benchmark requirements
13.1 Test strategy
Test behavior and engineering invariants, not implementation details or repeated wrappers around the same function. Prefer a few meaningful fixtures to a large suite that merely mirrors the code.
| Test class | Required examples |
|---|---|
| Analytical static geometry | Known box/sphere/simple clearance; overlap; containment; boundary cases |
| Units and transforms | mm/inch import normalization; mm-to-render scale; rigid-motion invariance; nested occurrence composition |
| Input validity | Missing units/bindings; malformed YAML; invalid axis; reversed bounds; NaN/infinity; stale references |
| Kinematics | Known single-joint positions; joint limits; impossible configuration rejection; later closure residuals |
| Native error handling | Invalid/open solids; query not done; exception; crash; timeout; memory limit |
| Search | Seeded cases; budget enforcement; invalid-candidate accounting; no-finding semantics |
| Replay and reduction | Fresh-process replay; parameter provenance; reduction retains failure; no requirement mutation |
| Repair/A1 | Allowed continuous edit; policy hash unchanged; original retained; source-case vs validation distinction; fixed paired cases; 188-attempt plan within 200 credits; threshold/guard ambiguity; infeasible/no-finding status; comparison replay |
| Persistence | Interrupted write; restart recovery; cancellation; migration; backup/restore |
| Strands gateway | Direct SDK construction and emitted tool manifest; no automatic tools/context/persistence/telemetry; strict schemas; role separation; cross-revision IDs; shared debit accounting; idempotency; real request counting; zero configured client/transport retries with every outbound attempt charged; Groq endpoint/model allowlist, actual tool/schema round trip and rate-limit handling; cancellation and hard process stop |
| UI/API | Evidence parity; unit labels; occurrence selection; honest result labels; scoped artifact access; synchronized original/candidate view; unmeasured previews labeled; SSE/poll reconnect cannot repeat work |
| Packaging | Minimal install; optional-group isolation; clean environment; no private dependency in core |
Use Hypothesis for bounded invariants, such as symmetry of supported distance queries, rigid-transform consistency, and serialization round trips. Limit geometry complexity and execution budgets so property tests do not create unbounded native workloads.
13.2 Independent checks
Analytical formulas for simple fixtures provide useful checks independent of the CAD implementation. CadQuery or CADCLAW comparisons can reveal application-layer mistakes, but agreement between systems using OCCT is not independent confirmation of the kernel itself.
If a later capability requires stronger physical confidence, use another numerical method, convergence studies, measurement, or an independently implemented reference appropriate to the claim.
13.3 Benchmark set
Maintain versioned, owned or permissioned cases with explicit expected behavior. Start with:
- Static well-separated parts.
- Positive distance below a required clearance.
- Touching near the decision threshold.
- Partial volumetric overlap.
- Complete containment.
- Repeated instances and nested transforms.
- Non-default imported units.
- A rotating-pin failure missed by the 0/30/60/90-degree sweep, confirmed at 45 degrees with the allowed adverse offset.
- A failure requiring a combination of bounded deviations.
- Invalid geometry or unsupported input with an indeterminate result.
- A controlled repair with an independent regression check.
- A case without a feasible repair in the allowed design space.
Tie the required case list to advertised capabilities. Repeated/imported assembly and non-default import-unit fixtures are mandatory before shipping those capabilities. The combination-of-deviations case is a later gate before advertising multiple uncertain bindings; it is not required to expand the one-offset contest template. Search and frozen evaluation cases stay distinct. New seeds alone do not establish generalization to new mechanisms.
13.4 Metrics
Record:
- Correct verdicts on labeled fixtures and the reasons for indeterminate results.
- False findings and missed known failures.
- Time to first confirmed counterexample.
- Native evaluations, failed evaluations, and budget consumed.
- Wall time, peak resident memory, CPU/thread configuration, and artifact size.
- Import/setup time and manual mapping effort.
- Counterexample complexity before and after reduction.
- Repair trade-offs and held-out performance.
- LLM usage/cost when available, plus human review effort.
Do not set unsupported production throughput targets. Establish an initial baseline on the actual hardware, then set meaningful regression budgets. Use enough repeated stochastic runs to characterize variability; choose the number based on the experiment rather than a cosmetic fixed score.
13.5 CI progression
Initial CI should run linting, typing, fast analytical/schema tests, and selected native integration fixtures on the supported Linux/Python combination. Add slower search benchmarks as a separate scheduled or explicitly invoked job.
When the server/frontend exists, add build and API/UI contract checks. When shipping artifacts, add clean-install, license/SBOM, secret, and vulnerability checks. Recheck native compatibility on dependency upgrades.
Do not run expensive full campaigns on every documentation edit. Broaden testing when it addresses a concrete remaining risk or a release gate.
14. Risks, scope cut decisions and definition of done
| Risk | Required mitigation / cut decision |
|---|---|
| Native wheel incompatibility | M0 smoke tests before UI; use separate tested fallback environment |
| Incorrect geometry relation or units | Independent analytic fixtures; unknown instead of false verdict; do not ship unverifiable feature |
| Arbitrary STEP lacks joints/tolerances | Trusted fixture first, explicit sidecar; unsupported imports clearly rejected |
| Slow or unstable search | Measure, lower budget/complexity, bounded supervised jobs; no claims of exhaustive coverage |
| LLM hallucination or missing API | Typed bounded Strands tools and deterministic checks; show provider failure; keep offline baseline |
| SDK/provider drift or limits | Explicit tool manifest and Groq endpoint, candidate pins, non-streaming tool/schema contract tests, actual rate limits, full transitive inventory and installed-signature gate |
| Repair appears successful by changing the problem | Fixed policy hash, allowed binding only, fresh paired evaluations and original revision preservation |
| Kiro credits delayed / Claude quota exhausted | Preserve B0 checkpoint; use genuine authorized Kiro access when available; reserve remaining M0/M1 and M2-M6 for substantive Kiro work; narrow scope or continue independently if needed; verify eligibility |
| License or asset provenance uncertain | Resolve exact versions and rights before publication; remove/replace only affected dependency/asset |
| Hosting unsafe or judge access unclear | Restricted demo or organizer-confirmed local release path; no arbitrary public local API |
| Insufficient time | Drop arbitrary import UI, extra mechanisms/optimizers, persistence polish and delegation first; preserve the requested bounded repair comparison after core gates. An unfinished required feature needs an explicit scope decision. |
Release is done only when a fresh checkout can execute the documented demo on supported hardware, the evidence/replay result matches the kernel and expected reference within declared tolerances, all required tests pass, the actual dependency/asset obligations are reviewed, the source is public-safe and self-contained, Kiro contribution is genuine and documented, and the submission requirements are met. The baseline must work offline after installation; AI calls require explicit configured access. No fabrication of test results or claims of industrial certification.
14.1 Demonstration script: target 2:50–2:55
Demonstrate one complete case. Use a dark CAD workbench with a restrained ghost overlay for the original/failing pose; keep units, evidence and the fixed requirement readable. The Halloween styling supports the motion explanation. Do not add a game, simulated industrial dashboard or second engineering problem for presentation value.
| Video time | Show | Evidence to keep visible |
|---|---|---|
| 0:00–0:15 | “AI-assisted clearance discovery and verified repair” and the intended engineering user | Public Community edition, one checked pin/obstacle pair |
| 0:15–0:35 | Nominal model, 0–90° motion, ±1.2 mm placement offset, 1.5 mm requirement | Actual nominal measurement; a coarse sweep labeled sampled |
| 0:35–1:00 | Strands failure analyst proposes/evaluates a bounded scenario | Real tool event and native result; illustrative expected finding is 0.8 mm at 45°, −1.2 mm |
| 1:00–1:20 | Ask for a repair; review the permitted nominal-radius diff | Original 46.0 mm; actual proposed value; unchanged motion, uncertainty and requirement |
| 1:20–1:50 | Screen the proposal, select it, and run the fixed paired comparison | For a 46.8 mm candidate, the expected adverse result is 1.6 mm; show real result IDs, completion counts and synchronized views |
| 1:50–2:12 | Download and replay the comparison with model access disabled | Actual original/candidate results reproduced; no provider call |
| 2:12–2:45 | Show actual Kiro requirements, implementation task and useful property/hook execution | Commit/test evidence and a truthful account of Claude/Codex bootstrap contributions |
| 2:45–2:55 | Public repository, working demo URL, EUPL-1.2 and supported scope | “No failure found in the completed finite validation set”; no global safety claim |
The timing is a video plan, not a latency claim. Record actual executions; visibly label edited time compression and saved-trace replay. A recorded provider run can support a demonstration only after the live integration has passed its own test. A synthetic text animation cannot replace a real tool invocation. Prepare a repeatable saved run for reviewer inspection if the provider is temporarily unavailable, while keeping live/recorded modes distinct.
Use the same pose and uncertainty value on both sides of the comparison. Show the numeric edit in a separate card so viewers can see that the requirement stayed fixed. Keep the source-case result distinct from the full paired-validation status. If the selected proposal differs from 46.8 mm, show its measured result; do not edit the narrative to imply the illustrative numbers were observed.
The coarse sweep is a sampling lesson. A midpoint/boundary classical strategy finds the same fixture failure; do not use the demo to claim that only AI could find it. The AI contribution is bounded hypothesis/proposal generation and evidence-based explanation, with deterministic verification and replay.
Suggested description, to use only after the advertised workflow is implemented:
ToleranceArena Community is an open-source, AI-assisted mechanical clearance tool. Strands agents propose bounded failure scenarios and a permitted numeric design change. A deterministic CAD verifier measures each evaluated case, preserves the original requirements, and exports failures and before/after comparisons for offline replay. The first release supports a synthetic rotating-pin mechanism and one editable placement parameter. First-party code is licensed under EUPL v1.2 only.
14.2 Submission definition of done
The requested release is complete only when B0's real measurements lead to a working M3 engine, the M4 viewer shows its evidence, M5 uses the direct Strands SDK with a tested Groq provider, M6 performs the reviewed paired comparison, and M7 passes clean installation, licensing, source and judging-access checks. Each completed task links to actual commands/results or observed UI behavior. The spec, a generated screen or a provider's narrative is not proof of completion.
Keep a concise capability matrix in the README: supported geometry, allowed edit, evaluated scope, live AI configuration, recorded replay, verified OS/runtime and deferred features. Keep any unresolved native compatibility, model access or license issue marked unresolved. A failed optional component may be omitted; a failed advertised component must be fixed or removed through an explicit scope decision.
15. Sources and implementation evidence
This revision uses the complete Community v1.3 source and updates the AI runtime and provider decisions. I rechecked the current Strands core manifest, Agent constructor, OpenAI adapter source, structured-output guidance, and Groq endpoint, tool, reasoning, model and rate-limit documentation on 28 November 2026. The v1.3 CAD, contest, license, Kiro and engineering references remain carried forward, not freshly reverified in v1.4. The source specification for this rewrite has SHA-256 2923ed738e77e57eb783d595f23b93adaf632b905376ae0d9972884cc20e1e9a.
Checks still pending: installing the combined Python environment; examining the actual wheel/native payloads; resolving and auditing every transitive dependency and asset; executing native CAD and provider calls; measuring laptop performance; testing the app; validating a real Kiro installation; and verifying a public release/deployment. This document does not mark those checks passed. Optional/deferred dependencies remain a planning inventory; audit the chosen release when activating one.
Rolling documentation can differ from a pinned package. Keep exact versioned package links, installed signatures and observed behavior in the corresponding ADR. The URLs below are implementation references, not substitutes for tests. The previous artifact provenance is carried forward as a candidate; v1.4 has not downloaded or installed that wheel.
15.1 Strands SDK and Groq sources
| ID | Primary source | Scope |
|---|---|---|
| A01 | Selected repository | Shared repository; use core Python SDK rather than assembled harness |
| A02 | Core SDK documentation | SDK versus assembled harness; direct agents |
| A03 | strands-agents 1.68.0 | Candidate release provenance carried forward from v1.3; verify wheel metadata |
| A04 | Agent constructor source | Direct Agent initialization, explicit tools/context/session/plugins and default host execution |
| A05 | OpenAI model adapter source | Client injection, params, Chat Completions, non-streaming and request conversion; rolling main |
| A06 | Lifecycle controls | Invocation limits and cooperative cancellation (carried forward) |
| A07 | Tool executors | Sequential scheduling, not a permission sandbox (carried forward) |
| A08 | Structured output | Normal invocation schema with domain tools, result.structured_output |
| A09 | Retry strategies | Retry attempt count (carried forward) |
| A10 | Stream events | Sanitization into controller events (carried forward) |
| A11 | Browser streaming | Optional SSE observation (carried forward) |
| A13 | SDK source manifest | Core and OpenAI-extra dependencies; current main not a lockfile |
| A14 | Apache license | Upstream license text (carried forward) |
| A15 | NOTICE | Upstream attribution; inspect actual wheel (carried forward) |
| A16 | Groq OpenAI compatibility | Client configuration, compatible endpoint and limitations |
| A17 | Groq tool use | Local function calling and GPT-OSS parallel tool limitation |
| A18 | Groq reasoning, API reference | GPT-OSS effort, completion and reasoning-output settings |
| A19 | Groq structured outputs | Native JSON Schema mode incompatibility with tool use/streaming |
| A20 | OpenAI Python SDK | Async client, base URL, HTTP client, retries and extra_body; inspect actual release |
| A21 | HTTPX event hooks, async client | Async pre-send hooks, client lifetime and mock transport |
| A22 | GPT-OSS 120B | Model ID, advertised price and speed |
| A23 | GPT-OSS 20B | Alternative model ID, advertised price and speed |
| A24 | Groq rate limits | Published summaries, 429 and account-specific limits |
| A25 | Groq data controls | Review applicable retention/data settings before enabling live/hosted service |
Carry-forward candidate wheel checksum from v1.3 (not downloaded or independently reverified in this revision): strands_agents-1.68.0-py3-none-any.whl, SHA-256 1c755ab2ed2fcb0aa3b3624b9c20be3883e414ad952b4bcab8ecb3fd8dcd4be6. Earlier provenance identified commit 7e5722136c5ecb80fd706a0d554a1cd0839f497a; this revision could inspect rolling source, not retrieve that exact commit manifest. Verify the actual candidate artifact, metadata, license files and required API before lock adoption. The OpenAI extra changes the dependency resolution, not the core wheel's identity; record every transitive artifact hash. No assembled harness wheel is selected.
15.2 Contest, license and developer-tool references
| ID | Reference | Scope |
|---|---|---|
| H1 | Kiroween official rules | Eligibility, timing, credits, project requirements, source repository and judging obligations |
| H2 | Kiro specs | Feature spec structure and surface-specific capabilities |
| H3 | OSI EUPL-1.2 | Approved license and official license terms |
| H4 | Kiro steering | Workspace steering and AGENTS.md support |
| H5 | Kiro hooks | Native hook file location and version-specific workflow |
| H6 | Kiro hook triggers | Event and surface differences |
| H7 | Claude Code CLI reference | --safe-mode and --append-system-prompt-file; explicit shared entry-point loading without CLAUDE.md; verify installed version |
| H8 | Codex prompting guide | AGENTS.md discovery and project instruction behavior |
| H9 | Kiroween homepage | Category context and submission overview |
| H10 | Kiro privacy and data protection | Account data controls; verify current settings |
| H11 | Kiro documentation and surfaces | Shared harness, .kiro configuration, terminal and IDE roles |
| H12 | Kiro Correctness | IDE-only native spec-to-property-based-testing workflow, limitations and execution |
| H13 | European Commission EUPL FAQ | Inbound license compatibility and EUPL interpretation guidance |
| H14 | EUPL compatibility matrix | Compatibility direction and conditions |
| H15 | Kiroween resources | Credit-request process and supporting contest information |
15.3 CAD, numerical and application references
| ID | Primary source | What it supports |
|---|---|---|
| S02 | build123d 0.13.0 | Project description, upstream license metadata, Python compatibility and releases |
| S03 | cadquery-ocp-novtk 8.0.1.1.0 | Published no-VTK OCP distribution and platform/Python metadata |
| S04 | build123d development manifest | Example of a changing direct dependency manifest; not a release lockfile |
| S05 | CADCLAW repository | Documented verification/assembly scope and code license |
| S06 | CADCLAW manifest | Its current direct runtime dependency branch |
| S07 | OCCT STEPCAFControl_Reader | Assembly/XDE import and metadata modes, not universal metadata preservation |
| S08 | OCCT distance API | Minimum-distance, completion, witnesses, and inclusion semantics |
| S09 | SciPy differential evolution | Stochastic optimization parameters, budgets, random state, workers, constraints |
| S10 | SQLite WAL | Reader/writer behavior and same-host/network-filesystem limitations |
| S11 | SQLAlchemy SQLite documentation | Driver, transaction, and concurrency considerations |
| S12 | Python concurrent.futures and multiprocessing | Process execution, serialization, timeout and cancellation considerations; use target-version docs |
| S13 | FastAPI background tasks | Scope of in-process background tasks and heavy-work caveat |
| S14 | OCP repository | Binding scope and its separately stated license |
| S15 | OCCT official overview | Kernel capabilities and LGPL licensing statement |
| S16 | OCCT exception and LGPL text | Actual upstream license/exception texts; freeze matching release files |
| S17 | CadQuery package | Fallback project, release metadata, and upstream license |
| S18 | uv dependencies | Optional dependencies and development groups |
| S19 | uv locking and syncing | Lockfile behavior and locked installs |
| S20 | uv resolution | Resolution of complete dependency constraints and conflicts |
| S21 | Developer Certificate of Origin | Contribution-rights declaration; not copyright assignment |
| S22 | build123d import/export | Supported APIs, STEP import, glTF/GLB options, units, and mesh settings |
| S23 | Khronos glTF 2.0 specification | Coordinate system, units, transforms, and binary asset format |
| S24 | OCCT point classifier and Boolean common | Point versus whole-solid semantics; intersection API reference |
15.4 Additional upstream lookup points for activated dependencies
These are starting points for checking the selected versions. Their inclusion is not an approval of every package or bundled component.
- Numerical stack: NumPy, SciPy, SymPy, Optuna, NetworkX, Numba, NLopt, CasADi.
- Application stack: Pydantic, FastAPI, Uvicorn, HTTPX, SQLAlchemy, Alembic, PyYAML, Typer, Rich.
- Collision/meshing: python-fcl, FCL, Manifold, scikit-fem, Pynite.
- Frontend: React, Three.js, React Three Fiber, Drei, Plotly.js, Vite.
- License references: Mozilla MPL FAQ, GNU LGPL 2.1, GNU LGPL 3.0.
- Compliance tooling: Syft, ScanCode Toolkit, OSS Review Toolkit, pip-licenses, pip-audit.