Skip to content

P7b: from LLM patch to Candidate State (validator, scope, LLMEvaluationRequest, P7 gate map) - #29

Merged
Ayushxsingh100 merged 4 commits into
mainfrom
feature/p7b
Nov 12, 2026
Merged

Ayushxsingh100 merged 4 commits into
mainfrom
feature/p7b

Conversation

@Ayushxsingh100

Copy link
Copy Markdown
Owner

P7b — from LLM patch to Candidate State

Branch feature/p7b, created from origin/main at 7ea06b0. Finishing P7b closes P7 and milestone M4, but no gate, mini-gate or milestone is claimed; the external review decides (C-28). Do not merge before the verdict.

Decisions

  • C-183, C-184, C-185, C-186 and C-187: Decided (authors, 12 Nov 2026). C-187 carries the note that its reading (3) is replaced by P7b-2.
  • C-188, the meaning of an LLM patch: Decided (authors, 12 Nov 2026). It closes C-174 for LLM candidates.
  • C-189 to C-193 (P7b-1 to P7b-5): Proposed (P7b).
  • C-194: Decided (user, 12 Nov 2026). llm.api_key_ref stays in the config schema because about ten secret-machinery tests depend on it.
  • C-195, the readings I made while building: Proposed (P7b).
  • CLAUDE.md no longer allows Pydantic in llm/.

What exists

  • Validator (llm/validation/patch.py, dail-patch-validator-1): runs the checks in the order of Doc 10 §13, as Section 4 of the work package lists them, with failure classes per C-192.
  • Candidate build: in a fresh directory under the caller's work root. The parent directory is never written.
  • Scope check (core/domain/change_scope.py): AllowedChangeScope, plus the operation check, which runs after DAIL's own identity engine.
  • Entry path: LLMEvaluationRequest, a subclass of EvaluationRequest bound to the built directory by its tree hash. It goes through the same orchestrator, so promotion stays the only route to a new Trusted State.
  • Versions: parser dail-llm-parser-2; prompt dail-repair-prompt-2, with version 1 still reproducible.

Wiring check (one run, local CPU)

  • Model: qwen2.5-coder:1.5b, digest d7372fd8…a0668, the same as in P7a.
  • Result: the reply was a PATCH, passed validation and was built into a candidate; DAIL decided REJECT.
  • One attempt, 23.0 s. The Trusted State was unchanged.

Checks (Python 3.12.10)

  • dev.py test: 4292 tests OK, 3 skipped (2 opt-in Ollama tests and the symbolic-link test).
  • pytest: exit 0.
  • dev.py lint: black, ruff and mypy clean.
  • Mutation checks: 12 of 12 killed.
  • No new dependency. The default suite opens no network connection.

The P7 gate map in docs/PHASE_GATES.md maps each Doc 15 §14.2 item and each M4 item to named tests.

Review verdict: (link to be added)

🤖 Generated with Claude Code

Ayushxsingh100 and others added 4 commits November 12, 2026 10:25
…, C-189 to C-193 Proposed, C-194 (api_key_ref kept); CLAUDE.md drops the Pydantic allowance (Doc 10 §12-§15; C-174, C-183)

C-194: the user decided to keep llm.api_key_ref, because it is the only
secret-reference key and about ten config tests exercise the secret machinery
through it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…est; scope and operation check; parser 2, prompt 2 (Doc 10 §12-§15, §22, §27, §35, §38-§40; Doc 03 §4.5-§4.7; C-188 to C-193)

llm/validation/patch.py runs the §13 checks in order (syntax, top-level
blocks, forbidden constructs, boundaries, scope, credentials, invented ids,
build in a fresh directory, references, normalize, identity with the
operation check). The parent directory is never written. AllowedChangeScope
and operation_breaches live in core.domain.change_scope. LLMEvaluationRequest
binds a built directory to its patch by tree hash. The parser keeps only the
format checks (dail-llm-parser-2). The prompt is dail-repair-prompt-2; v1 stays
reproducible.

P7a tests whose expectations C-190 and C-193 supersede are updated with notes:
the scope check moved from the parser to the validator, a stub validator keeps
all eight failure classes in the mapping test, the prompt version is now 2, and
the context takes the caller's scope.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ports (mutation V9 survived otherwise) (Doc 10 §13 step 7; C-192)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e P7 gate map in PHASE_GATES; BUILD_SEQUENCE (Doc 15 §14.2, §24; C-188 to C-195)

Wiring check with the local model (qwen2.5-coder:1.5b, the P7a digest):
PATCH, validated, built, DAIL decision REJECT, 1 attempt, 23.0 s; Trusted
State unchanged. Every §14.2 and M4 item maps to named tests; no gate is
marked passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Ayushxsingh100
Ayushxsingh100 merged commit 63ac3d2 into main Nov 12, 2026
3 checks passed
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