refactor(engine,app): consolidate gating descriptors, option intake, and planning seams#31
Merged
Merged
Conversation
…and planning seams Implement OpenSpec change deepen-cli-intake-and-gating-descriptors: - internal/engine: one gating descriptor table (descriptors.go) now drives buildCoreFacts gating, BuiltinFactGroups (as a projection), and a shared fact-hierarchy helper replacing four independent ancestor/descendant walks; agreement between gate names, group membership, and emitted roots is enforced by test instead of convention. - internal/app: the runQuery FlagSet is derived from the cli option registry (options.go) with a registry<->parser parity test; the hand-rolled configPathFromArgs/externalDirsFromArgs walkers are replaced by a registry-driven whole-tail scanner that preserves the historical permissive list-task semantics (positionals, --, and extra task flags ignored). - engine planning seam: the version fast path and list-group tasks consume the engine's resolved external-dir planning instead of mirroring it. - bug fix: a disabled fact is no longer served from cache on the query path; the disabled subtraction is confined to the cache interaction so all non-cache output stays byte-identical (closes the deferred add-fact-disable-controls task 1.6 with regression tests). Behavior-preserving otherwise: pre-refactor pin tests lock list-task option semantics, error-prefix tiers, fast-path bytes, and inline fact emission order. Adversarially reviewed (multi-lens panel + Codex + OCR; five divergences found and fixed with HEAD-differential proofs) and lab-validated on FreeBSD, OmniOS, OpenBSD, NetBSD, DragonFly, Windows, and Plan 9.
…ake-and-gating-descriptors, sync main specs - add-fact-disable-controls: task 1.6 closed by the gating-descriptors change (cache-resurrection regression tests); deltas synced — new fact-disable-controls capability spec, --disable in the CLI option contract, native disable/blocklist keys and FACTS_DISABLE reservation in facts-native-input-surface. - deepen-cli-intake-and-gating-descriptors: deltas synced — option vocabulary drives the parser, fast path consumes engine-resolved planning, list-task shared intake with permissive scan, stable option-error rendering tiers, and the gating descriptor table requirement on fact-disable-controls. Both changes moved to openspec/changes/archive/2026-07-06-*.
TestCoreFactDescriptors_coverEmittedRoots failed on FreeBSD, NetBSD, and OmniOS CI VMs: disksCoreFacts emits zfs.* on ZFS hosts, but the disks descriptor listed only disks/mountpoints/partitions/zpool. Beyond the test, the gap was a live gating bug on ZFS hosts: disabling every listed root would wrongly gate the resolver and drop zfs facts with it. ZFS-less local hosts could not catch this — the coverage test asserts against the live host by design.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements and archives OpenSpec change
deepen-cli-intake-and-gating-descriptors(and archives its prerequisiteadd-fact-disable-controls, closing its deferred cache regression task).Two vocabularies that had to agree by convention now have single sources of truth, and the CLI stops mirroring engine planning:
internal/engine/descriptors.go): one row per core fact category (root, Facter-compat group, gating class, emitted roots, probe consumers, emits-under) now drivesbuildCoreFactsgating,BuiltinFactGroups(a projection), and one shared fact-hierarchy helper replacing four independent ancestor/descendant walks. Agreement is enforced by test.internal/app/options.go):runQuery's 28 hand flag declarations replaced by a FlagSet derived from thecliregistry (with a registry↔parser parity test); the hand-rolled arg walkers are gone — list tasks use a registry-driven whole-tail scanner preserving the historical permissive semantics.--list-*-groupsconsume the engine's resolved external-dir planning instead of re-deriving it.Verification
core_gating_test.golist→table migration). 2382 tests,go vet, acceptance suite green.--disable packagesresolution-gating, list tasks (incl. the new task-flag tolerance), fast-path bytes all pass.OpenSpec
openspec/changes/archive/2026-07-06-add-fact-disable-controls/— archived; deltas synced (newfact-disable-controlscapability spec,--disableoption contract, native input keys).openspec/changes/archive/2026-07-06-deepen-cli-intake-and-gating-descriptors/— archived; deltas synced (vocabulary-drives-parser, fast-path planning seam, list-task shared intake, error-rendering tiers, descriptor-table requirement).openspec validate --strictpassed pre-archive.