feat(redact-text): declare config_schema and consume typed __config (template for #147) - #149
Draft
JordanTheJet wants to merge 1 commit into
Draft
feat(redact-text): declare config_schema and consume typed __config (template for #147)#149JordanTheJet wants to merge 1 commit into
JordanTheJet wants to merge 1 commit into
Conversation
Adds the closed Draft 2020-12 config_schema (replacement string with minLength, redact_emails boolean, patterns string array) and migrates the guest off the string-map contract: RedactConfig derives Deserialize with serde defaults, from_json replaces from_section, and a malformed object reports a pre-sanitized error instead of echoing config values, which are the very strings this plugin exists to scrub. Version 0.3.0 across manifest, Cargo.toml, and Cargo.lock; README moves to the JSON-array operator encoding and the instance-key flow. The old contract is a hard break, not a degradation: with __config typed, a HashMap-based ExecuteArgs fails the entire argument parse and every call returns invalid arguments.
Open
31 tasks
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
Template migration for #147: the canonical reference plugin (redact-text) gains its
config_schemaand consumes typed__config, ahead of the host enforcement landing in zeroclaw-labs/zeroclaw#9126. The other 30 packages should copy this PR's shape.replacementstringminLength=1,redact_emailsboolean,patternsarray of non-empty strings),additionalProperties = false. Validated against the real host validator (validate_manifest_config/resolve_plugin_configfrom the zeroclaw#9126 head) with per-constraint rejection probes and a withheld-grant{}acceptance check; an un-migrated manifest fails the same harness, so the check is not vacuous.__configtyped, the oldHashMap<String, String>field fails the entireExecuteArgsparse and every call returns "invalid arguments".RedactConfignow derivesDeserializewith serde defaults;from_jsonreplacesfrom_section; JSON null (host injected nothing) yields defaults; malformed config errors, never silently defaults.from_jsonreturns a pre-sanitized error string becauseserde_json::Error'sDisplayquotes the offending value, and this plugin'spatternsare exactly the strings an operator wants scrubbed. Mutation-checked: the naive version leaks the value verbatim into theToolResult.manifest.toml,Cargo.toml,Cargo.lock— CI runs--locked).registry.jsonuntouched;build-registry.py --check-metadataclassifies the new version aspending unpublished source, and release CI publishes it.patternsdocumentation to the JSON-array encoding and instance-key flow.Checks
Mutation evidence: six guards disabled individually, each failing exactly its covering test (including the leak guard and the empty-pattern filter, whose removal rewrites entire inputs into replacement markers); all files restored byte-identical.
Template notes for the remaining 30 (also posted to #147)
HashMap<String, String>,eq_ignore_ascii_case,.split(',').requiredper key deliberately: credential-bearing channel plugins should fail closed, unlike this one.deny_unknown_fieldsguest-side.