Skip to content

workspace: a flag record kind, resolved as a build-time parameter, gated like any change, with a stale-flag lint #4024

Closed

Description

@lex00

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

  1. A flag record kind with a name, an owner, a link to the work item it hides (the flag's own record field; a work item's implements names a decision, not a flag), and a value per environment, validated by its JSON Schema.
  2. chant build --env <env> resolves declared build parameters from flag records, recorded on the build like any other parameter source.
  3. 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.
  4. workspace status --json lists flags under featureFlags, with their values per environment and the work item each implements.
  5. 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 --param beats every other source (concepts/build-time-parameters.mdx:44-60), so a --param could set a flag around the gate. In an environment with a gate, a flag-backed parameter can't be overridden by --param, --params-file or env; the build refuses.
  • Naming. The release record already has a field called flags (["legacy-digest"], status.schema.json:912-922). The status listing is featureFlags.

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 artifactDigests equal the previous release's.
  • A negative test: --param can't override a flag in a gated environment.

Activity

  1. added
    enhancement
    design
    area:workspace
    on Oct 16, 2026
  2. added
    phase:3
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:workspacedesignenhancementphase:3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions