Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion references/assets/orchestration/contract/task-v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ The front-matter `truth_basis` is mandatory and uses the same five fields as the

## Source references

List stable source IDs and their task-local effect. Do not duplicate full specification prose.
List stable source IDs and their task-local effect. Do not duplicate full specification prose. Source IDs are authoritative specification IDs only. Do not cite `EXC-*` excellence proposal IDs; rejected, deferred, and not-material proposals stay out of executor briefs.

| ID | Source path | Task-local effect |
| --- | --- | --- |
Expand Down
6 changes: 6 additions & 0 deletions references/evals/orchestration/evals.json
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,12 @@
"prompt": "A completed executor result reports a green command but omits allocated INV/VAL identities, or reports incapable, contradictory, stale, wrong-boundary, failed, or unexecuted evidence.",
"expected_output": "Blocks terminal closure, treats executor closure as corroboration rather than harness proof, and routes repair to the first owning task, plan, or specification while preserving optional task review and WOR-59 G9 separation.",
"files": []
},
{
"id": 93,
"prompt": "A planner allocates source_ids: [EXC-001] for a deferred excellence proposal while compiling an implementation plan.",
"expected_output": "Rejects EXC-* proposal IDs as non-authoritative; planning and the compiled brief use only the stable requirement, constraint, interface, acceptance-criterion, or validation-target IDs that an accepted proposal projected to.",
"files": []
}
],
"v4_evals": [
Expand Down
8 changes: 7 additions & 1 deletion scripts/orchestration/doctor.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,13 @@ def cmd_doctor(args: argparse.Namespace) -> None:
(
skill_root / "orch-create-implementation-plan" / "SKILL.md",
"orch-create-implementation-plan skill",
["source-ID coverage", "dev-semantic-convergence", "context_mode: compiled-brief"],
[
"source-ID coverage",
"dev-semantic-convergence",
"context_mode: compiled-brief",
"EXC-*",
"executor briefs",
],
),
(
skill_root / "orch-execute-plan" / "SKILL.md",
Expand Down
12 changes: 11 additions & 1 deletion scripts/orchestration/execution_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

SOURCE_ID_RE = re.compile(r"^[A-Z][A-Z0-9_-]*-\d+$")
AUTH_ALIAS_RE = re.compile(r"^AUTH-\d{3}$")
EXCELLENCE_PROPOSAL_RE = re.compile(r"^EXC-\d+$")
SAFE_ID_RE = re.compile(r"^[A-Za-z0-9][A-Za-z0-9._-]*$")
SENSITIVE_KEY_RE = re.compile(
r"(?:^|[_-])(credential_values?|password|passwd|secret|api[_-]?key|access[_-]?token|private[_-]?key)(?:$|[_-])",
Expand Down Expand Up @@ -429,7 +430,7 @@ def _source_records(path: Path, body: str) -> dict[str, str]:
records: dict[str, str] = {}

def add(identifier: str, value: str) -> None:
if AUTH_ALIAS_RE.fullmatch(identifier):
if AUTH_ALIAS_RE.fullmatch(identifier) or EXCELLENCE_PROPOSAL_RE.fullmatch(identifier):
return
value = _strip_markup(value)
if not value:
Expand Down Expand Up @@ -472,8 +473,16 @@ def _assert_no_credential_values(value: Any, context: str = "packet") -> None:
raise SystemExit(f"Blocked credential-like value in {context}")


def _assert_not_excellence_proposal_id(identifier: str, context: str) -> None:
if EXCELLENCE_PROPOSAL_RE.fullmatch(identifier):
raise SystemExit(
f"Non-authoritative source ID {identifier}: excellence proposal IDs are excluded from {context}"
)


def _resolve_reference(value: Any, records: dict[str, str], source_paths: list[Path]) -> Any:
if isinstance(value, str) and SOURCE_ID_RE.fullmatch(value):
_assert_not_excellence_proposal_id(value, "compiled briefs")
if value not in records:
sources = ", ".join(path.as_posix() for path in source_paths)
raise SystemExit(f"Unresolved source ID {value}; searched: {sources}")
Expand Down Expand Up @@ -1798,6 +1807,7 @@ def _compile_task_brief(args: argparse.Namespace) -> tuple[Path, dict[str, Any]]
if not source_ids:
raise SystemExit(f"Task has no source_ids: {task_path}")
for identifier in source_ids:
_assert_not_excellence_proposal_id(identifier, "compiled briefs")
if not SOURCE_ID_RE.fullmatch(identifier) or identifier not in records:
sources = ", ".join(path.as_posix() for path in source_paths)
raise SystemExit(f"Unresolved source ID {identifier}; searched: {sources}")
Expand Down
3 changes: 2 additions & 1 deletion skills/orch-create-implementation-plan/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: 'Create executable WorkBundle plans, phases, and tasks from a verif

## Entry gate

Plan only from a verified active specification with converged semantics, resolved blockers, stable source IDs, explicit knowledge disposition, and coherent repository evidence. Repair missing authority.
Plan only from a verified active specification with converged semantics, resolved blockers, stable source IDs, explicit knowledge disposition, and coherent repository evidence. Repair missing authority. Compile only verified authoritative scope. Do not allocate `EXC-*` proposal IDs or rejected, deferred, or not-material excellence proposals as `source_ids`, task scope, or executor briefs. Accepted excellence work enters planning only through the stable requirement, constraint, interface, acceptance-criterion, or validation-target IDs it projected to.

## Planning workflow

Expand Down Expand Up @@ -75,6 +75,7 @@ Each mapped invariant carries `source_ids`, `boundary`, `oracle`, `capability_re
Use `dev-semantic-convergence` with these lenses:

- source-ID coverage;
- non-authoritative excellence exclusion;
- dependencies, task boundaries, and write scopes;
- validation ownership;
- rule, skill, and methodology allocation;
Expand Down
27 changes: 27 additions & 0 deletions tests/test_orchestration_execution_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,33 @@ def test_build_task_brief_fails_closed_for_missing_source_id_without_reading_kno
assert not (root / ".work-bundle/runtime/execution/plan-001/task-004/task-brief.yaml").exists()


def test_build_task_brief_fails_closed_for_excellence_proposal_source_id(tmp_path: Path) -> None:
root, spec, task = workspace(tmp_path)
spec.write_text(
spec.read_text(encoding="utf-8") + "- **EXC-001**: Deferred visual hierarchy improvement.\n",
encoding="utf-8",
)
task.write_text(task.read_text(encoding="utf-8").replace("TEST-004]", "TEST-004, EXC-001]"), encoding="utf-8")

with pytest.raises(SystemExit, match=r"EXC-001.*excellence proposal"):
build_task_brief(args(root, task))

assert not (root / ".work-bundle/runtime/execution/plan-001/task-004/task-brief.yaml").exists()


def test_build_task_brief_omits_unallocated_excellence_proposal_text(tmp_path: Path) -> None:
root, spec, task = workspace(tmp_path)
spec.write_text(
spec.read_text(encoding="utf-8") + "- **EXC-001**: Deferred visual hierarchy improvement.\n",
encoding="utf-8",
)

packet = build_task_brief(args(root, task)).read_text(encoding="utf-8")

assert "EXC-001" not in packet
assert "Deferred visual hierarchy" not in packet


def test_build_task_brief_reads_current_task_contract_sections(tmp_path: Path) -> None:
root, _, task = workspace(tmp_path)
content = task.read_text(encoding="utf-8")
Expand Down
3 changes: 3 additions & 0 deletions tests/test_orchestration_skill_rule_boundary.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ def test_planner_allocates_methodology_capability_and_bounded_context() -> None:
"earliest ordinary task",
"cheaply falsify",
"Do not add a risk score",
"EXC-",
"deferred",
"executor briefs",
]:
assert token in text

Expand Down
6 changes: 6 additions & 0 deletions tests/test_orchestration_workflow_contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,15 @@ def test_specification_contract_requires_bounded_excellence_applicability() -> N
assert "measurable quality target" in text
assert "further exploration could change none of those surfaces" in text
assert "excellence-applicability view" in skill
plan_skill = read("skills/orch-create-implementation-plan/SKILL.md")
assert "EXC-*" in plan_skill or "EXC-" in plan_skill
assert "deferred" in plan_skill and "executor briefs" in plan_skill
assert "user-visible request with no evidenced adjacent improvement" in evals
assert "silently implements a deferred proposal" in evals
assert "accepted proposal" in evals and "stable authoritative" in evals
assert "universal product-quality checklist" in evals
assert "related-but-non-material adjacent idea" in evals
assert "source_ids: [EXC-001]" in evals


def test_planning_contract_allocates_evidence_capability() -> None:
Expand Down Expand Up @@ -799,6 +803,8 @@ def test_task_contract_compiles_methodology_capability_and_review() -> None:
"verdict: pending",
"Fresh task validation evidence exists",
"acceptance_review.verdict",
"EXC-*",
"executor briefs",
]:
assert token in contract

Expand Down