Repository navigation
Description
Sub-issue of INTENTIUS/behold#678. Works on any forge today. Design decided in #4016: a flag is a workspace record read as a build-time parameter.
Context
There is no flag concept. Build-time parameters fold to literals and are recorded on BuildResult.buildParams (concepts/build-time-parameters.mdx:111), but their sources are --param, --params-file, env and defaults only (:44-60).
Requirements
- A
flagrecord kind with a name, an owner, a link to the work item it hides (the flag's own record field; a work item'simplementsnames a decision, not a flag), and a value per environment, validated by its JSON Schema. chant build --env <env>resolves declared build parameters from flag records, recorded on the build like any other parameter source.- A flag value change changes the build, so it appears in the change set and goes through a gate. No path flips a flag in an environment without a gate.
workspace status --jsonlists flags underfeatureFlags, with their values per environment and the work item each implements.- A lint rule reports a flag whose work item's decision is confirmed (due for removal).
Expected outcome
Unfinished work lives on trunk behind a flag, turning it on is a reviewed and gated change, and flags get removed when their work is done.
Releases (#4026)
Under ws-104 a flag change is a commit and gets its own release. Its value is a params entry in each target, and that entry's source names the flag record. When no artifact source changed, the release's artifactDigests equal the previous release's. A flag ships with every trunk commit merged before it (ws-104 question 6).
Audit fixes
- Precedence. Today
--parambeats every other source (concepts/build-time-parameters.mdx:44-60), so a--paramcould set a flag around the gate. In an environment with a gate, a flag-backed parameter can't be overridden by--param,--params-fileor env; the build refuses. - Naming. The release record already has a field called
flags(["legacy-digest"],status.schema.json:912-922). The status listing isfeatureFlags.
Acceptance
- Record kind, schema and docs.
- Build resolution from records, with a test that a flag change alters the change set.
- Flags in the status contract.
- The stale-flag lint rule with a fixture.
- A test that a flag change yields a release whose
artifactDigestsequal the previous release's. - A negative test:
--paramcan't override a flag in a gated environment.
Activity