okstra 0.229.0 → 0.231.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -5
- package/dist/cli-registry.mjs +0 -18
- package/dist/cli-registry.mjs.map +1 -1
- package/dist/commands/lifecycle/doctor.mjs +0 -15
- package/dist/commands/lifecycle/doctor.mjs.map +1 -1
- package/dist/lib/skill-catalog.mjs +4 -4
- package/dist/lib/skill-catalog.mjs.map +1 -1
- package/docs/architecture/storage-model.md +168 -18
- package/docs/architecture.md +15 -14
- package/docs/coding-rules.md +15 -0
- package/docs/contributor-change-matrix.md +5 -5
- package/docs/project-structure-overview.md +13 -19
- package/package.json +2 -3
- package/runtime/BUILD.json +2 -2
- package/runtime/bin/lib/okstra/interactive.sh +2 -1
- package/runtime/prompts/coding-preflight/clean-code.md +8 -0
- package/runtime/prompts/coding-preflight/overview.md +1 -0
- package/runtime/prompts/launch.template.md +7 -5
- package/runtime/prompts/lead/convergence.md +4 -4
- package/runtime/prompts/lead/okstra-lead-contract.md +19 -18
- package/runtime/prompts/lead/phase-routing.md +1 -1
- package/runtime/prompts/lead/report-writer.md +3 -3
- package/runtime/prompts/lead/team-contract.md +3 -3
- package/runtime/prompts/profiles/_coding-conventions-preflight.md +2 -0
- package/runtime/python/okstra_ctl/agent/invocation.py +190 -9
- package/runtime/python/okstra_ctl/agent/prompt_cli/materialize.py +31 -1
- package/runtime/python/okstra_ctl/blocking_checks.py +10 -0
- package/runtime/python/okstra_ctl/cmux.py +4 -2
- package/runtime/python/okstra_ctl/code_review_census.py +194 -0
- package/runtime/python/okstra_ctl/code_review_coverage.py +3 -1
- package/runtime/python/okstra_ctl/code_review_scope.py +9 -6
- package/runtime/python/okstra_ctl/code_review_target.py +38 -2
- package/runtime/python/okstra_ctl/conformance.py +30 -0
- package/runtime/python/okstra_ctl/conformance_evidence.py +316 -0
- package/runtime/python/okstra_ctl/correction_round.py +19 -13
- package/runtime/python/okstra_ctl/dispatch_core.py +1 -1
- package/runtime/python/okstra_ctl/dispatch_state.py +1 -0
- package/runtime/python/okstra_ctl/execution_mutation_audit.py +13 -1
- package/runtime/python/okstra_ctl/generated_input.py +21 -0
- package/runtime/python/okstra_ctl/ids.py +1 -41
- package/runtime/python/okstra_ctl/incremental_carry.py +7 -4
- package/runtime/python/okstra_ctl/initial_prompt_materialization.py +30 -0
- package/runtime/python/okstra_ctl/interactive_cli.py +5 -0
- package/runtime/python/okstra_ctl/locks.py +28 -1
- package/runtime/python/okstra_ctl/model_io/renderers.py +7 -0
- package/runtime/python/okstra_ctl/paths.py +90 -33
- package/runtime/python/okstra_ctl/phases/catalog.py +3 -0
- package/runtime/python/okstra_ctl/phases/change_impact_analysis/spec.md +2 -2
- package/runtime/python/okstra_ctl/phases/discussion/spec.md +63 -63
- package/runtime/python/okstra_ctl/phases/discussion/wizard.py +2 -11
- package/runtime/python/okstra_ctl/phases/error_analysis/report_assets/error-analysis-input.template.md +1 -1
- package/runtime/python/okstra_ctl/phases/error_analysis/spec.md +2 -2
- package/runtime/python/okstra_ctl/phases/feature_analysis/spec.md +1 -1
- package/runtime/python/okstra_ctl/phases/final_verification/profile.md +5 -4
- package/runtime/python/okstra_ctl/phases/final_verification/report_assets/final-verification-input.template.md +1 -1
- package/runtime/python/okstra_ctl/phases/final_verification/report_assets/final-verification.template.html +8 -0
- package/runtime/python/okstra_ctl/phases/final_verification/spec.md +5 -4
- package/runtime/python/okstra_ctl/phases/final_verification/validation.py +53 -0
- package/runtime/python/okstra_ctl/phases/implementation/host-rules.md +6 -2
- package/runtime/python/okstra_ctl/phases/implementation/instructions/_implementation-deliverable.md +4 -2
- package/runtime/python/okstra_ctl/phases/implementation/instructions/_implementation-executor.md +1 -1
- package/runtime/python/okstra_ctl/phases/implementation/instructions/_implementation-verifier.md +23 -7
- package/runtime/python/okstra_ctl/phases/implementation/report_assets/implementation-input.template.md +1 -1
- package/runtime/python/okstra_ctl/phases/implementation/report_assets/implementation.template.html +1 -1
- package/runtime/python/okstra_ctl/phases/implementation/spec.md +6 -4
- package/runtime/python/okstra_ctl/phases/implementation/validation.py +152 -30
- package/runtime/python/okstra_ctl/phases/implementation_option_selection/spec.md +2 -2
- package/runtime/python/okstra_ctl/phases/implementation_planning/authoring.py +16 -22
- package/runtime/python/okstra_ctl/phases/implementation_planning/instructions/plan-body-verification.md +12 -12
- package/runtime/python/okstra_ctl/phases/implementation_planning/plan_body.py +14 -0
- package/runtime/python/okstra_ctl/phases/implementation_planning/profile.md +4 -4
- package/runtime/python/okstra_ctl/phases/implementation_planning/report_assets/implementation-planning-input.template.md +1 -1
- package/runtime/python/okstra_ctl/phases/implementation_planning/spec.md +1 -1
- package/runtime/python/okstra_ctl/phases/implementation_planning/wizard.py +11 -4
- package/runtime/python/okstra_ctl/phases/project_analysis/spec.md +2 -2
- package/runtime/python/okstra_ctl/phases/release_handoff/entry.py +7 -3
- package/runtime/python/okstra_ctl/phases/release_handoff/operations.py +4 -5
- package/runtime/python/okstra_ctl/phases/release_handoff/profile.md +1 -1
- package/runtime/python/okstra_ctl/phases/release_handoff/report_assets/release-handoff-input.template.md +1 -1
- package/runtime/python/okstra_ctl/phases/release_handoff/spec.md +4 -4
- package/runtime/python/okstra_ctl/phases/technical_verification/spec.md +1 -1
- package/runtime/python/okstra_ctl/plan_items.py +28 -0
- package/runtime/python/okstra_ctl/process_group.py +26 -3
- package/runtime/python/okstra_ctl/qa_commands.py +5 -1
- package/runtime/python/okstra_ctl/recap.py +1 -2
- package/runtime/python/okstra_ctl/render.py +25 -2
- package/runtime/python/okstra_ctl/report_assembly.py +102 -1
- package/runtime/python/okstra_ctl/report_execution_evidence.py +220 -0
- package/runtime/python/okstra_ctl/report_finalize.py +3 -3
- package/runtime/python/okstra_ctl/report_inputs.py +28 -0
- package/runtime/python/okstra_ctl/report_narrative.py +12 -3
- package/runtime/python/okstra_ctl/report_synthesis_packet.py +5 -0
- package/runtime/python/okstra_ctl/run.py +40 -20
- package/runtime/python/okstra_ctl/stage_close.py +52 -6
- package/runtime/python/okstra_ctl/stage_command_commits.py +143 -0
- package/runtime/python/okstra_ctl/stage_fix_carry.py +21 -1
- package/runtime/python/okstra_ctl/stage_integrate.py +90 -25
- package/runtime/python/okstra_ctl/verification_capture.py +291 -0
- package/runtime/python/okstra_ctl/verification_conformance.py +28 -9
- package/runtime/python/okstra_ctl/verification_dispatch.py +136 -0
- package/runtime/python/okstra_ctl/verification_evidence.py +671 -0
- package/runtime/python/okstra_ctl/verification_generation.py +34 -16
- package/runtime/python/okstra_ctl/verification_input_ref.py +9 -0
- package/runtime/python/okstra_ctl/verification_input_types.py +2 -0
- package/runtime/python/okstra_ctl/verification_inputs.py +83 -2
- package/runtime/python/okstra_ctl/verification_invocation.py +140 -0
- package/runtime/python/okstra_ctl/verification_target.py +10 -3
- package/runtime/python/okstra_ctl/wizard/engine.py +23 -0
- package/runtime/python/okstra_ctl/wizard/registry.py +2 -1
- package/runtime/python/okstra_ctl/wizard/render.py +2 -1
- package/runtime/python/okstra_ctl/wizard/sources.py +14 -3
- package/runtime/python/okstra_ctl/wizard/steps_identity.py +2 -1
- package/runtime/python/okstra_ctl/wizard/steps_plan.py +6 -2
- package/runtime/python/okstra_ctl/worker_runner.py +1 -1
- package/runtime/python/okstra_ctl/worktree/git_ops.py +8 -1
- package/runtime/python/okstra_ctl/worktree/rebase.py +5 -2
- package/runtime/python/okstra_ctl/worktree_lock_cli.py +70 -17
- package/runtime/python/okstra_ctl/worktree_registry.py +4 -0
- package/runtime/schemas/final-report-v3.0.schema.json +184 -1
- package/runtime/skills/okstra-code-review/SKILL.md +7 -5
- package/runtime/skills/okstra-code-review/references/census-rules.md +2 -2
- package/runtime/skills/okstra-explain-flow/SKILL.md +1 -1
- package/runtime/skills/okstra-run/SKILL.md +11 -7
- package/runtime/skills/okstra-schedule-gen/SKILL.md +3 -3
- package/runtime/skills/okstra-setup/SKILL.md +2 -3
- package/runtime/templates/reports/html/i18n/en.json +7 -0
- package/runtime/templates/reports/html/i18n/ko.json +7 -0
- package/runtime/validators/validate-run.py +130 -20
- package/runtime/validators/validate-workflow.sh +1 -1
- package/docs/cli.md +0 -1060
- package/docs/container.md +0 -100
- package/docs/follow-ups/2026-07-10-final-report-option-3.md +0 -51
- package/docs/performance-improvement-plan-v2.md +0 -369
- package/runtime/python/okstra_ctl/container.py +0 -702
- package/runtime/python/okstra_ctl/rollup.py +0 -241
- package/runtime/python/okstra_ctl/usage_report.py +0 -362
- package/runtime/skills/okstra-container-build/SKILL.md +0 -139
- package/runtime/skills/okstra-inspect/SKILL.md +0 -100
- package/runtime/skills/okstra-inspect/facets/cost.md +0 -84
- package/runtime/skills/okstra-inspect/facets/error-zip.md +0 -41
- package/runtime/skills/okstra-inspect/facets/errors.md +0 -69
- package/runtime/skills/okstra-inspect/facets/history.md +0 -86
- package/runtime/skills/okstra-inspect/facets/logs.md +0 -89
- package/runtime/skills/okstra-inspect/facets/recap.md +0 -167
- package/runtime/skills/okstra-inspect/facets/report.md +0 -57
- package/runtime/skills/okstra-inspect/facets/run-audit.md +0 -34
- package/runtime/skills/okstra-inspect/facets/status.md +0 -163
- package/runtime/skills/okstra-inspect/facets/time.md +0 -57
- package/runtime/skills/okstra-rollup/SKILL.md +0 -75
- package/runtime/skills/okstra-usage/SKILL.md +0 -71
|
@@ -45,17 +45,19 @@ def _project_script_path(project: Path, task_root: Path, script: str) -> str:
|
|
|
45
45
|
return safe.relative_to(project).as_posix()
|
|
46
46
|
|
|
47
47
|
|
|
48
|
+
def conformance_stage(stage_key: str) -> int:
|
|
49
|
+
match = re.fullmatch(r".+-stage-([1-9][0-9]*)", stage_key)
|
|
50
|
+
if match is None:
|
|
51
|
+
raise ValueError("conformance stageKey must end in -stage-<positive integer>")
|
|
52
|
+
return int(match[1])
|
|
53
|
+
|
|
54
|
+
|
|
48
55
|
def _entries_by_stage(
|
|
49
56
|
manifest: Mapping[str, Any], declared_stages: set[int],
|
|
50
57
|
) -> dict[int, dict[str, Any]]:
|
|
51
58
|
entries = {}
|
|
52
59
|
for entry in manifest["entries"]:
|
|
53
|
-
|
|
54
|
-
if match is None:
|
|
55
|
-
raise ValueError(
|
|
56
|
-
"conformance stageKey must end in -stage-<positive integer>"
|
|
57
|
-
)
|
|
58
|
-
stage = int(match[1])
|
|
60
|
+
stage = conformance_stage(entry["stageKey"])
|
|
59
61
|
if stage in entries:
|
|
60
62
|
raise ValueError(f"conformance stage {stage} has multiple entries")
|
|
61
63
|
if stage not in declared_stages:
|
|
@@ -118,6 +120,25 @@ def _read_conformance_manifest(
|
|
|
118
120
|
)
|
|
119
121
|
|
|
120
122
|
|
|
123
|
+
def conformance_manifest_path(project: Path, task_root: Path) -> str:
|
|
124
|
+
return (task_root / "qa/conformance-manifest.json").relative_to(
|
|
125
|
+
project,
|
|
126
|
+
).as_posix()
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def capture_conformance_baseline(
|
|
130
|
+
project: Path, task_root: Path, plan: FrozenVerificationPlan,
|
|
131
|
+
) -> dict[str, str]:
|
|
132
|
+
entries, _ = _read_conformance_manifest(
|
|
133
|
+
project, conformance_manifest_path(project, task_root),
|
|
134
|
+
{row["stage"] for row in plan["conformance"]},
|
|
135
|
+
)
|
|
136
|
+
return {
|
|
137
|
+
str(stage): _project_script_path(project, task_root, entry["script"])
|
|
138
|
+
for stage, entry in sorted(entries.items())
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
|
|
121
142
|
def capture_generation_conformance(
|
|
122
143
|
project: Path, ref: RunRef, plan: FrozenVerificationPlan,
|
|
123
144
|
changed_artifact_paths: frozenset[str], conformance_baseline: Mapping[int, str],
|
|
@@ -134,9 +155,7 @@ def capture_generation_conformance(
|
|
|
134
155
|
stage: _project_script_path(project, ref.task_root, row["script"])
|
|
135
156
|
for stage, row in declarations.items() if "script" in row
|
|
136
157
|
}
|
|
137
|
-
relative_manifest = (ref.task_root
|
|
138
|
-
project,
|
|
139
|
-
).as_posix()
|
|
158
|
+
relative_manifest = conformance_manifest_path(project, ref.task_root)
|
|
140
159
|
entries, sealed_manifest = _read_conformance_manifest(
|
|
141
160
|
project, relative_manifest, set(declarations),
|
|
142
161
|
)
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
import subprocess
|
|
5
|
+
from typing import Any, Mapping
|
|
6
|
+
|
|
7
|
+
from .correction_round import completed_round_attempts, correction_round
|
|
8
|
+
from .execution_manifest import read_execution_manifest
|
|
9
|
+
from .paths import RunRef
|
|
10
|
+
from .qa_procedures import safe_qa_path
|
|
11
|
+
from .verification_generation import prepare_verification_generation
|
|
12
|
+
from .verification_input_ref import VerificationInputReference
|
|
13
|
+
from .verification_input_types import VerificationInputs
|
|
14
|
+
from .verification_inputs import (
|
|
15
|
+
frozen_conformance_baseline, read_verification_inputs,
|
|
16
|
+
)
|
|
17
|
+
from .verification_invocation import (
|
|
18
|
+
VerificationGenerationReference, verification_generation_required,
|
|
19
|
+
)
|
|
20
|
+
from .verification_target import read_worktree_head
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class VerificationDispatchError(ValueError):
|
|
24
|
+
"""A verifier dispatch whose generation cannot be sealed."""
|
|
25
|
+
|
|
26
|
+
def __init__(
|
|
27
|
+
self, message: str, *, missing_executor_result: bool = False,
|
|
28
|
+
) -> None:
|
|
29
|
+
super().__init__(message)
|
|
30
|
+
self.missing_executor_result = missing_executor_result
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def seal_dispatch_generation(
|
|
34
|
+
project: Path, manifest_path: Path, manifest: Mapping[str, Any],
|
|
35
|
+
active_context: Mapping[str, Any], *, audience: str, dispatch_kind: str,
|
|
36
|
+
) -> VerificationGenerationReference | None:
|
|
37
|
+
try:
|
|
38
|
+
return _seal(
|
|
39
|
+
project, manifest_path, manifest, active_context,
|
|
40
|
+
audience=audience, dispatch_kind=dispatch_kind,
|
|
41
|
+
)
|
|
42
|
+
except VerificationDispatchError:
|
|
43
|
+
raise
|
|
44
|
+
except KeyError as exc:
|
|
45
|
+
raise VerificationDispatchError(
|
|
46
|
+
f"required field is missing: {exc.args[0]}",
|
|
47
|
+
) from exc
|
|
48
|
+
except (OSError, ValueError, subprocess.SubprocessError) as exc:
|
|
49
|
+
raise VerificationDispatchError(str(exc)) from exc
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def verification_generation_number(dispatch_kind: str) -> int:
|
|
53
|
+
"""The generation a dispatch seals; every dispatch outside a correction
|
|
54
|
+
round seals 1."""
|
|
55
|
+
return generation_sealed_after_round(correction_round(dispatch_kind) or 0)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def generation_sealed_after_round(round_number: int) -> int:
|
|
59
|
+
"""Correction round N seals generation N + 1."""
|
|
60
|
+
return 1 + round_number
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def _seal(
|
|
64
|
+
project: Path, manifest_path: Path, manifest: Mapping[str, Any],
|
|
65
|
+
active_context: Mapping[str, Any], *, audience: str, dispatch_kind: str,
|
|
66
|
+
) -> VerificationGenerationReference | None:
|
|
67
|
+
if not verification_generation_required(manifest, audience):
|
|
68
|
+
return None
|
|
69
|
+
project = project.resolve()
|
|
70
|
+
reference = VerificationInputReference.required_from_artifact_fields(manifest)
|
|
71
|
+
round_number = correction_round(dispatch_kind)
|
|
72
|
+
implementation = manifest["taskType"] == "implementation"
|
|
73
|
+
if implementation:
|
|
74
|
+
changed = _executor_changes(manifest_path, dispatch_kind, round_number)
|
|
75
|
+
else:
|
|
76
|
+
changed = _final_verification_changes(round_number)
|
|
77
|
+
inputs = read_verification_inputs(
|
|
78
|
+
safe_qa_path(project, reference.relative_path), reference.digest,
|
|
79
|
+
)
|
|
80
|
+
head = (
|
|
81
|
+
read_worktree_head(Path(inputs["sourceRoot"])) if implementation
|
|
82
|
+
else str(active_context["verificationTarget"]["headRef"])
|
|
83
|
+
)
|
|
84
|
+
path, digest = prepare_verification_generation(
|
|
85
|
+
project, RunRef.from_manifest(manifest_path, manifest), reference,
|
|
86
|
+
generation=verification_generation_number(dispatch_kind),
|
|
87
|
+
expected_head=head,
|
|
88
|
+
source_inputs=_present_declared_sources(inputs),
|
|
89
|
+
generated_roots=frozenset(), artifact_inputs=frozenset(),
|
|
90
|
+
changed_artifact_paths=changed,
|
|
91
|
+
conformance_baseline=frozen_conformance_baseline(
|
|
92
|
+
inputs, manifest["taskType"],
|
|
93
|
+
),
|
|
94
|
+
)
|
|
95
|
+
return VerificationGenerationReference(
|
|
96
|
+
path.relative_to(project).as_posix(), digest,
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def _present_declared_sources(inputs: VerificationInputs) -> frozenset[str]:
|
|
101
|
+
# A related source the executor deleted is part of the change under review;
|
|
102
|
+
# only the files present at the seal can be protected from the verifiers.
|
|
103
|
+
root = Path(inputs["sourceRoot"])
|
|
104
|
+
return frozenset(
|
|
105
|
+
relative
|
|
106
|
+
for entries in inputs["qaCommands"].values() for entry in entries
|
|
107
|
+
for relative in entry.get("sourcePaths", ())
|
|
108
|
+
if (root / relative).exists() or (root / relative).is_symlink()
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def _executor_changes(
|
|
113
|
+
manifest_path: Path, dispatch_kind: str, round_number: int | None,
|
|
114
|
+
) -> frozenset[str]:
|
|
115
|
+
attempts = completed_round_attempts(
|
|
116
|
+
read_execution_manifest(manifest_path), round_number, "implementer",
|
|
117
|
+
)
|
|
118
|
+
if not attempts:
|
|
119
|
+
raise VerificationDispatchError(
|
|
120
|
+
"the implementation executor has no ok result in dispatch "
|
|
121
|
+
f"{dispatch_kind}; dispatch the executor alone and await it before "
|
|
122
|
+
"its verifiers",
|
|
123
|
+
missing_executor_result=True,
|
|
124
|
+
)
|
|
125
|
+
return frozenset(
|
|
126
|
+
path for attempt in attempts
|
|
127
|
+
for path in attempt.change_summary.get("changedArtifactPaths", ())
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def _final_verification_changes(round_number: int | None) -> frozenset[str]:
|
|
132
|
+
if round_number is not None:
|
|
133
|
+
raise ValueError(
|
|
134
|
+
"final-verification seals only its initial verifier dispatch"
|
|
135
|
+
)
|
|
136
|
+
return frozenset()
|