Repository navigation
Description
Problem
frodo feature install -i <id> decides whether to install from the registry alone (hasIdmFeature: the feature reads installed or not). The registry is derived: it reads "installed" only when every definition of the feature in the tenant equals the original byte for byte. When the definitions are there but differ (a trailing newline, a changed title, an extra mapping property), the registry reads "not installed" although the feature is present, and feature install goes on: it asks "This cannot be undone. Continue?" (or, with -y, does not ask) and requests the install.
The library's diagnosis says what that does in this state: "it must not run the enable action, which installs the feature internally, until they are aligned" (finding definitions-cosmetic-drift of frodo feature validate -i aiagent), and the repair plan aligns the definitions first "so that the enable action does not add the feature a second time". The same drift was the cause of a broken AI agents feature on a Cloud development tenant on 2026-11-12, found while investigating frodo-cli#1300.
Not reproduced with an install on a tenant: an install cannot be undone, so only the diagnosis text and the earlier investigation support the claim that definitions are added a second time.
Proposal
- For a feature the library can diagnose (today
aiagent; seeFEATURES_WITH_DIAGNOSISinsrc/ops/FeatureOps.ts, which is to be replaced by the library's own answer, frodo-lib#1100),feature installruns the diagnosis before it asks. If the diagnosis reports that definitions of the feature are already in the tenant but differ from the original (cosmetic or structural drift),feature installrefuses, prints the finding, and names the command that fixes it:frodo feature validate -i <id>to look andfrodo feature validate -i <id> --repairto repair. Exit code 1; nothing is requested from the install endpoint. - A feature the library cannot diagnose behaves as it does today and sends the same requests.
- Unit tests with the library stubbed: drift refused (no install request), no drift installs as before, a feature without diagnosis unchanged, a diagnosis that fails (reported, no install).
Acceptance
feature installon a tenant whose registry reads not installed because of drift does not install and says what to do.- Nothing changes for a tenant on which the feature is absent, or present and unchanged.
Related: frodo-cli#1300 (feature validate diagnosis and --repair), frodo-lib#1100, frodo-lib#1101.
Activity
fix: feature install refuses when the definitions of the feature are …