Skip to content

feat(B.5): política verificable por perfil (FAST/STANDARD/ADVANCED/SAFE/RESEARCH_MAX/ROP) - #5

Merged
klssxx merged 1 commit into
mainfrom
feat/b5-profile-policy
Sep 25, 2026
Merged

klssxx merged 1 commit into
mainfrom
feat/b5-profile-policy

Conversation

@klssxx

@klssxx klssxx commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Eje B — B.5

src/profile_policy.py: cada perfil lleva un contrato de producto verificable, no solo formato. evaluate_profile_policy() -> PolicyCheck (violations / open_questions / notes), 100% determinista.

Perfil Contrato testeado
FAST normaliza restricciones, genera cero preguntas nuevas
STANDARD reporta ambigüedades sin resolverlas ni soltarlas
ADVANCED exige goal + entradas + salida + criterios de aceptación; faltantes = violaciones. Los fallbacks del extractor (answer_user_request/direct_answer) cuentan como no-declarados — un input esquivo ya no valida con requisitos inventados (hallazgo B.1.4)
SAFE cada restricción crítica ausente → pregunta abierta al usuario; nunca se inventa en constraints
RESEARCH_MAX separación hechos/hipótesis/incertidumbre verificada contra las capas B.4
ROP scaffolding (entorno/archivos/plan pruebas/rollback) como propuesta; una fuga simulada a requisitos se detecta

Integración aditiva

policy_check en ambos entry points. Test clave: el mismo input produce veredictos distintos por perfil (FAST pasa input esquivo, ADVANCED lo rechaza).

18 tests nuevos. Suite: 268 passed + 10 subtests, ruff limpio.

… formatting

B.5: each profile now carries an enforced, unit-tested contract
(src/profile_policy.py, evaluate_profile_policy -> PolicyCheck with
violations / open_questions / notes):

- FAST: normalises constraints, generates ZERO new questions (its
  open_questions is empty by definition) — pinned
- STANDARD: passes input ambiguities through as reported questions,
  never drops or silently resolves them
- ADVANCED: REQUIRES goal + inputs + output + acceptance criteria;
  missing ones produce violations. Extractor fallbacks
  (answer_user_request / direct_answer) are recognised as SYSTEM
  inventions and do NOT count as user declarations — B.1.4's 'never
  invent requirements' made enforceable
- SAFE: every missing critical safety constraint becomes an explicit
  open question to the user; nothing is ever added to constraints
- RESEARCH_MAX: facts / hypotheses / uncertainty three-way separation
  verified against the B.4 layers (or template outputs without them)
- ROP: scaffolding must live in proposals; a simulated leak of proposal
  content into user requirements is flagged
  (ROP_SCAFFOLD_CROSSED_TO_REQUIREMENTS)

Integration (additive): policy_check in both compile_prompt and
compile_for_gui results; test asserts the SAME input yields DIFFERENT
verdicts per profile (FAST passes sparse input, ADVANCED fails it).

Hallazgo del camino: el extractor rellena tasks/output con fallbacks
canónicos cuando no detecta nada; antes de este cambio un input esquivo
pasaba la validación ADVANCED con requisitos inventados. Suite:
268 passed + 10 subtests.
@klssxx
klssxx merged commit 65b9dde into main Sep 25, 2026
1 check 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