feat: semchunk sidecar + AWS environment blueprint + quick-start (v1.57.0 → v1.59.0)#5
Merged
Merged
Conversation
Adds the planning docs for executing ADR-030's opt-in path plus a new AWS deployment story: - PRD: semchunk sidecar behind an IChunker port (env-var opt-in, new indexing only, fixed-window fallback) and Terraform on ECS Fargate - ADR-033: Terraform + ECS Fargate topology, secrets, and the enable_semchunk variable gating the sidecar - ADR-030: amended to Accepted (opt-in scope); corpus re-embedding migration remains deferred - Phase doc targeting v1.57.0 (MINOR, no schema change) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WR73cFcTm6JKJfGckK8JNa
Executes ADR-030's opt-in path and implements ADR-033: - IChunker domain port; FixedWindowChunker (existing behaviour), SemchunkChunker (HTTP client, Result-pattern errors), FallbackChunker (degrades to fixed windows and logs when the sidecar is down) - DocumentIndexingService takes an injected IChunker; wiring selects by CHUNKER_PROVIDER env var (default: fixed, no network) - services/semchunk: FastAPI wrapper around semchunk 4.x with healthz, input caps, offline tokenizer fallback; tests run in the image build - docker-compose "semchunk" profile; production Dockerfile.web (real next build, AUTH_BYPASS dead in production) - infra/aws Terraform: VPC, RDS Postgres 16, S3 + scoped IAM user, ECS Fargate + ALB, Secrets Manager; enable_semchunk deploys the sidecar behind Service Connect and wires the web task env atomically - validate.sh check 16: guarded terraform fmt/validate MINOR bump 1.56.0 -> 1.57.0. No DB changes. Corpus re-chunk migration remains deferred (ADR-030 Decision 2). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WR73cFcTm6JKJfGckK8JNa
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WR73cFcTm6JKJfGckK8JNa
…(v1.58.0) Implements ADR-034 (amends ADR-033): the repo becomes a blueprint third parties use to provision Wayfinder environments on demand. - infra/aws/core: apply once — VPC, ECS cluster + Service Connect namespace, shared RDS Postgres 16, ALB with wildcard HTTPS listener (fixed-404 default), shared ECR repositories - infra/aws/environments: one terraform workspace per environment; each stamp owns its database (cyrilgdn/postgresql provider on the shared server), S3 bucket + scoped IAM user, secrets, task roles, web service + host rule <env>.<base_domain>, optional Route53 record, optional per-env semchunk sidecar (semchunk-<env> alias) - scripts/new-environment.sh / destroy-environment.sh: one-command stamp/teardown with name validation and --plan dry-run - .github/workflows/provision-environment.yml: optional workflow_dispatch stamping (inert until AWS vars/OIDC configured) - partial backend config (backend.hcl.example) shared by local applies and the workflow; validate.sh check 16 covers both roots - README rewritten around bootstrap → core → stamp → destroy MINOR bump 1.57.0 -> 1.58.0. No app code or schema changes. Breaking for v1.57.0 infra adopters: flat layout removed, destroy-before-adopt (documented). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WR73cFcTm6JKJfGckK8JNa
…v1.59.0)
Implements ADR-035: collapses blueprint adoption from ~10 manual steps
to three commands and removes both setup footguns.
- scripts/bootstrap.sh: idempotent core setup (preflight, state bucket,
backend.hcl + tfvars generation, core init/apply, image build+push)
- core issues the *.<base_domain> ACM certificate itself when
route53_zone_id is set (certificate_arn now optional; plan-time guard
requires one of the two)
- default-on SSM bastion (t4g.nano, SSM-only, IMDSv2, no ingress) +
scripts/db-tunnel.sh + --via-tunnel on new/destroy-environment.sh:
stamping works from a laptop; overrides redirect only the postgresql
provider, stored DATABASE_URL keeps the in-VPC host
- environments inherit route53_zone_id from core ("" still opts out)
- README leads with the three-command quick start
MINOR bump 1.58.0 -> 1.59.0. No app code or schema changes.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WR73cFcTm6JKJfGckK8JNa
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WR73cFcTm6JKJfGckK8JNa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase summary
Three phases on this branch:
v1.57.0 — opt-in semchunk sidecar + AWS IaC (ADR-030 executed, ADR-033). A new
IChunkerdomain port injected intoDocumentIndexingService;CHUNKER_PROVIDER=semchunkroutes chunking through a Python FastAPI sidecar (services/semchunk/) with automatic, logged fallback to the existing fixed-window chunker — indexing degrades rather than fails; unset means byte-identical behaviour to before. New indexing only (corpus re-chunk stays deferred per ADR-030 Decision 2). Plus a productionDockerfile.weband a compose profile.v1.58.0 — AWS environment blueprint (ADR-034).
infra/awsbecame a two-layer blueprint so third parties can stamp Wayfinder environments on demand:core/(apply once — VPC, ECS cluster + Service Connect namespace, shared RDS Postgres 16, ALB with wildcard HTTPS listener, ECR) andenvironments/(one Terraform workspace per stamp — own database viacyrilgdn/postgresql, own S3 bucket/secrets/IAM, web service +https://<env>.<base_domain>host rule, optional per-env semchunk sidecar).scripts/new-environment.sh/destroy-environment.sh+ optionalworkflow_dispatchworkflow. Breaking for v1.57.0 infra adopters (flat layout removed; destroy-before-adopt documented).v1.59.0 — quick-start (ADR-035). Setup for a cloud engineer collapsed to three commands:
./scripts/bootstrap.sh --region … --state-bucket … --base-domain … --route53-zone-id … ./scripts/db-tunnel.sh & ./scripts/new-environment.sh dev --via-tunnelbootstrap.sh: idempotent preflight → state bucket → config generation → core apply → image build/pushcertificate_arnnow optional, plan-time guard requires one of the two)enable_bastion=falseto remove) +db-tunnel.sh+--via-tunnelon stamp/destroy — removes the RDS network-path footgun; overrides redirect only the terraform provider, the stampedDATABASE_URLkeeps the in-VPC hostroute53_zone_idfrom coreFiles changed
packages/domain/src/ports/chunker.ts;packages/adapters/src/extraction/{fixed-window,semchunk,fallback}-chunker.ts(+tests); indexing-service chunker injection;apps/web/src/lib/{env,container}.ts;services/semchunk/;docker-compose.yml;Dockerfile.web;.env.exampleinfra/aws/{core,environments}/, modulesnetwork/database-server/cluster/environment/semchunk-service,scripts/{bootstrap,db-tunnel,new-environment,destroy-environment}.sh,backend.hcl.example;.github/workflows/provision-environment.ymlvalidate.shcheck 16 (guarded terraform fmt/validate over both roots); PRD §10a; ADR-030/033/034/035; phase docs + summaries underimplemented/v1.57.0–v1.59.0Version bump
MINOR ×3 — 1.56.0 → 1.59.0 (
VERSION+ rootpackage.jsonin sync; no DB schema changes in any phase).Test coverage
./validate.shgreen after every phase (15 PASS, 0 FAIL)apps/web/e2e/phase-semchunk-sidecar.spec.ts— 4/4 passed against a live sidecar during the build--via-tunnelparsing incl. invalid ports, tunnel-not-listening fail-fastNotes for review
terraform -chdir=infra/aws/core init -backend=false && terraform -chdir=infra/aws/core validate(same forenvironments/) before applying.db-tunnel.shassumes the AWS Session Manager plugin is installed.🤖 Generated with Claude Code
https://claude.ai/code/session_01WR73cFcTm6JKJfGckK8JNa