Commit Graph

12 Commits

Author SHA1 Message Date
Jon Chery f3b7815120 docs(P27): update docs + README for RDS primitive + module examples
- docs/modules/index.md: add rds primitive row + Examples section
- docs/consumer-guide.md: reference examples/ directory + microservice sample
- docs/contracts/index.md: reference both sample contracts + module examples
- README.md: add rds to primitives list, note examples/ dirs, update contracts row

---ci---
project: acdl
phase: 27
milestone: v1.7
status: execute
---/ci---
2026-07-22 20:24:36 +00:00
Jon Chery 07c0349131 feat(P24): platform Lambda + DynamoDB contract ingestion + cross-account IAM
Phase 24 — platform-lambda-and-contract-ingestion.

- core/lambda/contract_ingestor.py: AWS Lambda handler invoked via Function
  URL (IAM auth). Parses JSON body, validates required fields, writes the
  contract to DynamoDB table acdl-contracts (PK consumerRepo, SK
  contractId#submittedAt, status submitted, ISO-8601 submittedAt). report_error
  action is a stub returning "error_report_prepared"; GitHub issue creation is
  wired in Phase 25. Returns 400 on missing fields / unknown action, 500 on
  error. Table name + GitHub-token secret ID come from env (set by Terraform).
- core/lambda/__init__.py: empty package marker.
- terraform/platform/main.tf: DynamoDB acdl-contracts (PITR, SSE via CMK),
  KMS customer-managed key with alias/acdl-platform, Secrets Manager secret
  acdl/github-token, IAM execution role (DynamoDB write + Secrets Manager read +
  KMS decrypt + CloudWatch logs), Lambda acdl-contract-ingestor (Python 3.12,
  handler contract_ingestor.lambda_handler), Function URL with AWS_IAM auth.
  State key platform/terraform.tfstate (distinct from spike/microservice).
- terraform/platform/README.md: documents what it deploys, the state key, how
  to apply, and the cross-account invocation model.
- terraform/platform/consumer_invoke_policy.json: ABAC-scoped policy template
  applied to consumer deploy roles during onboarding; grants
  lambda:InvokeFunctionUrl conditioned on aws:PrincipalTag/acdl:owner ==
  consumerRepo.
- tests/test_contract_ingestor.py: 11 tests (moto-backed DynamoDB mock) covering
  submit_contract put_item shape, report_error stub, missing-field 400, unknown
  action 400, the lambda_handler wrapper with a Function-URL-style event, dict
  body, default action, and internal-error 500.
- docs/environments/index.md: new section documenting the cross-account
  contract-ingestion grant (one-way consumer→platform, D-051) and that
  onboarding now also grants the consumer deploy role InvokeFunctionUrl.
- scripts/run_ci.sh, pipelines/ci.yaml, .gitea/workflows/ci.yml,
  .github/workflows/ci.yml: add core/lambda/contract_ingestor.py to the lint
  py_compile list. The two workflow YAMLs remain byte-identical.

Verification: scripts/run_ci.sh passes all 3 stages (lint/test/check-only);
python3 -m pytest tests/ -v passes all 213 tests (11 new + 202 existing).

---ci---
project: acdl
phase: 24
milestone: v1.7
status: execute
---/ci---
2026-07-22 20:04:10 +00:00
Jon Chery dca35c78ec feat(P22): rename static-asset→static-assets + cloudfront/waf primitives + production stack + @v1.6 bump
---ci---
phase: 22
title: rename-and-production-static-assets-stack
status: complete
verification:
  - scripts/run_ci.sh: PASS (CI PIPELINE OK)
  - python3 -m pytest tests/ -v: 175 passed
  - scripts/run_platform.sh --check-only: PASS (PLATFORM CHECK OK)
  - grep -R "static-asset[^s]" . (excl .git/): 0 hits
  - grep -R "static-asset$" . (excl .git/): 0 hits
  - floating git tags v1.6 + v1 point at v1.6.0 (a90a756)
changed_files:
  - Task 1 (rename): contracts/static-asset.yaml→static-assets.yaml (git mv); modules/l2/static-asset→static-assets (git mv); sed replaceAll static-asset→static-assets in 22 files (README, docs, scripts/run_platform.sh, pipelines/deploy.yaml, modules/registry.json, tests/*, .ciagent/* historical narrative)
  - Task 2 (cloudfront primitive): modules/l1/cloudfront/interface.json + README.md
  - Task 3 (waf primitive): modules/l1/waf/interface.json + README.md
  - Task 4 (registry): modules/registry.json (+cloudfront, +waf, static-assets renamed)
  - Task 5 (augment static-assets): modules/l2/static-assets/composition.json (s3+cloudfront+waf, depth 1); modules/l1/s3/interface.json +instance.json (+bucket_regional_domain_name output); modules/l2/static-assets/README.md (production stack docs)
  - Task 6 (adapter): adapters/terraform/adapter.py (+TYPE_MAP/INPUT_MAP/OUTPUT_MAP for cloudfront distribution+OAC+wafv2 webacl; special handling in _emit_resource for OAC defaults, distribution origin/cache_behavior/restrictions/viewer_certificate/web_acl_id, waf scope/default_action/visibility_config/managed rules)
  - Task 7 (contract schema): no change needed (generic inputs object; new module names match ^[a-z][a-z0-9-]*$)
  - Task 8 (@v1.6 bump): contracts/static-assets.yaml, .gitea/.github/workflows/deploy.yml (ref: v1.6 + header comments), docs/consumer-guide.md, docs/contracts/index.md, docs/pipeline/versioning.md, docs/pipeline/index.md, docs/architecture.md, README.md, modules/l2/microservice/README.md, tests/test_environment_check.py, tests/test_pipeline_contract.py
  - Task 9 (floating tags): git tag -f v1.6 v1.6.0; git tag -f v1 v1.6.0
  - Task 10 (tests): tests/test_adapter.py (registry 11 entries/9 L1/2 L2; cloudfront+waf type map tests; TestS3Output bucket_regional_domain_name; TestStaticAssetsStack 4 tests); tests/test_contract_resolver.py (+s3/cloudfront/waf resource assertions)
generated:
  - terraform/spike/main.tf + terraform.tf (regenerated by run_platform.sh --check-only; reflect static-assets production stack + backend key spike/static-assets/)
notes:
  - D-048 full rewrite of .ciagent/ historical narrative (verbatim phase descriptions, REQ-25/27/50, D-036) — produces intentional tautologies (e.g. "Rename static-assets → static-assets") per the decision to override the v1.6 preservation precedent.
  - cloudfront interface.json resources array ordered distribution-first so the resolver (first-match wire resolution) routes bucket_regional_domain_name/waf_web_acl_arn/region to the distribution; the OAC gets adapter-provided defaults (name=acdl-oac, origin_type=s3, signing_behavior=always).
  - .ciagent/ @v1.4 references left as historical record (D-048 scope was static-asset rename only; @v1.4 is historical narrative of Phase 20).
  - s3 OUTPUT_MAP bucket_regional_domain_name not added (identity fallback in adapt() already handles it; OUTPUT_MAP documents non-identity mappings only).
---ci---
2026-07-22 19:56:52 +00:00
Jon Chery a90a7562b9 verify(P21): code review — 1 P0 auto-fixed, 3 P1+ flagged
acdl-ci / Lint (push) Successful in 8s
acdl-ci / Test (push) Successful in 18s
acdl-ci / Platform check-only (offline) (push) Successful in 9s
---ci---
phase: 21
milestone: v1.6
status: verify
lessons:
  - P0 fix: docs/_config.yml had conflicting theme + remote_theme (would
    break the GitHub Pages build). Removed the conflicting theme: key,
    kept remote_theme: minimal-mistakes.
  - P2 fix: removed unused json + os imports from core/environment_check.py.
---/ci---

Multi-persona review of v1.6 phase 21 (docs restructure + core rename +
environments scaffold).

P0 (blocking) — AUTO-FIXED:
- M1: docs/_config.yml declared both  and
  . Jekyll rejects using
  both; the Pages build would fail. Fixed: removed the  line,
  kept  (minimal-mistakes, which provides the
  layout the defaults reference).

P2 (nits) — AUTO-FIXED:
- M2: core/environment_check.py imported  +  but never used
  them. Removed.

P1 (important) — FLAGGED FOR POST-HOC REVIEW (do not block ship):
- C1 (pre-existing, from v1.5 review C2): .github/workflows/deploy.yml
  checks out the platform repo at , but no floating  tag
  exists (only v1.4.0 / v1.4.1). Operator must create a floating v1.4
  tag or change the ref to v1.4.1 (or v1.6.0 now that it exists). The
  consumer guide + sample contract also reference @v1.4.
- C2: docs/_config.yml  key is not a standard minimal-mistakes
  navigation config (that theme reads _data/navigation.yml). The
  key is harmless metadata but won't render a real nav. Recommend adding
  docs/_data/navigation.yml for the theme, or switching to a theme that
  reads  from _config.yml. Non-blocking for the docs content.
- S1 (pre-existing, from v1.5 review S1): the static-key override in
  deploy.yml sets ACDL_AWS_ACCESS_KEY_ID/ACDL_AWS_SECRET_ACCESS_KEY as env
  vars on the configure-aws-credentials step, but that action reads AWS_*
  or its own access-key/secret-key inputs, not ACDL_AWS_*. The override
  is not actually wired. Phase 21 did not touch this step.

Verified: byte-identical workflows (CI + deploy); dev.json valid JSON;
all core Python compiles; path-traversal on --env is safe (no file match
-> onboarding prompt, exit 1); all docs internal links resolve; 166
tests pass; run_ci.sh green. The run_platform.sh env-check ordering is
correct (default contract is assigned before the env check runs).
2026-07-22 18:41:41 +00:00
Jon Chery df7b40b435 docs(P21): normalize vision.md L1/L2/L3A/L3B labels (VERIFY fix)
---ci---
project: acdl
phase: 21
milestone: v1.6
status: verify
---/ci---

VERIFY caught a residual L1/L2/L3A/L3B nomenclature in docs/vision.md
('the four-layer model (L1 Terraform primitives, L2 composed stacks, L3A
developer surface, L3B agentic surface)'). Normalized to (primitives,
modules, developer surface, agentic surface) to match the consumer-facing
terminology.

Verification summary:
- REQ-52: 0 .ciagent/.gitea refs in docs/ README.md modules/ contracts/.
- REQ-53: 0 acdl_platform refs in code (excl .ciagent/demo/.git).
- REQ-54: docs/ Jekyll structure complete; 0 .ciagent links in docs/.
- REQ-55: 0 L1/L2/L3A/L3B labels in consumer docs; composition->pattern
  in prose (composition.json files kept); composition roadmap entry kept.
- REQ-56: 0 forge refs in consumer docs.
- REQ-57: README repository roles restated (app code + contracts + CI
  definitions).
- REQ-58: Features + Roadmap sections present; no version changelog.
- REQ-59: mermaid has security-checks + infrastructure-plan + policy-
  checks + infrastructure-apply; no tool names in diagram.
- REQ-60: 0 go-gitea/waiver/D-039/D-047 in README; daily/out-of-band
  rotation retained.
- REQ-61: core/environments/ + dev.json + environment_check.py +
  run_platform.sh wire-in + 12 tests.

Tests: 166 pass. run_ci.sh green.
2026-07-22 18:27:01 +00:00
Jon Chery d830357230 docs(P21): restructure docs/ into Jekyll Pages site (REQ-54, REQ-55, REQ-56)
---ci---
project: acdl
phase: 21
milestone: v1.6
status: execute
---/ci---

Restructure docs/ into a Jekyll-style GitHub Pages site:
- docs/_config.yml (Pages config + nav, excludes internal/)
- docs/index.md (landing: platform + consumer model, Features, Roadmap)
- docs/modules/index.md (catalog: primitives + modules, normalized terms)
- docs/contracts/index.md (schema, fields, sample, multi-contract)
- docs/pipeline/index.md (CI + deploy pipeline, stages mermaid, streaming)
- docs/pipeline/versioning.md (module + deploy-pipeline versioning)
- docs/environments/index.md (platform-managed envs + onboarding, REQ-61)
- docs/consumer-guide.md (renamed from CONSUMER_GUIDE.md; GitHub-only,
  no .gitea, forge->platform runners, L2->modules, composition->pattern,
  updated mermaid with security-checks + infrastructure-apply)
- docs/architecture.md (consolidated from architecture.md +
  architecture-v1.0.md, current-architecture only, normalized terms:
  primitives/modules, platform runners, no L1/L2/forge/gitea in prose)
- Removed docs/architecture-v1.0.md (consolidated) + docs/CONSUMER_GUIDE.md
  (renamed).

No .ciagent/ or .gitea/ references in docs/. Consumer-facing terminology
normalized (L2->modules, L1->primitives, composition->pattern, forge->
platform runners).
2026-07-22 18:22:58 +00:00
Jon Chery f68f85c9fd review(v1.5): READY TO SHIP — multi-persona code review
acdl-ci / Lint (push) Successful in 7s
acdl-ci / Test (push) Successful in 15s
acdl-ci / Platform check-only (offline) (push) Successful in 9s
---ci---
project: acdl
phase: 20
milestone: v1.5
status: review
verdict: READY TO SHIP
p0: 1 (fixed — contract path resolution in deploy workflow)
p1: 6 (flagged post-hoc)
---/ci---

Multi-persona review of v1.5 phase 20 (docs + reusable deploy workflow).

P0 (blocking) — AUTO-FIXED:
- C1: scripts/run_platform.sh contract path resolution broken in deploy
  workflow. The reusable workflow invokes run_platform.sh from the consumer
  workspace root with a relative contract path (.acdl/contract.yaml), but
  run_platform.sh does `cd "$ROOT"` (platform repo) early, so the relative
  path resolved against the platform repo and the pipeline could never run.
  Fix (commit 75c2274): capture CALLER_CWD before cd "$ROOT"; resolve
  caller-supplied relative paths against CALLER_CWD; default no-arg contract
  stays relative to ROOT (preserves platform-local CI). Reproduced pre-fix;
  verified post-fix.

P1 (important) — FLAGGED FOR POST-HOC REVIEW (do not block ship):
- C2: ref: v1.4 in the deploy workflow platform checkout — no v1.4 tag exists
  (only v1.4.0 / v1.4.1). Operator must create a floating v1.4 tag or change
  the ref to v1.4.1.
- C3: modules/l2/{static-asset,microservice}/README.md still use @v1 in their
  Usage examples; missed by the v1.4 bump.
- S1: static-key override is not wired. ACDL_AWS_* env vars on the OIDC step
  are not read by aws-actions/configure-aws-credentials@v4 (it reads AWS_*
  or its own access-key/secret-key inputs). The README/CONSUMER_GUIDE claim
  a working override that doesn't function as written. Needs a conditional
  step or renamed env vars + input wiring.
- S2: README overstates ABAC repo:org/repo:ref:... scoping. The workflow
  constructs a numeric role name (github.repository_id); the actual claim
  enforcement lives in the IAM trust policy, not in this workflow.
- T1: no deploy-workflow triggers conformance test (CI workflow has one;
  deploy doesn't). Minor — reusable workflows use workflow_call, not push
  triggers, but the contract's triggers field is then unenforced.
- A1: terraform/spike/terraform.tf uploaded as artifact leaks the AWS account
  ID via the state-backend bucket name. Recommend excluding terraform.tf or
  gating artifact upload to non-public repos.

P2 (nits) — listed for awareness: floating-tag terminology imprecision (M1),
  header comment "Gitea Actions" in the GitHub copy (M2, intentional byte-
  identical), pip install split (P1-perf), comment drift in pipelines/deploy.yaml
  header (C4), module README internal inconsistency (C5).

Verdict: READY TO SHIP. The one P0 is fixed. The 6 P1s are post-hoc items —
the deploy workflow is a scaffold whose first real consumer run requires
operator setup (tag, IAM role, secrets) that gates go-live. The P1s should
be addressed before any consumer invokes uses: acdl/.gitea/workflows/
deploy.yml@v1.4 in earnest.

Tests: 154 pass (19 new). run_ci.sh green.
2026-07-22 17:24:28 +00:00
Jon Chery 2a84c0047b feat(P20): consumer happy path + reusable deploy workflow (v1.5.0)
---ci---
project: acdl
phase: 20
milestone: v1.5
status: verify
---/ci---

REQ-46: README rewritten — platform-source vs consumer-repo distinction up
front; platform flow converted to mermaid flowchart TD; L3A/L3B + spike
nomenclature scrubbed from prose (code paths kept verbatim); prereqs pointer
to consumer guide added.
REQ-47: docs/CONSUMER_GUIDE.md (generic, all L2 modules) replaces
docs/consumer-guide-static-asset.md — mermaid diagrams (model LR + pipeline
TD), versioned uses: (@v1.4 floating MAJOR+MINOR, bare/@main discouraged),
consumer-scoped prerequisites (no Terraform/Checkov/boto3/runner-key), run-
time platform fetch via reusable workflow (consumers never invoke
scripts/run_platform.sh locally for the happy path), optional local
validation note.
REQ-48: Credentials section rewritten — zero-trust OIDC + ABAC default
(repo-identity + resource-tag scoping, blast-radius containment); static-key
override in GitHub Secrets or .env.secrets with platform-managed daily
rotation; consumer rotates out of band when using .env.secrets locally.
REQ-49: byte-identical .gitea/workflows/deploy.yml + .github/workflows/
deploy.yml — reusable (on: workflow_call), checks out consumer repo + ACDL
platform repo, installs deps, runs run_platform.sh, uploads artifacts; OIDC
default (permissions: id-token: write) + static-key override via secrets.
REQ-50: contracts/static-asset.yaml uses: @v1.4 (MAJOR+MINOR).
REQ-51: tests/test_pipeline_contract.py extended — TestDeployPipelineSchema,
TestDeployPipelineContract, TestDeployWorkflowConformance (byte-identical,
reusable, contract/mode inputs, run_platform invocation, platform-repo
checkout, OIDC permissions), TestSampleContractVersioning. 154 tests pass
(19 new); run_ci.sh green.

Fixes: modules/l2/static-asset/README.md dangling link retargeted to
docs/CONSUMER_GUIDE.md.
2026-07-22 17:14:12 +00:00
Jon Chery 92d4535f5f phase: 7, status: plan-as-execute, persona: lead-developer, task: T-7.1
---ci---
project: acdl
phase: 7
milestone: v1.1
status: plan-as-execute
persona: lead-developer
task: T-7.1
requirements.covered: [REQ-16]
---/ci---

Snapshot docs/architecture.md (v0.2) to v1.0. Body §§1-12 copied verbatim;
resolution log + §13 markers rewritten to  RESOLVED (see PROJECT.md);
§14 status bumped to v1.0; new §15 maps the 6 Phase 07 authored files to
their REQs + owner personas. gitea-runner rename (D-046) applied;
act_runner appears only in a 'formerly' note. All 11 open-decision IDs
present (W1.A, W1.B, W2.A, W3.D, W3.E, BA.A-F, Q1.3 OpenTofu).
2026-07-21 18:42:37 +00:00
grimacing b84a8a2241 Update docs/architecture.md 2026-07-21 17:38:57 +00:00
grimacing 7614c41530 Add docs/vision.md 2026-07-21 17:35:51 +00:00
grimacing 52665b8f0c Add docs/architecture.md 2026-07-21 17:28:09 +00:00