Repository navigation
Source Constitution
This page distills .specify/memory/constitution.md, the supreme governing
document for Max Height. It is a reading shortcut for agents, not a replacement
for the source.
Version: 1.5.0. Ratified: 2026-04-19. Last amended: 2026-10-11.
The constitution is authoritative over design decisions, code review, feature proposals, specs, plans, tasks, and wiki interpretation. When it conflicts with another artifact, the constitution wins.
The constitution has eleven core principles:
- P1. Cloud-Only, No On-Device AI: all LLM inference and TTS run server-side on AWS. No on-device model weights, WebGPU inference, or browser-side LLMs are permitted. See Concept-Cloud-Only-Inference.
- P2. Budget Ceiling — $10/Month Hard Cap: AWS Budgets alarms fire at $5 and $8, a hard stop blocks all spend-bearing paths at $10, per-session token caps are enforced, and every feature needs a cost model. See Concept-Budget-Ceiling.
- P3. Personality-First Build Order: the Phase 1.5 personality gate is a hard gate. No 3D work, visual polish, or stretch features ship until the golden-set rubric passes. See Concept-Personality-Gate.
- P4. IP & Legal Posture: use the name Max Height, preserve fan-project framing, avoid forbidden voice and likeness cloning, and remain non-commercial. See Concept-IP-And-Legal-Posture.
- P5. No Real-Time LLM-as-Judge: personality evaluation uses offline golden sets and rubrics. A live LLM must not grade live responses in the hot path. See Concept-Personality-Gate.
- P6. Supply-Chain Discipline: exact SDK pinning, committed lockfile, clean audit for dependency changes, and dependency review before adding packages. See Concept-Supply-Chain-Discipline.
- P7. Friends-and-Family Audience Only: the app is not a public product. Require invite-only federated sign-in and a provider-verified email allowlist before spend-bearing actions. Bind caps and rate limits to a server-verified identity; no signed-out spend-bearing access, public registration or self-service invitations. Moderation stays minimal, and there are no marketing pages or non-operational analytics. Sign-in requires privacy disclosure, retention and deletion. See Concept-IP-And-Legal-Posture.
- P8. Graceful Degradation Required: no WebGL falls back to 2D avatar, no microphone falls back to text input, and cloud outage becomes an in-character error state rather than a white screen or silent failure. See Concept-Graceful-Degradation.
- P9. Observability Before Features: AgentCore Observability is wired before the second feature, every user-visible latency target has a trace span, and personality regressions are diagnosable from traces and logs. See Concept-Observability.
- P10. Unit Tests Where Possible: non-trivial logic has tests, behavior changes include coverage, and trivial-glue exemptions are narrow. See Concept-Testing-And-TDD.
- P11. Credential & Secret Hygiene: local AWS access uses temporary, least-privilege credentials supplied through environment variables. Spend-bearing runtime access requires a verified, allowlisted sign-in identity; any browser AWS credentials are temporary and scoped to its permissions, while server callers use least-privilege IAM roles. Guest credentials cannot grant spend-bearing access. See Concept-Credential-Hygiene.
These are governance requirements, not a claim that sign-in has shipped. The CDK code still defines a guest identity pool; Component-Infra-Stacks describes what exists until the architecture review replaces it.
The constitution makes these stack choices load-bearing:
- Frontend: React + Vite SPA, React Three Fiber, Zustand, Web Audio API.
- Agent backend: Strands Agents SDK on Amazon Bedrock AgentCore Runtime.
- LLM: Amazon Bedrock, Anthropic Haiku-class.
- TTS: Amazon Polly Neural by direct SDK streaming.
- STT: Web Speech API.
- Auth: Amazon Cognito User Pool for invite-only federated sign-in; an Identity Pool only if authenticated browser AWS credentials are needed.
- Memory: AgentCore Memory with a 30-day rolling window.
- Observability: AgentCore Observability traces, metrics, and logs.
- Hosting: S3 and CloudFront.
- IaC: AWS CDK plus AgentCore CLI for agent deployment.
Changing this table requires a constitution amendment, with at least a MINOR version bump. Model version changes inside the same LLM tier can live in the feature plan without amending the constitution.
Unresolved conflicts for the next spec (checked 2026-09-30): the wiki's Decision-AgentCore-Runtime-V2 chooses CDK for runtime deployment, while this table still mandates AgentCore CLI for agent deployment. The proposed Decision-Browser-TTS-Fallback uses browser speech, while P1 above mandates all TTS on AWS. Neither a wiki page nor a completed feature spec can grant an exception or amend the constitution. Record these as constitution-check inputs, not silently adopted technology changes.
The constitution defines seven gates:
- Cost model gate: every feature has a cost estimate before implementation; anything above projected $8/month needs mitigation.
- Personality gate: a 50-case golden-set rubric passes before visual or audio polish ships. The count is stale: the golden set has 65 cases (see Concept-Personality-Gate), and spec 003's amendment A4 corrects it.
- Dependency gate: new dependencies pass P6 review before merging.
- Degradation gate: each P8 fallback axis is tested before its feature ships.
- Observability gate: trace spans exist for every user-visible latency path before shipping.
- Test coverage gate: non-trivial behavior changes include unit tests; trivial exemptions are justified in the PR description.
- Credential gate: local AWS access uses temporary credentials through environment variables, with least-privilege and region-scoped IAM where supported. Runtime access is tied to verified, allowlisted sign-in; no unauthenticated spend-bearing guest access.
The constitution is the supreme governing document. All pull requests must verify compliance with applicable principles before merging. Complexity that violates a principle must be justified in the implementation plan's Complexity Tracking section.
Amendments follow this procedure:
- Propose the change in a pull request modifying the constitution.
- Document the rationale in the PR description.
- If a principle is removed or materially redefined, review dependent specs, plans, and tasks for impact.
Versioning follows semantic versioning:
- MAJOR: principle removal or backward-incompatible governance redefinition.
- MINOR: new principle, material expansion of an existing principle, or technology stack change.
- PATCH: clarification, wording improvement, typo fix, or non-semantic refinement.
See also: Index, Wiki-Conventions.
- Concept-Cloud-Only-Inference
- Concept-Budget-Ceiling
- Concept-Personality-Gate
- Concept-IP-And-Legal-Posture
- Concept-Supply-Chain-Discipline
- Concept-Graceful-Degradation
- Concept-Observability
- Concept-Testing-And-TDD
- Concept-Credential-Hygiene
Editing in the browser? Wiki edits are live and bypass wiki:lint. Read
Guide-Wiki-Contributing first.