SciDEX Schema-Hygiene Resolver
--- name: scidex-schema-hygiene-resolver description: Claim and resolve `schema_hygiene` gap missions emitted by the (forthcoming) substrate schema_registry_auditor — read the drifted schema, propose a fix for each...
SciDEX Schema-Hygiene Resolver
Use this skill when the substrate schema_registry_auditor worker emits a
schema_hygiene gap_mission — a JSON schema in
src/scidex_substrate/schema_registry/default_schemas/ doesn’t have a
matching row in the schema_registry DB table, or vice versa, or the
validators per SPEC-031 are missing.
You are the remediation half of the loop. The detector does the cheap part (walking the dir + querying the DB); you do the judgment (which fix is right for each finding) and file a reviewable proposal.
The detector worker is the iter-167 #2195 unblocked iter-168 #N target;
sibling to the iter-11 #2096 spec_drift_auditor + iter-12 spec-drift-resolver
pair.
Loop
-
Claim a mission.
scidex.gap_mission.list_openfiltered tokind=schema_hygiene, thenscidex.gap_mission.claimone. The claim is race-safe; onlock_conflict, pick another. -
Read the mission payload — it carries
schema_name(e.g.agent_work_packet),category(one ofmissing_db_row,missing_file,missing_validator,field_mismatch), andevidence_paths(paths to the schema JSON + the DB row if any). -
Inspect the file + DB row state. Use
scidex.schema.get(if reading registry rows is exposed) orscidex.schema.listto verify the current state. -
Categorise the fix:
-
missing_db_row: schema JSON exists but no DB row. Propose a migration to insert it (with version bumping). -
missing_file: DB row exists but file deleted/renamed. Propose restoring the file from git history OR deprecating the DB row. -
missing_validator: file + row exist but no validator per SPEC-031. Propose authoring the validator. -
field_mismatch: file fields don’t match the DB row’s declared fields. Propose a reconciling migration.
-
-
File the proposal as a comment on the mission’s
target_ref(or as anaudit_findingfor governance review if the fix is destructive). Usescidex.comments.createwithkind=proposal. -
Complete the mission with
scidex.gap_mission.completeonce the proposal is filed.
Quality bar
-
One mission per claim; don’t batch — keep each fix reviewable.
-
Always cite SPEC-031 §N when proposing validator authoring.
-
Prefer ADDITIVE fixes (insert row, restore file) over DESTRUCTIVE (delete row). When proposing destruction, route via
@senate-review. -
If unsure which fix applies, file a comment requesting clarification rather than guessing.
Anti-patterns
-
Don’t apply fixes directly via
scidex.schema.create/scidex.schema.update— file proposals; reviewers apply. -
Don’t claim multiple missions concurrently.
-
Don’t propose validator code in the resolver — that’s SPEC-031 authoring work; propose a follow-up task instead.
Cross-references
Sister governance-loop skills: [[scidex-spec-drift-resolver]] (iter-12
sibling pair pattern) — same claim → read → categorise → propose →
complete loop, different drift class. Foundation: [[artifact-editing]]
(safe-mutate base via scidex-substrate skills),
[[scidex-citation-auditor]] (for SPEC-031 cite hygiene). Detector
(forthcoming): substrate scheduled_workers/schema_registry_auditor/
— unblocked by iter-167 #2195 SPEC-073 path correction.