Feat/string keyed harness#143
Merged
Merged
Conversation
…zation The stock serde impl for Option<Option<T>> collapses an explicit JSON null to the outer None, so parsing conditions.json and re-serializing it dropped the staged_skill_slug key — the documented tri-state (absent / null / slug) did not survive a round-trip. A present-key deserializer keeps null as Some(None). Behavior-neutral for consumers: the only reader flattens both states to None. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Fixture conditions.json artifacts captured from the current binary (one per harness, plus a no-harness variant) with byte-identical round-trip tests, and CLI tests pinning the unknown---harness error text and the possible values in run --help. Green before and after #135's registry-keyed harness identifier lands; guards its serde- and CLI-compat acceptance criteria. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The registry becomes a Vec of (label, adapter) entries keyed by each loaded descriptor's own label instead of a three-field struct built positionally from EMBEDDED_DESCRIPTORS. This dissolves the positional index coupling and the label-to-variant lockstep assertion (the label is the identity now); duplicate labels panic at build. adapter_for bridges the enum to a label lookup via its serde form until #135's string-keyed identifier replaces the enum outright; the config-dir and tool-vocabulary unions iterate registry entries directly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Harness is no longer a closed enum deriving clap::ValueEnum and serde: it becomes a Copy handle to a descriptor-registry entry, constructible only through Harness::resolve, so adapter lookup stays infallible and pass-through call sites keep their signatures. Resolution, iteration (Harness::known), the registry-level default (claude-code), artifact Deserialize, and the registry-driven --harness value parser live next to the registry; the parser keeps clap's [possible values] help, suggestions, and error text without a compile-time harness set. Guard teardown and the armed check discover skills dirs through the registry; the manifest-based restore and no-manifest stray-marker sweep are unchanged and now pinned by a sweep test. conditions.json keeps the exact kebab-case strings (fixture round-trip tests from the previous commit stay green); unknown names now fail with the known-harness list wherever they surface. Closes #135. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The registry and harness-identifier resolution (entries, build, resolve/ known/Default/Deserialize, the --harness value parser, adapter_for, the config-dir and tool-vocabulary unions) move from harness.rs into a new adapters::registry module with their tests. harness.rs had grown two jobs past readable size; it keeps only the HarnessAdapter trait surface. The adapters::* re-exports are unchanged, and #136's registry construction now has a dedicated home. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Closes #135