tempergraph 0.7.1__py3-none-any.whl
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.
- tempergraph/__init__.py +8 -0
- tempergraph/__main__.py +5 -0
- tempergraph/api.py +428 -0
- tempergraph/audit/__init__.py +305 -0
- tempergraph/audit/catalog.py +342 -0
- tempergraph/audit/definition.py +387 -0
- tempergraph/audit/history.py +414 -0
- tempergraph/audit/history_rules.py +268 -0
- tempergraph/audit/history_rules_more.py +244 -0
- tempergraph/audit/host.py +270 -0
- tempergraph/audit/owned.py +96 -0
- tempergraph/audit/prompts.py +89 -0
- tempergraph/audit/report.py +248 -0
- tempergraph/audit/revisit.py +220 -0
- tempergraph/audit/surface.py +224 -0
- tempergraph/audit/text_health.py +176 -0
- tempergraph/audit/tools.py +391 -0
- tempergraph/author/__init__.py +2 -0
- tempergraph/author/blueprint.py +346 -0
- tempergraph/author/compare.py +122 -0
- tempergraph/author/criteria_lint.py +200 -0
- tempergraph/author/draw.py +112 -0
- tempergraph/author/inventory.py +210 -0
- tempergraph/author/literals.py +138 -0
- tempergraph/author/scaffold.py +568 -0
- tempergraph/author/session.py +439 -0
- tempergraph/author/trial.py +391 -0
- tempergraph/author/verify.py +353 -0
- tempergraph/builtin/__init__.py +1 -0
- tempergraph/builtin/upgrade.py +288 -0
- tempergraph/catalog.py +134 -0
- tempergraph/check_helpers.py +99 -0
- tempergraph/cli/__init__.py +1 -0
- tempergraph/cli/audit.py +190 -0
- tempergraph/cli/author.py +361 -0
- tempergraph/cli/improve.py +564 -0
- tempergraph/cli/improve_review.py +111 -0
- tempergraph/cli/install.py +35 -0
- tempergraph/cli/main.py +1261 -0
- tempergraph/cli/observe_cli.py +544 -0
- tempergraph/cli/outcome.py +77 -0
- tempergraph/cli/schedule_cli.py +1090 -0
- tempergraph/cli/upgrade.py +126 -0
- tempergraph/cli/workflows.py +96 -0
- tempergraph/compiler/__init__.py +6 -0
- tempergraph/compiler/graph.py +305 -0
- tempergraph/compiler/state.py +229 -0
- tempergraph/constants.py +72 -0
- tempergraph/contracts.py +1025 -0
- tempergraph/data/executor_compat.json +11 -0
- tempergraph/data/promotion.json +35 -0
- tempergraph/data/release.json +20 -0
- tempergraph/detach.py +65 -0
- tempergraph/docs.py +90 -0
- tempergraph/durability/__init__.py +2 -0
- tempergraph/durability/alias.py +66 -0
- tempergraph/durability/carry.py +591 -0
- tempergraph/durability/checkpoint.py +179 -0
- tempergraph/durability/control.py +109 -0
- tempergraph/durability/engine_file.py +301 -0
- tempergraph/durability/lock.py +138 -0
- tempergraph/durability/status.py +390 -0
- tempergraph/engine_identity.py +42 -0
- tempergraph/executor_compat.py +56 -0
- tempergraph/executors/__init__.py +4 -0
- tempergraph/executors/binding.py +91 -0
- tempergraph/executors/capabilities.py +95 -0
- tempergraph/executors/claude.py +603 -0
- tempergraph/executors/launcher.py +394 -0
- tempergraph/executors/mcpconfig.py +156 -0
- tempergraph/executors/mcpproxy.py +216 -0
- tempergraph/executors/preflight.py +196 -0
- tempergraph/executors/registry.py +71 -0
- tempergraph/executors/scripted.py +18 -0
- tempergraph/executors/session.py +107 -0
- tempergraph/executors/standins.py +118 -0
- tempergraph/executors/summary.py +110 -0
- tempergraph/executors/viewcatalog.py +27 -0
- tempergraph/git.py +403 -0
- tempergraph/identity.py +65 -0
- tempergraph/improve/__init__.py +5 -0
- tempergraph/improve/analysis.py +437 -0
- tempergraph/improve/artifact.py +477 -0
- tempergraph/improve/autonomy.py +192 -0
- tempergraph/improve/bindings.py +191 -0
- tempergraph/improve/calibration.py +1016 -0
- tempergraph/improve/causes.py +416 -0
- tempergraph/improve/child.py +651 -0
- tempergraph/improve/codehost.py +520 -0
- tempergraph/improve/digest.py +472 -0
- tempergraph/improve/escape.py +100 -0
- tempergraph/improve/filing.py +1047 -0
- tempergraph/improve/harvest.py +158 -0
- tempergraph/improve/issue_context.py +192 -0
- tempergraph/improve/lenses.py +204 -0
- tempergraph/improve/lessons.py +233 -0
- tempergraph/improve/loop_report.py +138 -0
- tempergraph/improve/loop_summary.py +85 -0
- tempergraph/improve/lost.py +119 -0
- tempergraph/improve/measure.py +121 -0
- tempergraph/improve/params.py +98 -0
- tempergraph/improve/pause_facts.py +134 -0
- tempergraph/improve/pr_later.py +186 -0
- tempergraph/improve/prebinding.py +130 -0
- tempergraph/improve/promotion.py +413 -0
- tempergraph/improve/proposals.py +934 -0
- tempergraph/improve/record.py +322 -0
- tempergraph/improve/release.py +89 -0
- tempergraph/improve/reliability.py +457 -0
- tempergraph/improve/repeat.py +115 -0
- tempergraph/improve/review.py +910 -0
- tempergraph/improve/suites.py +586 -0
- tempergraph/improve/trials.py +525 -0
- tempergraph/install/__init__.py +11 -0
- tempergraph/install/bootstrap.py +133 -0
- tempergraph/install/environment.py +173 -0
- tempergraph/install/launch.py +37 -0
- tempergraph/install/python.py +53 -0
- tempergraph/install/reconcile.py +52 -0
- tempergraph/install/selfcheck.py +29 -0
- tempergraph/install/shim.py +81 -0
- tempergraph/install/update.py +400 -0
- tempergraph/model/__init__.py +0 -0
- tempergraph/model/diagram.py +185 -0
- tempergraph/model/flow.py +324 -0
- tempergraph/model/prompt_lint.py +203 -0
- tempergraph/model/retire.py +52 -0
- tempergraph/model/subworkflow.py +274 -0
- tempergraph/model/text.py +67 -0
- tempergraph/model/validate.py +1158 -0
- tempergraph/observe/__init__.py +1 -0
- tempergraph/observe/attention.py +196 -0
- tempergraph/observe/detail.py +773 -0
- tempergraph/observe/forget.py +138 -0
- tempergraph/observe/hooks.py +272 -0
- tempergraph/observe/labels.py +95 -0
- tempergraph/observe/overlay.py +46 -0
- tempergraph/observe/report.py +402 -0
- tempergraph/observe/risk_report.py +110 -0
- tempergraph/observe/rows.py +444 -0
- tempergraph/observe/sinks.py +793 -0
- tempergraph/observe/supervision_cost.py +797 -0
- tempergraph/observe/supervision_report.py +295 -0
- tempergraph/observe/switch_report.py +140 -0
- tempergraph/package/__init__.py +2 -0
- tempergraph/package/change_report.py +116 -0
- tempergraph/package/changelog.py +263 -0
- tempergraph/package/docs_check.py +115 -0
- tempergraph/package/importer.py +90 -0
- tempergraph/package/inventory.py +111 -0
- tempergraph/package/loader.py +250 -0
- tempergraph/package/manifest.py +256 -0
- tempergraph/package/readiness.py +124 -0
- tempergraph/package/registry.py +383 -0
- tempergraph/package/rules.py +128 -0
- tempergraph/package/scan.py +65 -0
- tempergraph/package/selftest.py +348 -0
- tempergraph/package/stamp.py +213 -0
- tempergraph/package/transforms.py +481 -0
- tempergraph/package/upgrade.py +625 -0
- tempergraph/provenance.py +183 -0
- tempergraph/py.typed +0 -0
- tempergraph/release.py +17 -0
- tempergraph/render/__init__.py +0 -0
- tempergraph/render/output.py +72 -0
- tempergraph/render/prompt.py +166 -0
- tempergraph/render/template.py +86 -0
- tempergraph/run/__init__.py +2 -0
- tempergraph/run/asking.py +233 -0
- tempergraph/run/audit.py +63 -0
- tempergraph/run/check_worker.py +167 -0
- tempergraph/run/checks.py +517 -0
- tempergraph/run/commands.py +210 -0
- tempergraph/run/complexity.py +268 -0
- tempergraph/run/contest.py +76 -0
- tempergraph/run/council.py +368 -0
- tempergraph/run/council_run.py +527 -0
- tempergraph/run/events.py +279 -0
- tempergraph/run/finalize.py +132 -0
- tempergraph/run/gate.py +747 -0
- tempergraph/run/guard.py +89 -0
- tempergraph/run/judging.py +357 -0
- tempergraph/run/ladder.py +230 -0
- tempergraph/run/log.py +600 -0
- tempergraph/run/mapping.py +183 -0
- tempergraph/run/nodes.py +2304 -0
- tempergraph/run/outcome.py +255 -0
- tempergraph/run/outcome_record.py +292 -0
- tempergraph/run/outcome_trust.py +99 -0
- tempergraph/run/rerun.py +351 -0
- tempergraph/run/reserve.py +85 -0
- tempergraph/run/resources.py +76 -0
- tempergraph/run/risk.py +231 -0
- tempergraph/run/runner.py +1579 -0
- tempergraph/run/scriptcache.py +178 -0
- tempergraph/run/selfcheck.py +105 -0
- tempergraph/run/session_record.py +72 -0
- tempergraph/run/subrun.py +278 -0
- tempergraph/run/supervision.py +125 -0
- tempergraph/run/tool_access.py +101 -0
- tempergraph/schedule/__init__.py +25 -0
- tempergraph/schedule/credentials.py +167 -0
- tempergraph/schedule/echo.py +169 -0
- tempergraph/schedule/exact.py +275 -0
- tempergraph/schedule/export.py +164 -0
- tempergraph/schedule/launch.py +89 -0
- tempergraph/schedule/ledger.py +133 -0
- tempergraph/schedule/loop.py +176 -0
- tempergraph/schedule/model.py +440 -0
- tempergraph/schedule/policies.py +414 -0
- tempergraph/schedule/store.py +150 -0
- tempergraph/schedule/tick.py +377 -0
- tempergraph/schedule/token.py +81 -0
- tempergraph/schedule/triggers.py +210 -0
- tempergraph/schedule/words.py +423 -0
- tempergraph/security/__init__.py +0 -0
- tempergraph/security/launch.py +25 -0
- tempergraph/security/scrub.py +58 -0
- tempergraph/settings.py +950 -0
- tempergraph/store/__init__.py +0 -0
- tempergraph/store/codelog.py +73 -0
- tempergraph/store/layout.py +198 -0
- tempergraph/store/logs.py +325 -0
- tempergraph/store/manifest.py +99 -0
- tempergraph/store/migrate.py +188 -0
- tempergraph/workspace.py +874 -0
- tempergraph-0.7.1.dist-info/METADATA +70 -0
- tempergraph-0.7.1.dist-info/RECORD +232 -0
- tempergraph-0.7.1.dist-info/WHEEL +5 -0
- tempergraph-0.7.1.dist-info/entry_points.txt +5 -0
- tempergraph-0.7.1.dist-info/top_level.txt +2 -0
- tempergraph_pytest_plugin.py +64 -0
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
"""The audit rule catalog (ARC-B6 to ARC-B16, PRA-B7 to PRA-B10): engine data, versioned with the engine.
|
|
2
|
+
|
|
3
|
+
Every rule carries its layer, research `why-runs-fail-stall-repeat-or-overspend` family, cause code, default severity and confidence, owner, the
|
|
4
|
+
minimum sample of a history rule, and a fixed remedy (ARC-AC1). Thresholds are named parameters with
|
|
5
|
+
their default and the research `why-runs-fail-stall-repeat-or-overspend` finding they come from (ARC-AC3). Rules owned by another component are only
|
|
6
|
+
rendered; the audit calls that component (ARC-AC4, ADR `audit-joins-existing-checks-and-files-nothing`).
|
|
7
|
+
|
|
8
|
+
`built` names the release that builds the rule. Release 1 builds the `definition` and `host` layers and
|
|
9
|
+
the prompt audit (ADR `first-release-is-simple-trusted-workflows-on-one-machine`, plan item I-62); release 3 builds the `history` layer and the tool-surface
|
|
10
|
+
audit of TSA (R3-T8.3). A rule not built here is listed as skipped, never as passed (AUD-B1).
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
from dataclasses import dataclass
|
|
16
|
+
from typing import Literal
|
|
17
|
+
|
|
18
|
+
Layer = Literal["definition", "host", "history"]
|
|
19
|
+
Severity = Literal["error", "warning", "info"]
|
|
20
|
+
Confidence = Literal["high", "medium", "low"]
|
|
21
|
+
LAYERS: tuple[Layer, ...] = ("definition", "host", "history")
|
|
22
|
+
SEVERITY_RANK = {"error": 0, "warning": 1, "info": 2}
|
|
23
|
+
CONFIDENCE_RANK = {"high": 0, "medium": 1, "low": 2}
|
|
24
|
+
FAMILY_RANK = {f"C{i}": i for i in range(1, 9)}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@dataclass(frozen=True, kw_only=True)
|
|
28
|
+
class Param:
|
|
29
|
+
name: str
|
|
30
|
+
default: float
|
|
31
|
+
source: str # the research `why-runs-fail-stall-repeat-or-overspend` finding (or research note) that motivated the default
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
PARAMS: dict[str, Param] = {p.name: p for p in (
|
|
35
|
+
Param(name="oversized_blockers", default=8, source="research `why-runs-fail-stall-repeat-or-overspend` F1.2"),
|
|
36
|
+
Param(name="oversized_file_artifacts", default=3, source="research `why-runs-fail-stall-repeat-or-overspend` F1.2"),
|
|
37
|
+
Param(name="oversized_template_chars", default=24_000, source="research `why-runs-fail-stall-repeat-or-overspend` F1.2"),
|
|
38
|
+
Param(name="engine_step_timeout_s", default=600, source="research `why-runs-fail-stall-repeat-or-overspend` F3.4 (the engine default)"),
|
|
39
|
+
Param(name="infra_tries", default=3, source="BUD default infra tries"),
|
|
40
|
+
Param(name="no_idle_above_s", default=1_800, source="research `why-runs-fail-stall-repeat-or-overspend` F3.5"),
|
|
41
|
+
Param(name="unit_hold_h", default=4, source="research `why-runs-fail-stall-repeat-or-overspend` F3.5"),
|
|
42
|
+
Param(name="workflow_hold_h", default=12, source="research `why-runs-fail-stall-repeat-or-overspend` F3.5"),
|
|
43
|
+
Param(name="approval_share", default=0.5, source="research `why-runs-fail-stall-repeat-or-overspend` F5.3"),
|
|
44
|
+
Param(name="slow_login_shell_s", default=15, source="research `why-runs-fail-stall-repeat-or-overspend` F2.5"),
|
|
45
|
+
Param(name="slow_login_shell_ratio", default=5, source="research `why-runs-fail-stall-repeat-or-overspend` F2.5"),
|
|
46
|
+
Param(name="slow_login_shell_floor_s", default=1, source="release 1 default: below it the ratio is noise"),
|
|
47
|
+
Param(name="template_chars", default=32_000, source="release 1 default"),
|
|
48
|
+
Param(name="prompt_prohibitions_per_reason", default=20,
|
|
49
|
+
source="default_no_data: research `why-the-loop-missed-flaws-in-prompts-formats-and-decisions` F1"),
|
|
50
|
+
Param(name="prompt_repeat_files", default=3,
|
|
51
|
+
source="default_no_data: research `why-the-loop-missed-flaws-in-prompts-formats-and-decisions` F2"),
|
|
52
|
+
Param(name="skill_chars", default=40_000, source="release 1 default"),
|
|
53
|
+
Param(name="cell_chars", default=2_000, source="release 1 default"),
|
|
54
|
+
Param(name="probe_budget_s", default=30, source="AUD-B11, AUD-B6, AUD-B9"),
|
|
55
|
+
# history rules of C1, C2 and C3 (ARC-B9 to ARC-B11)
|
|
56
|
+
Param(name="loop_min_retries", default=5, source="research `why-runs-fail-stall-repeat-or-overspend` F1.2 (a burst needs at least 5 RETRYs)"),
|
|
57
|
+
Param(name="loop_lead_share", default=0.5, source="research `why-runs-fail-stall-repeat-or-overspend` F1.2 (one criterion leads half the RETRYs)"),
|
|
58
|
+
Param(name="loop_repeat_share", default=0.2, source="research `why-runs-fail-stall-repeat-or-overspend` F1.2"),
|
|
59
|
+
Param(name="first_pass_floor", default=0.5, source="research `why-runs-fail-stall-repeat-or-overspend` F1.2"),
|
|
60
|
+
Param(name="min_visits", default=5, source="ARC-B9 (min_n 5 visits)"),
|
|
61
|
+
Param(name="fallback_share", default=0.3, source="research `councils-debate-and-voting` K3 (revisited with the first 10 visits)"),
|
|
62
|
+
Param(name="infra_share", default=0.1, source="research `why-runs-fail-stall-repeat-or-overspend` F2.6"),
|
|
63
|
+
Param(name="infra_min_attempts", default=20, source="research `why-runs-fail-stall-repeat-or-overspend` F2.6"),
|
|
64
|
+
Param(name="timeout_fit_ratio", default=1.25, source="research `why-runs-fail-stall-repeat-or-overspend` F3.4"),
|
|
65
|
+
Param(name="timeout_recommend_ratio", default=1.5, source="research `why-runs-fail-stall-repeat-or-overspend` F3.4"),
|
|
66
|
+
Param(name="timeout_loose_ratio", default=4, source="research `why-runs-fail-stall-repeat-or-overspend` F3.4"),
|
|
67
|
+
Param(name="timeout_share", default=0.2, source="research `why-runs-fail-stall-repeat-or-overspend` F3.2"),
|
|
68
|
+
Param(name="slow_tool_share", default=0.6, source="research `why-runs-fail-stall-repeat-or-overspend` F3.7"),
|
|
69
|
+
Param(name="min_passing_attempts", default=5, source="research `why-runs-fail-stall-repeat-or-overspend` F3.4"),
|
|
70
|
+
# history rules of C5 to C8 (ARC-B12 to ARC-B15)
|
|
71
|
+
Param(name="empty_pause_share", default=0.5, source="research `why-runs-fail-stall-repeat-or-overspend` F5.3"),
|
|
72
|
+
Param(name="min_pauses", default=4, source="research `why-runs-fail-stall-repeat-or-overspend` F5.3"),
|
|
73
|
+
Param(name="interventions_per_run", default=1.0, source="research `why-runs-fail-stall-repeat-or-overspend` F5.3 (SUP undesigned touches)"),
|
|
74
|
+
Param(name="agent_rescue_share", default=0.3, source="research `why-runs-fail-stall-repeat-or-overspend` F5.3 (PRV caller provenance)"),
|
|
75
|
+
Param(name="min_rescues", default=5, source="research `why-runs-fail-stall-repeat-or-overspend` F5.3"),
|
|
76
|
+
Param(name="min_measured_runs", default=5, source="research `why-runs-fail-stall-repeat-or-overspend` F5.3 (SCO measured supervision cost)"),
|
|
77
|
+
Param(name="supervision_share", default=0.1, source="research `why-runs-fail-stall-repeat-or-overspend` F5.3 (SCO supervision cost)"),
|
|
78
|
+
Param(name="polling_observations", default=20, source="research `why-runs-fail-stall-repeat-or-overspend` F5.3 (ADR `attention-batched-waking-of-the-orchestrating-session` batched waking)"),
|
|
79
|
+
Param(name="rewake_share", default=0.5, source="research `why-runs-fail-stall-repeat-or-overspend` F5.3 (ADR `attention-batched-waking-of-the-orchestrating-session` batched waking)"),
|
|
80
|
+
Param(name="unknown_caller_share", default=0.2, source="research `why-runs-fail-stall-repeat-or-overspend` F5.3 (PRV caller provenance)"),
|
|
81
|
+
Param(name="min_touches", default=10, source="research `why-runs-fail-stall-repeat-or-overspend` F5.3 (PRV caller provenance)"),
|
|
82
|
+
Param(name="context_peak_tokens", default=150_000, source="research `why-runs-fail-stall-repeat-or-overspend` F6.3"),
|
|
83
|
+
Param(name="min_attempts", default=5, source="research `why-runs-fail-stall-repeat-or-overspend` F6.3"),
|
|
84
|
+
Param(name="escape_rate", default=0.1, source="OUT-B18 (research `why-runs-fail-stall-repeat-or-overspend` F7.1)"),
|
|
85
|
+
Param(name="min_graded_runs", default=10, source="OUT-B18 (research `why-runs-fail-stall-repeat-or-overspend` F7.1)"),
|
|
86
|
+
Param(name="council_gain_floor", default=0.05, source="research `councils-debate-and-voting` K2"),
|
|
87
|
+
Param(name="council_conformity_share", default=0.8, source="research `councils-debate-and-voting` K4"),
|
|
88
|
+
Param(name="contest_lowest_slot_share", default=0.9, source="research `councils-debate-and-voting` K6"),
|
|
89
|
+
Param(name="min_picks", default=10, source="research `councils-debate-and-voting` K2, K4, K6 (revisited with the first 10 visits)"),
|
|
90
|
+
)}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
@dataclass(frozen=True, kw_only=True)
|
|
94
|
+
class Rule:
|
|
95
|
+
id: str
|
|
96
|
+
layer: Layer
|
|
97
|
+
family: str
|
|
98
|
+
cause: str
|
|
99
|
+
severity: Severity | Literal["per owner"]
|
|
100
|
+
confidence: Confidence | Literal["per owner"]
|
|
101
|
+
owner: str = "audit"
|
|
102
|
+
min_n: int | None = None
|
|
103
|
+
remedy: str = ""
|
|
104
|
+
built: int = 1 # the release that builds it
|
|
105
|
+
spec: str = "ARC"
|
|
106
|
+
widening: bool = False # the remedy adds a grant (a command or a tool): marked for a person to decide (TSA-B13)
|
|
107
|
+
|
|
108
|
+
@property
|
|
109
|
+
def rank(self) -> tuple[int, int]:
|
|
110
|
+
return FAMILY_RANK.get(self.family, 9), _ORDER.get(self.id, 999)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def _r(id: str, layer: Layer, family: str, sev: str, cause: str, remedy: str, *, owner: str = "audit",
|
|
114
|
+
min_n: int | None = None, built: int | None = None, spec: str = "ARC", widening: bool = False) -> Rule:
|
|
115
|
+
s, _, c = sev.partition("/")
|
|
116
|
+
if layer == "history" and min_n is None:
|
|
117
|
+
min_n = 1 # ARC-AC1: every history rule has a minimum sample; "any run" where ARC names none
|
|
118
|
+
return Rule(id=id, layer=layer, family=family, cause=cause, severity=s.strip(), # type: ignore[arg-type]
|
|
119
|
+
confidence=(c.strip() or s.strip()), owner=owner, min_n=min_n, # type: ignore[arg-type]
|
|
120
|
+
remedy=remedy, built=built if built is not None else (3 if layer == "history" else 1), spec=spec,
|
|
121
|
+
widening=widening)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
OWN = "per owner"
|
|
125
|
+
|
|
126
|
+
RULES: tuple[Rule, ...] = (
|
|
127
|
+
# C1 gate send-back loops (ARC-B8, ARC-B9)
|
|
128
|
+
_r("oversized-step", "definition", "C1", "warning / medium", "oversized_step",
|
|
129
|
+
"Split the step into passes (design, then tables); give each pass its own gate (research `why-runs-fail-stall-repeat-or-overspend` F1.2)"),
|
|
130
|
+
_r("no-change-blocker-retries", "definition", "C1", "warning / high", "no_change_retry",
|
|
131
|
+
"Keep the default `no_change_policy: escalate`: a retry cannot fix what the step's output cannot change"),
|
|
132
|
+
_r("unverified-blocker", "definition", "C1", "warning / high", "unverifiable_blocker",
|
|
133
|
+
"Give the judge a view of that system, move the fact to a check, or make the criterion a warning"),
|
|
134
|
+
_r("single-criterion-gate-judge-only", "definition", "C1", "info / low", "prefer_check",
|
|
135
|
+
"Make the criterion a check: a file's existence, a command's result or a git fact is computed, not judged"),
|
|
136
|
+
_r("loop-driver-criterion", "history", "C1", "error / high", "retry_burst",
|
|
137
|
+
"Split the step, reword the criterion so a second visit can meet it, or move it to a check", min_n=5),
|
|
138
|
+
_r("low-first-pass", "history", "C1", "warning / high", "low_first_pass",
|
|
139
|
+
"Read `loop-driver-criterion` for the gate; consider a split", min_n=5),
|
|
140
|
+
_r("no-change-retried", "history", "C1", "warning / high", "no_change_retry", "As `no-change-blocker-retries`"),
|
|
141
|
+
_r("repeated-check-evidence", "history", "C1", "warning / medium", "retry_cannot_fix",
|
|
142
|
+
"Mark the failure environmental in the check, or fix the environment"),
|
|
143
|
+
_r("missing-field-rendered", "history", "C1", "error / high", "missing_input",
|
|
144
|
+
"Supply the input or make the template field optional"),
|
|
145
|
+
_r("judge-not-ready", "definition", "C1", OWN, "judge_not_ready", "owner: LIF readiness report",
|
|
146
|
+
owner="readiness"),
|
|
147
|
+
_r("brief-rule-branching", "definition", "C1", OWN, "", "owner: WFM-B12", owner="validate"),
|
|
148
|
+
_r("criterion-without-method", "definition", "C1", OWN, "", "owner: WFM-B12", owner="validate"),
|
|
149
|
+
# C2 environment (ARC-B10)
|
|
150
|
+
_r("check-program-missing", "host", "C2", "error / high", "environment_missing",
|
|
151
|
+
"Install the program, or change the prefix or resolver; the check would run nothing (F2.4)"),
|
|
152
|
+
_r("interpreter-cannot-import", "host", "C2", "error / high", "environment_missing",
|
|
153
|
+
"Install the runner in that environment (F2.2)"),
|
|
154
|
+
_r("toolchain-not-covered", "host", "C2", "warning / medium", "toolchain_not_covered",
|
|
155
|
+
"Add a `command_resolver` or declare the repository's commands (F2.4)"),
|
|
156
|
+
_r("worktree-env-outside-worktree", "host", "C2", "warning / medium", "stale_import",
|
|
157
|
+
"Resolve the interpreter inside the worktree, or install non-editable (F2.7)"),
|
|
158
|
+
_r("slow-host", "host", "C2", "warning / high", "slow_host",
|
|
159
|
+
"Fix the host before running; timeouts on it are classed `slow_host` and spend no retries (F2.5)"),
|
|
160
|
+
_r("check-ran-nothing", "history", "C2", "error / high", "blocked_without_check",
|
|
161
|
+
"As `toolchain-not-covered`", min_n=1),
|
|
162
|
+
_r("infra-heavy", "history", "C2", "warning / medium", "infra_heavy", "Read the leading `infra_cause`",
|
|
163
|
+
min_n=20),
|
|
164
|
+
_r("executor-outside-tested-range", "host", "C2", OWN, "", "owner: LIF executor compatibility",
|
|
165
|
+
owner="executor-compat"),
|
|
166
|
+
# C3 timeouts (ARC-B11)
|
|
167
|
+
_r("default-step-timeout", "definition", "C3", "warning / high", "default_timeout",
|
|
168
|
+
"Set `timeout_s` near the p90 of the same work (F3.4, F3.6)"),
|
|
169
|
+
_r("default-judge-timeout", "definition", "C3", "info / high", "default_timeout",
|
|
170
|
+
"Set the judge's `timeout_s`; a judge never takes the step's limit"),
|
|
171
|
+
_r("idle-limit-inert", "definition", "C3", "warning / high", "idle_inert",
|
|
172
|
+
"Lower `idle_s` below the wall limit, or remove it; it can never fire"),
|
|
173
|
+
_r("no-idle-limit", "definition", "C3", "info / medium", "no_idle_limit",
|
|
174
|
+
"Declare `idle_s` below the wall limit, above the longest silent tool call (F3.5)"),
|
|
175
|
+
_r("hold-time-exposure", "definition", "C3", "warning / high", "hold_exposure",
|
|
176
|
+
"Lower the limit or the budget, or set an idle limit (F3.5)"),
|
|
177
|
+
_r("timeout-below-pass-p90", "history", "C3", "error / high", "timeout_too_short",
|
|
178
|
+
"Set the limit to about 1.5 x the p90 of passing attempts (F3.4)", min_n=5),
|
|
179
|
+
_r("attempts-at-limit", "history", "C3", "warning / high", "timeout_share", "By split (F3.2, F3.7)", min_n=5),
|
|
180
|
+
_r("limit-far-above-p90", "history", "C3", "info / medium", "timeout_loose", "Lower the limit", min_n=5),
|
|
181
|
+
_r("request-timed-out", "history", "C3", "warning / high", "request_timed_out",
|
|
182
|
+
"Write the long output in parts (F3.3)", min_n=1),
|
|
183
|
+
# C4 tool surface (TSA-B9 to TSA-B12): the rules of the tool surface audit; a `widening` remedy adds a grant
|
|
184
|
+
_r("judge-exposed-tool", "history", "C4", "error / high", "judge_exposed",
|
|
185
|
+
"Remove the source: disable the plugin's tool in headless sessions, or narrow the judge's setting sources (F4.5)",
|
|
186
|
+
min_n=1, spec="TSA"),
|
|
187
|
+
_r("judge-ambient-tool", "host", "C4", "warning / medium", "judge_exposed",
|
|
188
|
+
"Disable that plugin tool or user MCP server in headless sessions, or narrow the judge's setting sources (F4.5)",
|
|
189
|
+
spec="TSA"),
|
|
190
|
+
_r("judge-view-missing", "definition", "C4", OWN, "", "owner: WFM-B12", owner="validate", spec="TSA"),
|
|
191
|
+
_r("mcp-tool-not-in-catalog", "definition", "C4", "warning / high", "unknown_tool_name",
|
|
192
|
+
"Run the unit on an executor whose judge can view that MCP tool, or declare a tool the view catalog classifies; "
|
|
193
|
+
"its judge gets no view (F4.6)", spec="TSA"),
|
|
194
|
+
_r("needed-not-granted", "definition", "C4", OWN, "", "owner: WFM-B12", owner="validate", spec="TSA"),
|
|
195
|
+
_r("artifact-needs-write", "definition", "C4", "error / high", "grant_missing",
|
|
196
|
+
"Declare a tool that can write the artifact: `shell` with the command prefix, or an MCP write tool (F4.4)",
|
|
197
|
+
spec="TSA", widening=True),
|
|
198
|
+
_r("shell-without-commands", "definition", "C4", "error / high", "grant_missing",
|
|
199
|
+
"Declare the command prefixes the step runs in `commands`; `shell` with none runs nothing", spec="TSA",
|
|
200
|
+
widening=True),
|
|
201
|
+
_r("dir-change-in-commands", "definition", "C4", "error / high", "dir_change",
|
|
202
|
+
"Remove the directory change; name the directory to the command, as in `git -C <dir>` (F4.2: 58 of 59 refused)",
|
|
203
|
+
spec="TSA"),
|
|
204
|
+
_r("shell-for-read-likely", "definition", "C4", "warning / medium", "shell_for_read",
|
|
205
|
+
"Tell the step to read and search with the file tools, not shell programs (F4.1)", spec="TSA"),
|
|
206
|
+
_r("path-outside-workspace", "definition", "C4", "warning / medium", "outside_workspace",
|
|
207
|
+
"Use paths inside the workspace; a path outside it is refused (F4.2)", spec="TSA"),
|
|
208
|
+
_r("granted-not-needed", "definition", "C4", "info / low", "over_grant",
|
|
209
|
+
"Remove the capability from the step's `tools` if nothing needs it (F4.9)", spec="TSA"),
|
|
210
|
+
_r("not-enforced", "definition", "C4", "info / high", "not_enforced",
|
|
211
|
+
"Run with `--enforce-tools` or `--strict-permissions`, or bind the unit to an executor that enforces its grant",
|
|
212
|
+
spec="TSA"),
|
|
213
|
+
_r("granted-never-used", "history", "C4", "warning / high", "over_grant",
|
|
214
|
+
"Remove the tool or MCP server from the step's declared tools (F4.9)", min_n=10, spec="TSA"),
|
|
215
|
+
_r("undeclared-calls", "history", "C4", "warning / high", "undeclared_tool",
|
|
216
|
+
"Declare the tool the step keeps calling, or tell the step not to call it (F4.3)", min_n=5, spec="TSA",
|
|
217
|
+
widening=True),
|
|
218
|
+
_r("refusals-by-class", "history", "C4", "warning / high", "tool_access",
|
|
219
|
+
"Per class: use the file tools; name the directory explicitly (`git -C <dir>`); use workspace paths; declare "
|
|
220
|
+
"the command; declare the tool", min_n=5, spec="TSA"),
|
|
221
|
+
_r("granted-at-run", "history", "C4", "warning / high", "grant_missing",
|
|
222
|
+
"Declare the grant in the package so every run has it (RST)", min_n=2, spec="TSA", widening=True),
|
|
223
|
+
_r("skill-name-clash", "host", "C4", "warning / high", "skill_clash",
|
|
224
|
+
"Name the skill or agent by plugin path (F4.8)", spec="TSA"),
|
|
225
|
+
_r("mcp-server-not-configured", "host", "C4", "error / high", "environment_missing",
|
|
226
|
+
"Configure the MCP server in your own configuration, or remove its declaration", spec="TSA"),
|
|
227
|
+
_r("declared-tool-stale", "host", "C4", "warning / high", "unknown_tool_name",
|
|
228
|
+
"Declare the tool by the name the compatibility table gives", spec="TSA"),
|
|
229
|
+
_r("tool-set-drift", "host", "C4", "warning / medium", "unknown_tool_name",
|
|
230
|
+
"Read what the executor or MCP server exposes now, then stamp again (SIL-B4)", spec="TSA"),
|
|
231
|
+
# C5 pauses (ARC-B12)
|
|
232
|
+
_r("every-retry-asks", "definition", "C5", "warning / high", "ask_without_budget",
|
|
233
|
+
"Give one retry, or `on_budget_spent: stop`; every RETRY pauses for a person"),
|
|
234
|
+
_r("approval-on-most-gates", "definition", "C5", "info / medium", "approval_heavy",
|
|
235
|
+
"Keep approval where a person decides something a judge cannot"),
|
|
236
|
+
_r("empty-pauses", "history", "C5", "warning / medium", "empty_pause", "The pause adds nothing (F5.3)", min_n=4),
|
|
237
|
+
_r("interventions-per-run", "history", "C5", "info / high", "person_rate", "Read the leading pause kind",
|
|
238
|
+
min_n=5),
|
|
239
|
+
_r("agent-rescues-alone", "history", "C5", "warning / high", "agent_decided",
|
|
240
|
+
"Make it a check or an environmental cause, or have the skill relay it", min_n=5),
|
|
241
|
+
_r("supervision-cost-share", "history", "C5", "warning / medium", "supervision_heavy",
|
|
242
|
+
"The leading supervision category names the fix", min_n=5),
|
|
243
|
+
_r("polling-supervisor", "history", "C5", "warning / high", "supervisor_polling",
|
|
244
|
+
"Wait on the run's exit in the background instead of polling", min_n=5),
|
|
245
|
+
_r("callers-unknown", "history", "C5", "info / high", "caller_unknown",
|
|
246
|
+
"Run through a marked host, or declare the caller", min_n=10),
|
|
247
|
+
# C6 cost (ARC-B13)
|
|
248
|
+
_r("small-judge-cross-file", "definition", "C6", "warning / medium", "model_too_small",
|
|
249
|
+
"Use `medium` or `large` for reading across files (F6.4: 5 of 19 against 18 of 19)"),
|
|
250
|
+
_r("sizing-unassessed", "definition", "C6", "error / high", "sizing_unassessed",
|
|
251
|
+
"State the model tier, the effort and one sentence of why on the step or judge (SCF-B10)"),
|
|
252
|
+
_r("large-everywhere", "definition", "C6", "info / low", "model_heavy",
|
|
253
|
+
"Choose models by what each step must find; start mechanical steps lower"),
|
|
254
|
+
_r("no-run-cost-cap", "definition", "C6", "info / high", "no_cost_cap", "Set `run_cost_cap_usd` near the p90 run cost"),
|
|
255
|
+
_r("context-heavy-step", "history", "C6", "warning / medium", "context_heavy",
|
|
256
|
+
"Split the step or narrow what it reads (F6.3)", min_n=5),
|
|
257
|
+
_r("cost-lens-rules", "history", "C6", OWN, "", "owner: SIL-B10 cost lens", owner="cost-lens"),
|
|
258
|
+
# C7 prompt defects and C8 engine side (ARC-B14)
|
|
259
|
+
_r("prompt-lint", "definition", "C7", OWN, "", "owner: LIF prompt lint", owner="prompt-lint"),
|
|
260
|
+
_r("template-grammar", "definition", "C7", OWN, "", "owner: WFM-B8, WFM-B9, WFM-B10, WFM-B11", owner="validate"),
|
|
261
|
+
_r("outcome-unverified-blocker", "definition", "C7", "warning / high", "outcome_unverified",
|
|
262
|
+
"Find a verifier by the search order of AUT-B16, AUT-B17, AUT-B18, calibrate the judge (JCL), or make the criterion a sign-off"),
|
|
263
|
+
_r("outcome-uncovered", "definition", "C7", "warning / high", "outcome_uncovered",
|
|
264
|
+
"Add a serving criterion on the units before the outcome gate, or verify it at the outcome gate"),
|
|
265
|
+
_r("change-notes-incomplete", "definition", "C7", "warning / high", "change_notes_incomplete",
|
|
266
|
+
"Write changes/<version>.json with one entry for each change and remove the draft marker", spec="ARC"),
|
|
267
|
+
_r("outcome-escapes", "history", "C7", "warning / medium", "outcome_escape",
|
|
268
|
+
"Revise the outcome: `outcome candidates`, then revise mode", min_n=10),
|
|
269
|
+
_r("engine-fault-open", "history", "C8", "info / high", "", "owner: SIL", owner="SIL"),
|
|
270
|
+
# ARC-B15 newer unit kinds: the council is built in release 3 and its two definition rules run; the contest's do not yet
|
|
271
|
+
_r("council-one-family", "definition", "C1", "warning / medium", "council_monoculture",
|
|
272
|
+
"Put at least one member on another family", built=3),
|
|
273
|
+
_r("council-even-majority", "definition", "C5", "info / high", "tie_prone", "Use an odd count", built=3),
|
|
274
|
+
_r("council-rounds-no-gain", "history", "C6", "warning / medium", "rounds_no_gain", "Set `rounds: 0`",
|
|
275
|
+
min_n=10, built=3),
|
|
276
|
+
_r("council-conformity", "history", "C1", "info / low", "council_conformity", "Check stances and anonymity",
|
|
277
|
+
min_n=10, built=3),
|
|
278
|
+
_r("contest-identical-slots", "definition", "C6", "warning / high", "contest_no_diversity",
|
|
279
|
+
"Vary model, executor or `prompt_variant`", built=3),
|
|
280
|
+
_r("contest-no-gain", "history", "C6", "warning / medium", "contest_no_gain", "Reduce `slots`",
|
|
281
|
+
min_n=10, built=3),
|
|
282
|
+
_r("fallback-rate", "history", "C1", "warning / high", "fallback_heavy",
|
|
283
|
+
"Read the unit's `loop-driver-criterion` and `low-first-pass` findings", min_n=5),
|
|
284
|
+
_r("unbounded-wait", "definition", "C5", "info / medium", "wait_unbounded",
|
|
285
|
+
"Add a deadline and an `on_deadline`", built=2),
|
|
286
|
+
_r("external-after-without-approval", "definition", "C7", OWN, "publish_before_review",
|
|
287
|
+
"owner: WFM-B12 (validation warns on it in release 1)", owner="validate"),
|
|
288
|
+
# PRA-B7 to PRA-B10 prompt audit (family C7)
|
|
289
|
+
_r("ref-missing", "definition", "C7", "error / high", "ref_missing",
|
|
290
|
+
"Fix or remove the reference; the session wastes turns looking for it (F7.2)", spec="PRA"),
|
|
291
|
+
_r("step-file-missing", "definition", "C7", "warning / high", "ref_missing",
|
|
292
|
+
"Fix the pattern in `step_files` or add the file; a proposal cannot reach a file that is not declared",
|
|
293
|
+
spec="PRA"),
|
|
294
|
+
_r("ref-resolves-elsewhere", "host", "C7", "warning / high", "skill_clash",
|
|
295
|
+
"Ship the skill with the workflow or name it by plugin path (F4.8)", spec="PRA"),
|
|
296
|
+
_r("tool-name-unknown", "host", "C7", OWN, "unknown_tool_name",
|
|
297
|
+
"owner: LIF prompt lint `lint-tool-name-foreign` for executor tool names; MCP names need the view "
|
|
298
|
+
"catalog (TSA, release 2)", owner="prompt-lint", spec="PRA"),
|
|
299
|
+
_r("tool-name-stale", "host", "C7", "warning / high", "unknown_tool_name",
|
|
300
|
+
"Replace it with the current name; the engine's tools block already names it (F4.6)", spec="PRA"),
|
|
301
|
+
_r("prompt-tool-conflict", "definition", "C7", "warning / high", "prompt_conflict",
|
|
302
|
+
"Make the text and the declaration say the same; the engine's tools block is the source of truth",
|
|
303
|
+
spec="PRA"),
|
|
304
|
+
_r("decision-revisit-due", "definition", "C7", "info / high", "decision_revisit",
|
|
305
|
+
"Read the decision record again and revise it, or rewrite its revisit trigger, then restamp", spec="DRV"),
|
|
306
|
+
_r("prompt-constraint-heavy", "definition", "C7", "warning / medium", "prompt_structure",
|
|
307
|
+
"Give each rule that is not mechanical its reason in half a line, or replace a list of prohibitions with "
|
|
308
|
+
"what the step owns and where the rest goes", spec="PRA"),
|
|
309
|
+
_r("prompt-repeated-text", "definition", "C7", "info / medium", "prompt_structure",
|
|
310
|
+
"Keep the sentence in one file that the others name, so a fix lands in one place", spec="PRA"),
|
|
311
|
+
_r("skill-frontmatter-nonstandard", "definition", "C7", "info / high", "skill_nonportable",
|
|
312
|
+
"Keep to name, description, license, compatibility, metadata, allowed-tools, or ship a second form",
|
|
313
|
+
spec="PRA"),
|
|
314
|
+
_r("artifact-not-asked", "definition", "C7", "warning / medium", "prompt_conflict",
|
|
315
|
+
"Name each produced artifact in the template; declare what the text asks for", spec="PRA"),
|
|
316
|
+
_r("criterion-not-in-reach", "definition", "C7", "warning / medium", "prompt_conflict",
|
|
317
|
+
"Add the reference or view, or mark the system `unverified_system`", spec="PRA"),
|
|
318
|
+
_r("one-shot-long-output", "definition", "C7", "warning / low", "long_response",
|
|
319
|
+
"Write a skeleton, then one edit per part (F3.3)", spec="PRA"),
|
|
320
|
+
_r("prompt-oversized", "definition", "C7", OWN, "prompt_size",
|
|
321
|
+
"owner: LIF prompt lint `lint-oversized` (same limits)", owner="prompt-lint", spec="PRA"),
|
|
322
|
+
_r("rendered-near-cut", "history", "C7", "warning / high", "missing_input",
|
|
323
|
+
"Narrow what the step is given (F1.5)", min_n=1, spec="PRA"),
|
|
324
|
+
# AUD-B14
|
|
325
|
+
_r("ignore-rule-unknown", "definition", "C8", "info / high", "",
|
|
326
|
+
"Fix the rule id in `audit.ignore`, or remove the entry", spec="AUD"),
|
|
327
|
+
_r("prompt-change-moved-gate", "history", "C7", OWN, "", "owner: SIL post-release watch", owner="SIL",
|
|
328
|
+
spec="PRA"),
|
|
329
|
+
)
|
|
330
|
+
|
|
331
|
+
_ORDER = {r.id: i for i, r in enumerate(RULES)}
|
|
332
|
+
BY_ID: dict[str, Rule] = {r.id: r for r in RULES}
|
|
333
|
+
OWNERS = frozenset({"validate", "prompt-lint", "readiness", "executor-compat", "cost-lens", "SIL"})
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
def rule(rule_id: str) -> Rule:
|
|
337
|
+
return BY_ID[rule_id]
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
def known(rule_id: str) -> bool:
|
|
341
|
+
"""A catalog id, or an owned code `<owner>:<code>` (AUD-B14 ignores name either)."""
|
|
342
|
+
return rule_id in BY_ID or rule_id.partition(":")[0] in OWNERS
|