Skip to content

feat(guard-liveness): v3 manual-rule SP-prober (reduced) — pressure-scenario schema + prober + 5 migrations - #472

Closed
artyhoo wants to merge 5 commits into
stagingfrom
feat/guard-liveness-v3-manual-sp
Closed

feat(guard-liveness): v3 manual-rule SP-prober (reduced) — pressure-scenario schema + prober + 5 migrations#472
artyhoo wants to merge 5 commits into
stagingfrom
feat/guard-liveness-v3-manual-sp

Conversation

@artyhoo

@artyhoo artyhoo commented Jun 13, 2026

Copy link
Copy Markdown
Owner

guard-liveness v3 — manual-rule SP-prober (reduced scope)

Closes the manual half of the guard-liveness umbrella (sibling of v1 ESLint #460, SSOT #114). check.type === 'manual' rules (5 of 26) have no executable input — they are judgement-based, so the ESLint negative-test roundtrip cannot reach them. This wave gives each manual rule an entry-level pressure-scenario and ships an AI-agnostic, session-bound prober that runs it RED→GREEN (baseline-vs-with-rule), dogfooding Superpowers' writing-skills pattern with zero npm dependency (substrate-pure).

What ships (reduced scope per dispatch §A)

# Item File
1 Entry-level pressure-scenario schema (sibling to check/negative-test; manual check branch untouched) packages/core/manifest/rules-manifest.schema.json:81
2 ManifestPressureScenario / PressureType TS types packages/core/hooks/checks/guard-liveness.ts:97
3 Session-bound AI-agnostic prober (two-subagent RED→GREEN, never CI) agents/manual-rule-liveness-prober.md
4 Principle 02 manual arm — structural gate over all 5 (NOT principle 15) packages/core/principles/02-paired-negative-test.test.ts:255
5 All 5 manual rules migrated (R10/R13/R18/IR5/IR6) packages/core/manifest/rules-manifest.json
6 Agent registered in principle 09 REQUIRED_HEADER_DOCS + install.sh SHIPPED_DOCS (17→18) packages/core/principles/09-doc-authority-hierarchy.ts:110
7 SSOT #115 (BUILD verdict + search evidence) docs/meta-factory/prior-art-evaluations.md

§B research (mandatory before code)

  • SP-claim re-verified against installed v5.1.0 (f2cbfbe). Problem-class match (T16): SP writing-skills proves a skill teaches (SKILL.md:16,36-37); we prove a manifest rule is live — same mechanism (baseline-fail → with-doc-comply), different artifact. SP's own guidance reinforces the fit: «Mechanical constraints… automate it — save documentation for judgment calls» (SKILL.md:59) — manual rules ARE the judgment calls.
  • Search-coverage (≥3 WebSearch phrasings + DeepWiki on obra/superpowers + Aider-AI/aider): BUILD confirmed, no ADOPT-flip. SP ships the RED-GREEN methodology as an authoring skill, not a reusable per-manifest-rule prober; aider's conventions.md only demonstrates with/without ablation. Research-grade ablation (arxiv:2506.02357 "Principle ON/OFF", PrivaCI-Bench, ETH "Evaluating AGENTS.md") = REFERENCE — none is a drop-in. Recorded as SSOT chore(pre-push): flip §1.7 + prior-art substance arms warn-only → blocking #115.
  • Channel (judgement → injection, not gate): the prober is session-bound; the mechanically-detectable half (scenario is well-formed) is the principle-02 gate. Not rammed into pre-push (#gate-where-judgment-needed avoided).

RED→GREEN demo (live, T2 — actually run, not "would detect")

Ran the prober protocol against the 3 code-grep manual rules via fresh baseline-vs-with-rule subagents:

Rule RED (baseline, rule absent) GREEN (rule loaded) Delta
R13 Data fetching useEffect(() => fetch('/api/orders')) in a Client Component useQuery + OrdersResponseSchema.parse() wrapper RED→GREEN ✅ LIVE
R18 TanStack Query consumes untyped useQuery data as-is (no .parse) adds OrderSchema.parse() in queryFn + staleTime/gcTime RED→GREEN ✅ LIVE
R10 Naming appends formatDate to grab-bag src/utils.ts still appends to src/utils.ts (2 independent runs), rationalizing via the camelCase clause RED→RED — rule-text loophole surfaced

R10's RED→RED is an honest, valuable prober result — the designed third outcome: the loaded R10 policy did not out-argue the sunk-cost of the existing utils.ts; the "files match exported symbol" clause is drowned in a multi-clause policy. Per T-V3-B this is not "R10 is dead" — it is a REFACTOR signal for the R10 rule author (surfaced as a follow-up, not silently hidden). The demo also drove a REFACTOR of the R10/R13 baselines themselves (they first over-constrained the answer by hard-instructing the violating construct) — dogfooding SP's own RED-GREEN-REFACTOR cycle on this PR.

IR5 / IR6 are structurally validated by the principle-02 manual arm (a real forcing-function scenario exists) but their behavioral RED→GREEN is demo-deferred: their observable-failure is runtime-shaped (dropped trace context / no circuit breaker, rules-manifest.json) and a text-only baseline subagent cannot exhibit it. Not faked.

Discipline (§C)

§1.7 self-reflexive checks

§1.7 Forward-check applied

The recommendation complies with all active disciplines. no-paid-llm-in-ci.md §1: the prober is session-bound and explicitly never-CI; the only mechanical gate is the deterministic principle-02 structural assertion + AJV schema (packages/core/manifest/rules-manifest.schema.json:81) — zero API-billed call. build-first-reuse-default.md §1: the RED-GREEN methodology is ADOPTED from Superpowers #55 (zero dependency, substrate-pure); the BUILD is only the prober + schema wiring, justified by the §B search-coverage showing no drop-in per-manifest-rule prober. doc-authority-hierarchy.md §2-§3: the new agent carries a Class + Authoritative-for header (agents/manual-rule-liveness-prober.md:12) and is registered in principle 09. rule-enforcement-channel-selection.md §1: correct two-axis split — judgement → injection (the session-read prober), mechanically-detectable well-formedness → gate (the principle-02 manual arm).

§1.7 Backward-check applied

Complete sweep, not a sample: the new pressure-scenario discipline is applied to all 5 manual rules in the manifest (R10/R13/R18/IR5/IR6), enforced by the principle-02 manual arm whose manualCount >= 5 population sentinel (packages/core/principles/02-paired-negative-test.test.ts:534) guards against a vacuous pass. No other artefact was silently changed — the diff is exactly the 9 named files. Drive-by bans observed: v1's negative-test placement was not refactored to "harmonize"; principle 15 (SKILL.md-scoped) was not touched (git diff --name-only confirms 0 changes to 15-*).

Verification

  • npm --prefix packages/core run typecheck → exit 0
  • npm --prefix packages/core run render-rules:check → AJV accepts widened schema (live-rejects bad input — verified by cold-review)
  • principle 02 (17✓) / 05 / 09 (drift 17→18) / 15 (untouched) green; full suite 175✓ (the 1 failure is principle 12 over local gitignored .claude/orchestrator-prompts/*/kickoff.md — pre-existing/environmental, absent on CI's clean checkout, not in this diff)
  • Two cold reviewers (spec + code-quality, Opus) → GO; falsification path verified real (AJV live-rejects, mutations produce genuine violations)

DEFER (follow-ups — not built, per §A)

  • Session-trigger convention: /guard-liveness-probe slash-command vs /aif-verify fold
  • N5 give-back contribution to Superpowers
  • INSTALL-FOR-AI.md probe-surface documentation
  • IR5/IR6 behavioral RED→GREEN (needs the runtime-probe sub-wave)
  • R10 rule-text REFACTOR (the prober surfaced a loophole — "files match exported symbol" clause)

🤖 Generated with Claude Code

artyhoo added 5 commits June 13, 2026 13:40
… for manual rules (v3)

Adds an entry-level `pressure-scenario` object (sibling to check/negative-test)
to the rules-manifest schema + ManifestPressureScenario/PressureType to
guard-liveness.ts. The manual `check` branch is left untouched
(additionalProperties:false). This is the manual-rule analog of negative-test:
liveness data for judgement rules that have no executable ESLint input.
…10/R13/R18/IR5/IR6)

Each LOAD-BEARING manual rule (per v0 audit) gets a real forcing-function
pressure-scenario (T-V3-A): baseline-prompt applying >=1 pressure
(time/authority/sunk-cost/scope-creep), observable-failure (RED) and
observable-compliance (GREEN) that differ. No placeholders.
…rio liveness (v3)

Parallel to the ESLint liveness arm: for every check.type==='manual' rule assert
the pressure-scenario is a real forcing function (non-empty baseline/RED/GREEN,
RED!=GREEN, >=1 declared pressure). Population sentinel guards >=5 manual rules.
Paired-negative mutation tests prove the assertion FAILS on missing/tautological/
pressure-less scenarios. Principle 15 untouched (SKILL.md-scoped).
… header enforcement (v3)

Ships the session-bound AI-agnostic prober that runs a manual rule's
pressure-scenario baseline-vs-with-rule (RED→GREEN) and reports the delta —
the behavioral half whose mechanical companion is the principle-02 manual arm.
Registers the agent in principle 09 REQUIRED_HEADER_DOCS + install.sh
SHIPPED_DOCS (17→18) so its doc-authority header is enforced consistently
with the other 4 shipped agents (recursive self-application). Adds SSOT #115
recording the BUILD verdict + search evidence.

Methodology ADOPTED from Superpowers writing-skills (RED-GREEN-REFACTOR pressure
scenarios); zero npm dep added (substrate-pure). Session-bound, never CI
(no-paid-llm-in-ci §1). N5 give-back candidate (contribution itself deferred).

Prior-art: prior-art-evaluations.md#55 (Superpowers writing-skills RED-GREEN-REFACTOR — ADOPT-methodology: SP proves a skill teaches, we prove a manifest rule is live; same mechanism, different artifact).
Prior-art: prior-art-evaluations.md#64 (Superpowers subagent-driven-development — REFERENCE: two-subagent dispatch shape the prober mirrors).
Prior-art: prior-art-evaluations.md#115 (manual-rule liveness prober — BUILD verdict; DeepWiki obra/superpowers + Aider-AI/aider re-probe + WebSearch >=3 phrasings confirmed no drop-in per-manifest-rule prober; substrate-pure, zero Superpowers dep).
… + R18 pressure types (demo REFACTOR)

The live RED→GREEN demo (SP RED-GREEN-REFACTOR, dogfooded on this PR) showed
R10/R13's first-draft baselines hard-instructed the violating construct
("append to utils.ts", "a useEffect with fetch is simplest") — over-constraining
the answer so even the with-rule run could not flip. Softened both to
pressure-driven framing (the shortcut stays tempting via time/sunk-cost/
scope-creep, but is no longer an explicit instruction). R18 pressure corrected
time→scope-creep to match the baseline's actual cues (cold-review MINOR).

After refactor: R13 + R18 show clean RED→GREEN; R10 shows RED→RED across 2
independent with-rule runs (rule-text loophole — surfaced, not hidden).
@artyhoo
artyhoo marked this pull request as draft June 13, 2026 11:03
@artyhoo

artyhoo commented Jun 13, 2026

Copy link
Copy Markdown
Owner Author

⚠️ Held as draft — collides with merged #463 (Stage 2a prelude)

This PR was authored off a stale base (dd571dea); the proxy tunnel blocked git fetch, hiding that #463 ("Stage 2a prelude — pressure-scenario schema/types/principle") had already merged to staging. #463 is explicitly the prelude for v3 — its schema says "Presence is optional; v3 flips to required for manual rules after migration." It pre-shipped the pressure-scenario schema (3 sub-fields, no pressure), synthesizer/types.ts types, and a presence-optional assertPressureScenarioLiveness well-formedness check — deliberately leaving the migrations, required-gate, and prober for v3.

This PR instead re-implemented that skeleton (schema in-place, types in guard-liveness.ts not synthesizer/types.ts, redefined the same principle fn) and diverged by adding a pressure field per dispatch T-V3-A. Hence CONFLICTING + partially duplicative.

Recommended resolution (Option A): rebase v3 onto current staging; keep #463's schema/types/principle as the base; extend #463's schema to add the pressure field (T-V3-A) + flip pressure-scenario to required-for-manual; layer v3's unique, non-duplicative parts on top — the 5 manual-rule migrations, the prober agent (agents/manual-rule-liveness-prober.md), SSOT #115, and the principle-09 header enforcement. The RED→GREEN demo (R13/R18 LIVE, R10 RED→RED loophole) and the §B research stand regardless.

Blocker: a clean rebase needs git fetch of post-#463 staging to rebase and run the suite against the merged state — currently tunnel-blocked (only the gh API reaches GitHub). Held as draft pending maintainer direction.

artyhoo added a commit that referenced this pull request Jun 13, 2026
…) — rebased onto post-v1.5 staging

Consolidates this branch + #472 + #473 into one; rebased onto staging after v1.5 (#475) merged concurrently (fixture arm + pressure-scenario arm now coexist). ADAPT of Superpowers writing-skills RED→GREEN. Extends #463: pressure-type field, principle-02 flip-to-REQUIRED for manual rules + manualCount>=5 sentinel, 5 migrations (R10/R13/R18/IR5/IR6), agents/manual-rule-liveness-prober.md (never CI), SSOT #115.

Prior-art: prior-art-evaluations.md#115 (manual-rule liveness prober — ADAPT of Superpowers writing-skills RED→GREEN).
Prior-art: prior-art-evaluations.md#55 (Superpowers TDD-for-Skills, ADAPT — same mechanism, different artifact).
Prior-art: prior-art-evaluations.md#64 (Superpowers subagent-driven-development fresh-subagent-per-pass).
artyhoo added a commit that referenced this pull request Jun 13, 2026
…) — rebased onto post-v1.5 staging (#476)

Consolidates this branch + #472 + #473 into one; rebased onto staging after v1.5 (#475) merged concurrently (fixture arm + pressure-scenario arm now coexist). ADAPT of Superpowers writing-skills RED→GREEN. Extends #463: pressure-type field, principle-02 flip-to-REQUIRED for manual rules + manualCount>=5 sentinel, 5 migrations (R10/R13/R18/IR5/IR6), agents/manual-rule-liveness-prober.md (never CI), SSOT #115.

Prior-art: prior-art-evaluations.md#115 (manual-rule liveness prober — ADAPT of Superpowers writing-skills RED→GREEN).
Prior-art: prior-art-evaluations.md#55 (Superpowers TDD-for-Skills, ADAPT — same mechanism, different artifact).
Prior-art: prior-art-evaluations.md#64 (Superpowers subagent-driven-development fresh-subagent-per-pass).
@artyhoo

artyhoo commented Jun 13, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #476 (merged to staging as 9d72647). This branch was on a stale pre-#463 base (CONFLICTING — duplicate pressure-scenario schema + a parallel ManifestPressureScenario type). Its valuable R10 RED→RED finding (rule-text loophole under multi-run sunk-cost) is carried forward as the R10-rule-text-refactor follow-up noted in #476. Closing as the single consolidated solution.

@artyhoo artyhoo closed this Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant