Skip to content

Commit 9ccbf80

Browse files
authored
Merge pull request #4626 from songoow/codex/effective-action-value-notes
docs(semantics): say which condition produces each effective_action value
2 parents d9b3174 + d1ea66a commit 9ccbf80

2 files changed

Lines changed: 54 additions & 7 deletions

File tree

‎loopx/semantics/vocabulary_v0.json‎

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,40 @@
422422
"todo_decision_scope_projection_repair",
423423
"unsettled_host_turn_recovery"
424424
],
425+
"value_notes": {
426+
"agent_monitor_only": "The lane is monitor-only for this agent: not actionable by the agent, advancement work is the blocked scope, and the scheduler holds it in an agent-monitor wait.",
427+
"agent_workspace_repair": "Workspace repair is allowed, and it outranks self-repair: the agent workspace is repaired before any further delivery. The name ends in _repair, so the route is repair_required.",
428+
"automation_prompt_upgrade_required": "The installed automation prompt identity must be repaired first. It is one of the conditions that withholds autonomous_replan_decision_allowed, and the automation action is repair_automation_prompt_identity.",
429+
"autonomous_replan_required": "An autonomous replan is required and its scope applies to this agent. It is one of REPLAN_ACTIONS, so the route is replan_required.",
430+
"blocked_health": "Existing result of quota_effective_action; previously missed because the literal scan did not inspect declared return functions.",
431+
"blocked_wait": "Existing result of quota_effective_action; previously missed because the literal scan did not inspect declared return functions.",
432+
"boundary_projection_repair": "A required write scope is missing from the projected goal boundary; trigger required_write_scope_missing_from_goal_boundary.",
433+
"capability_bridge_repair": "Capability repair is allowed once workspace repair and self-repair are not; the capability bridge is repaired before delivery.",
434+
"control_plane_health_repair": "Stall repair raised by a health blocker; recommended_mode repair_control_plane_health. One of the five self-repair spend actions that stand in for the generic control_plane_repair.",
435+
"control_plane_projection_repair": "Stall repair for a lane left waiting with no owner projection; trigger waiting_without_owner_projection.",
436+
"control_plane_repair": "Existing result of quota_effective_action; previously missed because the literal scan did not inspect declared return functions.",
437+
"coordinate_task_bundle": "Replaces normal_run when a ready task-orchestration contract makes this lane the coordinator: admitted or explicitly selected peer lanes are activated or resumed before its own worker-lane delivery.",
438+
"external_evidence_observe": "An external-evidence monitor requires a read-only observation before any quiet no-op.",
439+
"governed_capability_intent": "A governed capability intent is pending. It is the only action that routes to capability_action_required, and only when the intent projection matches the envelope goal and agent and names a command; a mismatch is a contract_error instead.",
440+
"heartbeat_receipt_write_failed": "Writing the heartbeat receipt failed. The decision skips with state blocked_health and waits on the agent.",
441+
"heartbeat_settled_skip": "The current heartbeat identity is fully settled. The automation stays active but quiet so a new turn can select the successor, with no quota spend for the settled turn.",
442+
"lark_inbox_reply_due": "A direct Lark question, bot mention, or verified reply to the bot is pending a reply, and normal delivery is allowed for that reply.",
443+
"monitor_due": "A monitor poll is due; should_run and normal delivery follow the same monitor_due flag. Its not-due counterpart in the same branch is monitor_quiet_skip.",
444+
"monitor_quiet_skip": "A monitor poll that is not due. The scheduler maps it to a monitor wait, and it spends no quota.",
445+
"normal_run": "Normal delivery is allowed; the first branch of quota_effective_action. With delivery_allowed and must_attempt set it routes to ready_for_host.",
446+
"operator_gate_notify": "Existing result of quota_effective_action; previously missed because the literal scan did not inspect declared return functions.",
447+
"operator_inbox_material_review_due": "Captured operator-inbox material is pending bounded review, and normal delivery is allowed for that review.",
448+
"outcome_floor_recovery": "Normal delivery is refused but recovery delivery is allowed, through the quota safe bypass of kind outcome_floor_recovery.",
449+
"peer_coordination_blocked": "Peer coordination blocks this lane. The scheduler stops it rather than holding it in a monitor wait.",
450+
"quota_skip": "The final fallback of quota_effective_action: no delivery is allowed, no repair applies, and no more specific blocked state matched.",
451+
"runtime_user_gate_projection_repair": "A runtime capability user-gate projection needs repair; recommended_mode repair_user_gate_projection, blocked scope user_gate_projection.",
452+
"scoped_user_gate_fallback": "A scoped user-gate fallback applies while replan decisions are not allowed. It replaces quota_skip, monitor_quiet_skip or an absent action, and obliges one non-gated fallback segment after the user-gate notice.",
453+
"state_projection_gap_repair": "A state-projection gap on a candidate that should run or must attempt; trigger state_projection_gap.",
454+
"terminal_no_followup": "The Goal is terminal with no follow-up. The controller reads it as the terminal_action partition, so with no prior receipt the disposition is terminal, and the scheduler stops.",
455+
"throttled_skip": "Existing result of quota_effective_action; previously missed because the literal scan did not inspect declared return functions.",
456+
"todo_decision_scope_projection_repair": "A Todo user-gate scope is missing from the decision-scope projection; trigger user_gate_scope_projection_drift.",
457+
"unsettled_host_turn_recovery": "A host Turn is unsettled and must be recovered before anything else: the selected Todo and action portfolio are dropped, should_run is set, and normal, recovery and self-repair delivery are all refused."
458+
},
425459
"producers": [
426460
"loopx/cli_commands/quota.py::_apply_requested_quota_action_selection_preflight",
427461
"loopx/control_plane/quota/decision_summary.py::_task_orchestration_effective_action",
@@ -443,13 +477,6 @@
443477
"loopx/control_plane/todos/user_gate.py::apply_scoped_user_gate_fallback_projection"
444478
],
445479
"compatibility_only": {},
446-
"value_notes": {
447-
"blocked_health": "Existing result of quota_effective_action; previously missed because the literal scan did not inspect declared return functions.",
448-
"blocked_wait": "Existing result of quota_effective_action; previously missed because the literal scan did not inspect declared return functions.",
449-
"control_plane_repair": "Existing result of quota_effective_action; previously missed because the literal scan did not inspect declared return functions.",
450-
"operator_gate_notify": "Existing result of quota_effective_action; previously missed because the literal scan did not inspect declared return functions.",
451-
"throttled_skip": "Existing result of quota_effective_action; previously missed because the literal scan did not inspect declared return functions."
452-
},
453480
"return_producers": [
454481
"loopx/control_plane/quota/decision_summary.py::quota_effective_action",
455482
"loopx/control_plane/quota/decision_summary.py::_task_orchestration_effective_action"

‎tests/architecture/test_semantic_vocabulary_drift.py‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,3 +412,23 @@ def test_live_inventory_ignores_missing_or_stale_reports(tmp_path, monkeypatch,
412412
for name in ("first", "second")]
413413
with pytest.raises(smoke["Drift"], match="same_runtime_forks grew"):
414414
smoke["check_inventory"](registry, sources + duplicate)
415+
416+
417+
@pytest.mark.parametrize('name', ['effective_action', 'lease_action'])
418+
def test_remaining_kernel_values_each_carry_a_note(name):
419+
"""The two kernel vocabularies that are not Turn control flow still need notes.
420+
421+
``effective_action`` is the overloaded should-run slot M1 is due to split, so
422+
a value here is only legible once the registry says which condition produces
423+
it; ``lease_action`` is legacy and every value is compatibility-only, which
424+
is exactly the kind of disposition a reader cannot infer from the name. The
425+
note is required in the diff that adds a value, not afterwards.
426+
"""
427+
smoke = runpy.run_path(str(SMOKE))
428+
vocabulary = smoke['load_registry']()['vocabularies'][name]
429+
notes = vocabulary.get('value_notes', {})
430+
undocumented = [
431+
value for value in vocabulary['values']
432+
if not str(notes.get(value) or '').strip()
433+
]
434+
assert not undocumented, f'{name}: values with no value_notes entry: {undocumented}'

0 commit comments

Comments
 (0)