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
{{ message }}
Repository navigation
[Feature] Profiles / Features / State V2 (PR-1) #162
Profiles (governance levels) and capabilities (features) are entangled; the
Multi-Forge architecture requires a project-scope feature model with a State V2
schema, atomic feature switching and provider template sets — without weakening
the existing lifecycle ownership, transaction and migration guarantees.
ainative installs a governance profile (standard/verified) and, independently,
optional features (forge-github, forge-gitlab, ...). State V2 carries active_features[]; a single shared project_install_state() projects V1 state
read-only; migration is idempotent and never resurrects absent files.
PR-1A — Feature model and state projection: Feature model with components[]/conflicts[]; State schema V2 with active_features[];
shared project_install_state(); read-only V1 projection; V2 validation.
Tests: V1 standard → projected forge-github; V1 verified → projected forge-github; V1 + GitLab remote → forge-github compatibility default;
V1 + no remote → forge-github compatibility default; V2 one forge →
valid; V2 zero forge → valid; V2 GitHub+GitLab → STATE_CONFLICTING_WORK_FORGE_FEATURES; project_install_state() is
idempotent.
PR-1B — Atomic feature switching: feature enable, feature disable, feature switch, feature switch none in one lifecycle transaction:
acquire project lifecycle lock → reload state → project effective V2 →
plan → apply → verify → write state V2 last → commit.
PR-1B migration neutrality: a V1→V2 migration never resurrects a previously
managed file that is currently absent (fixture: state says the GitHub
template existed, file is absent → stays absent); an explicit later feature enable may seed feature files normally; no permanent file
tombstones.
PR-1C templates: github-templates ID preserved; gitlab-templates added
with .gitlab/issue_templates/ and .gitlab/merge_request_templates/ where
applicable; existing ownership semantics preserved.
Ownership matrix tests: managed unchanged → replace/update allowed; managed
modified → conflict/preserve; not managed → never silently adopted;
removed feature + modified file → preserve; manually absent during
migration → remains absent; user collision → conflict.
Read-only parity: doctor, status, planner, feature status, update check all derive feature state through the same projection; E2E:
V1 state → read-only status → later V2 migration → effective feature set
identical.
No new lifecycle transaction system; existing journal/backup/repair/
rollback and state-last invariants preserved.
Multi-Forge implementation merged into dev (squash f0101fc via PR #172), full CI matrix green (52/52: Linux/Windows/macOS, py3.11/3.13). The Issue stays open until the final dev -> main promotion, per the maintainer rule that main is untouched until everything is tested and integrated.
The follow-up increment (mandatory secret-pattern floor, scenarios J/M/P, documentation parity) is merged into dev (squash a8e1fb6 via PR #174, CI 76/76 green). The Issue stays open until the final dev -> main promotion.
Problem
Profiles (governance levels) and capabilities (features) are entangled; the
Multi-Forge architecture requires a project-scope feature model with a State V2
schema, atomic feature switching and provider template sets — without weakening
the existing lifecycle ownership, transaction and migration guarantees.
Source: Multi-Forge v1.3.2-final §25–32 (PR-1, PR-1A/1B/1C).
Expected outcome
ainativeinstalls a governance profile (standard/verified) and, independently,optional features (
forge-github,forge-gitlab, ...). State V2 carriesactive_features[]; a single sharedproject_install_state()projects V1 stateread-only; migration is idempotent and never resurrects absent files.
Acceptance criteria
components[]/conflicts[]; State schema V2 withactive_features[];shared
project_install_state(); read-only V1 projection; V2 validation.Tests: V1 standard → projected
forge-github; V1 verified → projectedforge-github; V1 + GitLab remote →forge-githubcompatibility default;V1 + no remote →
forge-githubcompatibility default; V2 one forge →valid; V2 zero forge → valid; V2 GitHub+GitLab →
STATE_CONFLICTING_WORK_FORGE_FEATURES;project_install_state()isidempotent.
feature enable,feature disable,feature switch,feature switch nonein one lifecycle transaction:acquire project lifecycle lock → reload state → project effective V2 →
plan → apply → verify → write state V2 last → commit.
managed file that is currently absent (fixture: state says the GitHub
template existed, file is absent → stays absent); an explicit later
feature enablemay seed feature files normally; no permanent filetombstones.
github-templatesID preserved;gitlab-templatesaddedwith
.gitlab/issue_templates/and.gitlab/merge_request_templates/whereapplicable; existing ownership semantics preserved.
modified → conflict/preserve; not managed → never silently adopted;
removed feature + modified file → preserve; manually absent during
migration → remains absent; user collision → conflict.
unchanged template, modified template, missing template, colliding user
file.
doctor,status,planner,feature status,update checkall derive feature state through the same projection; E2E:V1 state → read-only status → later V2 migration → effective feature set
identical.
rollback and state-last invariants preserved.
Out of scope
(PR-4), GitLab provider (PR-5).
Context
ainative/lifecycle/state.py,installer.py,planner.py,manifest.py.Dependencies