Skip to content

Source Spec 003

Reese Hodge edited this page Nov 16, 2026 · 11 revisions

Source Spec 003

Spec 003 is the architecture review and first AWS deployment of Max Height. This page distills its plan, written 2026-10-11. Nothing here is deployed behavior. Every decision below is a plan claim until the code ships and the quickstart scenarios pass. Where this page and the code disagree, the code describes today and this page describes intent.

Provenance

The spec lives on branch 003-architecture-review, which had not merged when this page was written. Sources are therefore pinned to b3b2c23, the commit that added the plan. Once the branch merges, the live specs/003-architecture-review/ paths take over.

  • spec.md: the questions Q0–Q9, requirements, the wiki-claim register W1–W38 and the wiki discrepancies D1–D12.
  • plan.md: technical context, constitution check and project structure.
  • research.md: the decision register, cost inputs, spikes, verification record, issue dispositions, proposed spec patches and constitution amendments.
  • data-model.md and contracts/ (eight files): the control table, SSE transport, runtime configuration, auth and allowlist, Memory API, spend control, CSP and hosting, the S0 probe matrix and the S1 golden set.
  • quickstart.md: deploy order and validation scenarios V-01 to V-17.

The decisions, in one table

Question Planned decision
Q0 Inference path In-Region model IDs only, in us-west-2. The AWS Free plan documents no cross-Region inference, so the code's global. Haiku 4.5 profile cannot ship. Spike S0 (2026-10-29) found the profile does work in this account today; the builder chose not to rely on it
Q1 Voice Polly Neural, synthesized server-side in the runtime and streamed with the reply. Speech marks are dropped. The Identity Pool and all browser AWS credentials go
Q2 Text model Cheapest candidate that is in-Region, supports Guardrails on its path, and passes the golden set. After S0, Nova Lite v1 is the only eligible candidate: Claude Haiku 4.5 (mantle) and 5.5 are "not available for this account"
Q3 Personality Deferred with #42; the system prompt alone ships
Q4 Transport fetch POST through a CloudFront /runtimes/* behavior to AgentCore Runtime, which validates a Cognito JWT and streams SSE. The API Gateway WebSocket path is deleted
Q5 Identity and caps Identity is the verified token sub; client sessionId and actorId are ignored (#55). Counted sessions and rate limits live in a DynamoDB control table
Q6 Spend control A gross-of-credits budget, a hard stop that throws when its target is missing (#61), and an in-path breaker that tallies estimated spend per month
Q7 Cost model Gross of credits; Polly's 12-month free tier not counted; caching counted only if spike S2 shows it is reachable
Q8 Platform CDK only. Runtime V2 and AgentCore Memory ship in the first deployment, with a daily pruner for the 30-day window. Strands 1.20.0, one Agent per counted session
Q9 Access Cognito user pool with Google sign-in only, an email allowlist checked at sign-up and token generation, and silent refresh

Logs keep 14 days everywhere, model-invocation logging stays off, and operations alarms go to their own topic in a new ops stack.

Changes since the plan

2026-11-15 readiness review. Source-Agent-Infra-Deployment-Review records seven safety/integration findings on 98fadf7, the approved safety profile and foundation fixes at ee4e458. On this branch, A1/A5/A6 apply, but the new P2 amendment and code integration remain unfinished. Reconcile the artifacts non-destructively: the foundation tests prove conditional session writes and request usage, not complete distributed admission, cancelled/error settlement or exported tracing.

The plan above dates from 2026-10-11 and its rows for Q0 and Q2 are out of date. Clarifications since then, from the spec's session entries:

  • 2026-11-02, first deployment model. T144 adopted Claude Haiku 4.5 on the global. profile for the first deployment, with no S1 run before deploy. S1 and the cheaper-candidate comparison move to a post-upgrade model review. See Decision-LLM-Model-Selection and Decision-AWS-Account-Plan.
  • 2026-11-02, ceiling raised to $20 (planned). The hard cap, alarms ($10/$16), soft-degrade ($16 − F), breaker ($20 − F) and gate-1 threshold ($16) scale to $20, only once constitution amendment A5 merges (T153). $20 is provisional until the SC-019 month is measured (T156). Tasks T153 to T157 track the work. See Concept-Budget-Ceiling.
  • 2026-11-02, account. Staying on the classic account in us-west-2; AWS's new account experience is not adopted (Source-AWS-New-Account-Experience).

What the plan still waits on

  • Spikes S1 (golden set), S2 (real prompt tokens) and S4 (whether runtime state survives Runtime V2's 120-second idle reclaim). Each needs a cost estimate and the builder's approval before it runs. S0 ran on 2026-10-29; its results are on Decision-LLM-Model-Selection. Polly (S0-7) works on this plan, so Q1's voice path stands.
  • Prices a human must read, because the model, Polly and several infrastructure pricing tables render client-side.
  • Builder confirmations: how the Google client secret reaches Cognito, the CDK bootstrap's default AdministratorAccess execution role, and the Cognito domain prefix.
  • Constitution amendments A1 (CDK-only IaC), A2 (only if a non-Haiku model is adopted), A3 (only once D10 is verified) and A4 (gate 2's "50 cases" becomes 65), and spec patches P-01 to P-13.

S1 gained its own contract, contracts/s1-golden-set.md (commit 4999045). It is an absolute pass bar over all 65 cases, scored by an offline judge script plus builder spot-checks, with no Haiku 4.5 baseline. Source-AgentCore-Evaluations records the managed alternative. That would be a new AWS service and is not adopted.

Q4's fallback has a better candidate. If probe V-02 fails, the plan builds a Lambda streaming proxy. Source-Lambda-Web-Functions (2026-10-22) describes a Lambda form factor that runs a plain Hono or Express SSE server behind CloudFront OAC, with Authorization passthrough documented. It is recorded as a suggestion, not a plan change: it needs a clarification before it replaces anything.

Q8's Memory strategies conflict with Q0. AWS documents that AgentCore Memory's built-in strategies run inference cross-Region. From us-west-2, that means us-east-1 or us-east-2. The plan uses all three built-ins, but Q0 allows in-Region inference only. Source-AgentCore-Long-Term-Memory (2026-10-30) sets out three ways out: overrides with Nova Lite v1, a self-managed strategy, or accepting cross-Region inference. On 2026-10-30, the builder clarified that the stance against cross-Region inference is budget-driven, not absolute. AWS says Memory's cross-Region inference costs nothing extra, so the remaining objection is Free-plan enforcement risk. It is recorded, not resolved, because choosing one needs a clarification.

Q0's premise was temporary, and the spec is now clarified. On 2026-10-30 the builder ruled that nothing is rejected because of the Free plan, which expires in December 2026 (Decision-AWS-Account-Plan). The same day, /speckit.clarify changed spec.md (commit afd0070). FR-028 now allows any inference path S0 proves the account can invoke, including cross-Region. Probes S0-8 (Nova 2 Lite) and S0-9 (Haiku 5.5) were added through their us. profiles. SC-019's month of operation may straddle the Paid upgrade. research.md's Q0 and Q2 and the S0 contract below still describe the in-Region-only plan, and need updating to match. The Memory strategy choice (Q8) is still open; long-term memory is deferred anyway (FR-014).

Corrections it made to this wiki

The plan verified or refuted the D-series claims against AWS documentation. The results now live on their owning pages:

# Verdict Owning page
D1 Verified against AWS documentation: the Free plan supports no cross-Region inference. Contradicted in practice by spike S0 (2026-10-29); recorded, not relied on Decision-LLM-Model-Selection, Component-Agent-Runtime
D2 Refuted in part: Nova 2 Lite is cross-Region only, so it is no Free-plan fallback (confirmed by S0-5) Source-Amazon-Nova-Lite
D5 Conflict stands; the projection assumes no Polly free tier Source-Amazon-Polly
D6 Verified: Budgets include credits unless told not to Concept-Budget-Ceiling
D7 Verified: Budgets data refreshes up to three times a day Concept-Budget-Ceiling
D10, D11 Unverified; not stated on the wiki —

New gaps from the same research went to Source-AgentCore-Pricing (Memory pricing changed on 2026-10-06), Concept-Observability (CDK's own Lambdas create never-expiring log groups), Component-Infra-Stacks (CloudFront and CDK traps) and Source-AgentCore-Web-Search-Tool (Google Custom Search is closing).

Findings proposed as issues

These are findings about today's code. None has been filed; each becomes an issue only with the builder's permission.

ID Finding Owning page
N1 extractUsage reads result.usage, which does not exist, so every count falls back to a character estimate Component-Agent-Runtime
N2 A fresh Agent is built per request, so there is no in-session history Component-Agent-Runtime
N3 handleDeleteMemory takes a record ID with no ownership check Component-Agent-Runtime
N4 The Google Custom Search JSON API is discontinued on 2027-01-01. Resolved 2026-11-16: the tool now calls AgentCore InvokeWebSearch (Decision-Web-Search-Provider); #87 is superseded Source-AgentCore-Web-Search-Tool
N5 AgentCore Memory long-term records have no TTL, so the 30-day window needs a pruner Component-Agent-Runtime
N6 CloudFront errorResponses are distribution-wide and would rewrite the runtime's 403 into an HTML 200 Component-Infra-Stacks
N7 Budgets sends an ACTUAL alert once per budget per period, so a mid-month recovery leaves no hard stop Concept-Budget-Ceiling

Deploy shape

Two Regions are bootstrapped: us-west-2 for everything spend-bearing and us-east-1 for the CloudFront certificate. The budget stack deploys first, so its topic is the first resource to carry the project cost-allocation tag. The spend-bearing stacks wait until the tag is active, which takes up to 48 hours. The deploy identity is a temporary console session that can only assume the CDK bootstrap roles. GitHub OIDC was rejected for now. The full order is in quickstart.md; Guide-Deployment remains the target-state runbook until spec 003 ships.

See also: Source-Spec-001, Source-Constitution, Gotchas, Index.

Clone this wiki locally