You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/decisions/ADR-002-least-privilege-bootstrap-policies.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
**Status:** accepted
4
4
**Date:** 2026-05-19
5
-
**Implementation:**Tracked in RFC #120; artifacts referenced below land progressively across the 8-PR stack and are not yet present on `main`.
5
+
**Implementation:**Core shipped (#158, #162). The typed policies (`cdk/src/bootstrap/policies/`), triple-layer versioning (`cdk/src/bootstrap/version.ts` — `BOOTSTRAP_VERSION = '1.1.0'`, `computeBootstrapHash()`), the generated bootstrap template (`cdk/bootstrap/bootstrap-template.yaml`), and the `mise //cdk:bootstrap` + `mise //cdk:bootstrap:generate` tasks are all present on `main`. Two sub-mechanisms remain pending: the synth-time CDK Aspect (#125, depends on the resource-action-map #124) and the deploy-time `mise //cdk:preflight` validator (#126). See RFC #120 for the original stack.
6
6
7
7
## Context
8
8
@@ -19,7 +19,7 @@ The ABCA project documented three scoped policies in `docs/design/DEPLOYMENT_ROL
19
19
20
20
## Decision
21
21
22
-
### Policies as typed TypeScript code in `cdk/src/bootstrap/`*(lands in #122)*
22
+
### Policies as typed TypeScript code in `cdk/src/bootstrap/`*(shipped)*
23
23
24
24
Rationale for location:
25
25
-**Agent routing** — `AGENTS.md` routes CDK/IAM changes to `cdk/`. An agent modifying a construct that adds a DynamoDB table naturally looks here for the policy it must update.
@@ -35,16 +35,16 @@ Rationale for location:
35
35
|**SHA256 hash**| Detects console drift — manual IAM edits that diverge from code. |
36
36
|**Action-set comparison**| Precise gap reporting: exactly which actions are missing. |
37
37
38
-
Semver and hash are emitted as CloudFormation outputs on the CDKToolkit stack, enabling automated preflight checks.
38
+
Semver and hash are computed by `cdk/src/bootstrap/version.ts` (`BOOTSTRAP_VERSION`, `computeBootstrapHash()`) and emitted into the generated template / `cdk/bootstrap/{BOOTSTRAP_VERSION,BOOTSTRAP_HASH}` files, enabling automated preflight checks.
39
39
40
40
### Two-layer preflight validation
41
41
42
-
1.**CDK Aspect (synth-time)***(lands in#125)* — will run during `mise //cdk:synth`, visiting every `CfnResource`, looking up required actions in a resource-action-map (#124), and comparing against declared policy. Catches issues at dev time.
43
-
2.**Live-account validator (deploy-time)***(lands in#126)* — `mise //cdk:preflight` will read CDKToolkit stack outputs, compare version/hash against requirements, and fail fast with an actionable "re-bootstrap required" message before CloudFormation starts.
42
+
1.**CDK Aspect (synth-time)***(pending —#125)* — will run during `mise //cdk:synth`, visiting every `CfnResource`, looking up required actions in a resource-action-map (#124), and comparing against declared policy. Catches issues at dev time. **Not yet implemented:**`cdk/src/main.ts` currently registers only `AwsSolutionsChecks` (cdk-nag) — there is no bootstrap-policy aspect.
43
+
2.**Live-account validator (deploy-time)***(pending —#126)* — `mise //cdk:preflight` will read CDKToolkit stack outputs, compare version/hash against requirements, and fail fast with an actionable "re-bootstrap required" message before CloudFormation starts. **Not yet implemented:** no `preflight` task exists in `cdk/mise.toml`.
44
44
45
45
### Custom bootstrap template
46
46
47
-
*(Lands in #123)* — will be generated from the policy source code (not hand-maintained). Operators will run `mise //cdk:bootstrap` to provision least-privilege roles in a single command. The template replaces `AdministratorAccess` with the three managed policies while retaining all other default bootstrap resources.
47
+
*(shipped)* — generated from the policy source code (not hand-maintained) at `cdk/bootstrap/bootstrap-template.yaml`. Operators run `mise //cdk:bootstrap` (which depends on `mise //cdk:bootstrap:generate` to regenerate the policy JSON, template YAML, and version/hash files) to provision least-privilege roles in a single command. The template replaces `AdministratorAccess` with the three managed policies while retaining all other default bootstrap resources.
Copy file name to clipboardExpand all lines: docs/decisions/ADR-013-tiered-validation-pyramid.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ The root cause: there is no **Tier 2** — a local, fast, high-fidelity validati
31
31
| Tier | Time | What it catches | Gap |
32
32
|------|------|-----------------|-----|
33
33
| Pre-commit (Tier 0) | < 5s | Formatting, secrets, trailing whitespace | None — works well |
34
-
| mise build (Tier 1) | 30–90s | Compile, unit tests, CDK synth, docs sync, linting |Partial — available but not gated on push|
34
+
| mise build (Tier 1) | 30–90s | Compile, unit tests, CDK synth, docs sync, linting |Wired as a pre-push gate (prek `pre-push` hooks run tests + security); the `mise run build` superset is available on demand|
35
35
| Remote CI (Tier 3) | 5–20 min | Full matrix, security, E2E, deploy | Authoritative but slow |
36
36
|**Local integration (Tier 2)**| — |**Does not exist**| Integration-level validation without remote round-trip |
Status: **Partially implemented**— available as `mise run build` but not enforced as a push gate. Agents can invoke this but often skip it.
95
+
Status: **Implemented as a pre-push gate.**`.pre-commit-config.yaml` sets `default_install_hook_types: [pre-commit, pre-push]`, and the `monorepo-tests-pre-push` and `monorepo-security-pre-push` hooks (both `stages: [pre-push]`) run `mise run hooks:pre-push:tests` (→ `mise //cdk:test`, `mise //cli:test`, and the agent test suite) and `mise run hooks:pre-push:security` (→ `mise run security`) on every push. Note the shipped gate runs tests + security rather than the full `mise run build` superset (which additionally covers CDK synth, docs sync, and type/constants drift); those remain available on demand and are enforced authoritatively in Tier 3.
96
96
97
-
Requirement: Make `mise run build` (or a subset) the pre-push gate. Consider splitting into `mise run check:fast` (compile + lint, 30s) and `mise run check:full` (compile + test + synth, 90s).
97
+
Remaining refinement: consider splitting into `mise run check:fast` (compile + lint, 30s) and `mise run check:full` (compile + test + synth, 90s), and folding synth/docs-sync/drift checks into the push gate for full Tier 1 coverage.
98
98
99
99
**Tier 2 — Local sandbox (1–5 min, on-demand before PR)**
100
100
@@ -162,7 +162,7 @@ The gap analysis dictates priority:
162
162
163
163
| Priority | Investment | Impact |
164
164
|----------|-----------|--------|
165
-
| P0 | Enforce Tier 1 as pre-push gate | Eliminates "pushed without building" class of CI failures |
165
+
| P0 |~~Enforce Tier 1 as pre-push gate~~**(largely done)** — test + security push gate is wired (prek `pre-push` hooks); remaining work is folding synth/docs-sync/drift into the gate | Eliminates "pushed without building" class of CI failures |
166
166
| P1 |`mise run test:integration` (Tier 2a — LocalStack) | Eliminates 60%+ of CI-only failures (AWS API contract mismatches) |
167
167
| P2 | Agent smoke test (Tier 2b) | Catches agent runtime regressions before PR |
168
168
| P3 | Ephemeral stack deploy (Tier 2c) | Catches IAM/wiring issues that only surface in real deployment |
@@ -207,7 +207,7 @@ Escape hatches must be explicit (noted in PR description, not silent).
- ADR-008 — definition of done (tier requirements per DoD level)
209
209
- ADR-012 (prerequisite) — operational knowledge stack; this ADR depends on 012's skill model for agent interaction with validation tiers
210
-
- Current hooks: `.pre-commit-config.yaml`(Tier 0 implementation)
210
+
- Current hooks: `.pre-commit-config.yaml`— the config file keeps the `pre-commit` name, but the runner is **prek** (pinned in `mise.toml``[tools]`; `prek install --prepare-hooks` wires both `pre-commit` and `pre-push` stages). Implements Tier 0 (`pre-commit` stage) and the Tier 1 push gate (`pre-push` stage).
0 commit comments