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
3 changes: 3 additions & 0 deletions .github/workflows/full-public-smokes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ jobs:
- name: Install smoke runtime dependencies
run: python -m pip install --disable-pip-version-check "jsonschema>=4.23,<5"

- name: Install locked TypeScript parser for semantic production checks
run: npm ci --ignore-scripts

- name: Preview full-public shard
run: |
python3 examples/run-smokes.py \
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ goals/**/ACTIVE_GOAL_STATE.md
goals/**/ACTIVE_GOAL_STATE.md.lock
/runtime/
logs/

# Legacy semantic census reports are derived locally, never repository authority.
/loopx/semantics/inventory_v0.json
368 changes: 264 additions & 104 deletions docs/architecture/rfcs/semantic-vocabulary-convergence-v0.md

Large diffs are not rendered by default.

301 changes: 217 additions & 84 deletions docs/architecture/rfcs/semantic-vocabulary-convergence-v0.zh-CN.md

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions docs/development/testing-and-quality.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,17 @@ uv run --extra test python -m pytest -q
uv run --extra test loopx canary premerge --from-git-diff
# For a fork whose PR base is upstream/main, use this instead:
uv run --extra test loopx canary premerge --from-git-diff --git-diff-base upstream/main
# Run one semantic smoke or check its generated inventory:
# Validate semantics; optionally inspect the full-tree inventory without writing it:
uv run --extra test loopx canary smoke-suite --script semantic-vocabulary-drift-smoke.py
uv run python scripts/generate_semantic_inventory.py --check
uv run python scripts/generate_semantic_inventory.py
git diff --check
```

The semantic inventory is computed from the full tracked tree, not committed.
Use `--output .local/semantic-inventory.json` only when an exported report is useful;
`--output <path> --check` checks that explicit report without repairing it.
词表、owner 与预算继续入库并受检查;结构清单按需计算,无须为普通 PR 补生成文件。

Confirm the interpreter and imported checkout when diagnosing a mismatch:

```bash
Expand Down
22 changes: 22 additions & 0 deletions docs/reference/effect-interpreter-packet.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,28 @@ decision or turn-settlement logic; they give refactor and test code one
stable abstraction for reading the effect program shape across packet
families.

The action slot depends on the packet family:

| Observation | Verdict | `effective_action` |
| --- | --- | --- |
| Quota should-run | Quota decision | Existing decision/frontier action string |
| Turn result | `decision` carries `result_kind` | Always JSON `null` / Python `None` |
| Journal replay | `replay_legal` or `replay_blocked` | Omitted from the internal replay observation |

Turn-result readers must use `decision` for the result verdict. The result lens
ignores a host-supplied action; it cannot create a quota decision. The TS result
type fixes its action to null, while the generic quota type retains its default
string action. This changes the transient result projection, not persisted
host results, receipts, or journal plans. See the
[semantic vocabulary RFC](../architecture/rfcs/semantic-vocabulary-convergence-v0.md#m1-action-domains-and-compatibility)
for the versioned frontier migration and its compatibility boundary.

动作槽位按 packet family 区分:quota 保留决策/前沿动作字符串;Turn result 的
判决从 `decision` 读取,`effective_action` 固定为 `null`(Python 为 `None`);
journal replay 使用自己的判决,不再输出动作字段。host 提供的 action 不会被
解释为 quota 决策。这只改变瞬时结果投射,不重写落盘的 host result、receipt
或 journal plan。

## Turn Journal Lens

`interpret_turn_journal` reads an existing fenced Turn journal and returns an
Expand Down
246 changes: 246 additions & 0 deletions docs/reference/glossary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
# Semantic Vocabulary Glossary / 语义词表

<!-- Generated by scripts/generate_semantic_bindings.py; do not edit. -->

This is a generated view of the curated registry, not another authority.
这是注册表的生成视图;修改定义应编辑 owner 和注册表,然后重新生成。

Equal spellings or value sets do not prove equal meaning. Producers write
values; consumers interpret or pass them through; only owners define sets.
同名或相同值集不等于同一语义。生产者写值,消费者解释或透传,owner 定义集合。

See the [RFC](../architecture/rfcs/semantic-vocabulary-convergence-v0.md)
and its [中文版本](../architecture/rfcs/semantic-vocabulary-convergence-v0.zh-CN.md)
for scope, compatibility, proof boundaries and migration gates.

## agent_scope_frontier_action

Frontier verdict for an agent-scoped lane. New v1 payloads use agent_scope_frontier.action; the root should-run effective_action projects the same value through its registered disjoint union. Legacy v0 signed payloads remain readable without rewriting.

- Tier / 层级: `kernel`; status / 状态: `canonical`.
- python: [`AgentScopeFrontierAction`](../../loopx/control_plane/agents/agent_scope_frontier.py).
- typescript: [`AGENT_SCOPE_FRONTIER_ACTIONS`](../../loopx/control_plane/agents/agent_scope_frontier.generated.ts).
- Values / 值: `agent_scope_exhausted`, `agent_scope_wait`, `reassignment_required`, `successor_replan_required`.

## delivery_continuity_preemption

Reason a delivery continuity is preempted.

- Tier / 层级: `cross_runtime`; status / 状态: `canonical`.
- python: [`DELIVERY_CONTINUITY_PREEMPTIONS`](../../loopx/control_plane/turn_driver/delivery_continuity.py).
- typescript: [`DELIVERY_CONTINUITY_PREEMPTIONS`](../../loopx/control_plane/turn_driver/delivery_continuity.ts).
- Values / 值: `heartbeat_receipt`, `blocking_work_lane`, `autonomous_replan`, `control_repair`, `delivery_not_allowed`.

## delivery_outcome

Outcome class of a delivered work item.

- Tier / 层级: `cross_runtime`; status / 状态: `canonical`.
- python: [`DeliveryOutcome`](../../loopx/control_plane/work_items/delivery_outcome.py).
- typescript: [`DELIVERY_OUTCOMES`](../../loopx/control_plane/work_items/delivery_outcome.ts).
- Values / 值: `surface_only`, `outcome_gap`, `outcome_progress`, `primary_goal_outcome`.

## delivery_workspace_identity_kind

How a delivery workspace is identified.

- Tier / 层级: `cross_runtime`; status / 状态: `canonical`.
- python: [`DELIVERY_WORKSPACE_IDENTITY_KINDS`](../../loopx/control_plane/agents/delivery_workspace.py).
- typescript: [`DELIVERY_WORKSPACE_IDENTITY_KINDS`](../../loopx/control_plane/agents/delivery_workspace.ts).
- Values / 值: `git_repository`, `local_goal`.

## delivery_workspace_kind

Workspace kind a delivery runs in.

- Tier / 层级: `cross_runtime`; status / 状态: `canonical`.
- python: [`DELIVERY_WORKSPACE_KINDS`](../../loopx/control_plane/agents/delivery_workspace.py).
- typescript: [`DELIVERY_WORKSPACE_KINDS`](../../loopx/control_plane/agents/delivery_workspace.ts).
- Values / 值: `canonical_checkout`, `independent_git_worktree`, `local_goal_workspace`.

## delivery_workspace_requirement

Workspace requirement a settlement asserts before delivery.

- Tier / 层级: `cross_runtime`; status / 状态: `canonical`.
- python: [`DELIVERY_WORKSPACE_REQUIREMENTS`](../../loopx/control_plane/quota/settlement_workspace_causality.py).
- typescript: [`DELIVERY_WORKSPACE_REQUIREMENTS`](../../loopx/control_plane/quota/settlement_workspace_causality.ts).
- Values / 值: `required`, `not_required`, `unknown`.

## effective_action

Compacted should-run verdict carried by status/should-run payloads and the Turn Envelope; the Python enum owns the finite value domain while the wire field remains a string for compatibility.

- Tier / 层级: `kernel`; status / 状态: `merge_candidate`.
- python: [`EffectiveAction`](../../loopx/control_plane/quota/effective_action.py).
- typescript: [`EFFECTIVE_ACTIONS`](../../loopx/control_plane/quota/effective_action.generated.ts).
- Values / 值: `agent_monitor_only`, `agent_workspace_repair`, `automation_prompt_upgrade_required`, `autonomous_replan_required`, `blocked_health`, `blocked_wait`, `boundary_projection_repair`, `capability_bridge_repair`, `control_plane_health_repair`, `control_plane_projection_repair`, `control_plane_repair`, `coordinate_task_bundle`, `external_evidence_observe`, `governed_capability_intent`, `heartbeat_receipt_write_failed`, `heartbeat_settled_skip`, `lark_inbox_reply_due`, `monitor_due`, `monitor_quiet_skip`, `normal_run`, `operator_gate_notify`, `operator_inbox_material_review_due`, `outcome_floor_recovery`, `peer_coordination_blocked`, `quota_skip`, `runtime_user_gate_projection_repair`, `scoped_user_gate_fallback`, `state_projection_gap_repair`, `terminal_no_followup`, `throttled_skip`, `todo_decision_scope_projection_repair`, `unsettled_host_turn_recovery`.

## goal_amendment_class

Class of a proposed Goal amendment.

- Tier / 层级: `cross_runtime`; status / 状态: `canonical`.
- python: [`GOAL_AMENDMENT_CLASSES`](../../loopx/control_plane/goals/goal_amendment_proposal.py).
- typescript: [`GOAL_AMENDMENT_CLASSES`](../../loopx/control_plane/goals/goal_amendment_proposal.ts).
- Values / 值: `lane_route`, `shared_work_graph`, `shared_acceptance`, `protected_authority`.

## goal_amendment_proposal_admission

Admission verdict for a Goal amendment proposal.

- Tier / 层级: `cross_runtime`; status / 状态: `canonical`.
- python: [`GOAL_AMENDMENT_PROPOSAL_ADMISSIONS`](../../loopx/control_plane/goals/goal_amendment_proposal.py).
- typescript: [`GOAL_AMENDMENT_PROPOSAL_ADMISSIONS`](../../loopx/control_plane/goals/goal_amendment_proposal.ts).
- Values / 值: `admitted`, `needs_rebase`.

## goal_amendment_proposal_admission_fact

Fact recorded with a Goal amendment admission verdict.

- Tier / 层级: `cross_runtime`; status / 状态: `canonical`.
- python: [`GOAL_AMENDMENT_PROPOSAL_ADMISSION_FACTS`](../../loopx/control_plane/goals/goal_amendment_proposal.py).
- typescript: [`GOAL_AMENDMENT_PROPOSAL_ADMISSION_FACTS`](../../loopx/control_plane/goals/goal_amendment_proposal.ts).
- Values / 值: `base_state_event_basis_sequence_behind_derived_head`, `base_source_basis_digest_mismatch`, `base_source_basis_unverifiable`, `base_revision_basis_superseded`.

## handoff_mode

Authority handoff mode between agents.

- Tier / 层级: `cross_runtime`; status / 状态: `canonical`.
- python: [`HandoffMode`](../../loopx/control_plane/coordination/authority_core.py).
- typescript: [`HANDOFF_MODES`](../../loopx/control_plane/coordination/handoff_mode_policy.ts).
- Values / 值: `legacy`, `soft_claim`, `hard_lease`.

## lease_action

Authority-core lease mutation verb.

- Tier / 层级: `kernel`; status / 状态: `legacy`.
- python: [`LeaseAction`](../../loopx/control_plane/coordination/authority_core.py).
- Values / 值: `acquire`, `renew`, `transfer`, `release`.
- Compatibility only / 兼容保留: `acquire`, `release`, `renew`, `transfer`.

## loop_disposition

Pure controller verdict for the outer loop after combining the last Turn receipt with the fresh route.

- Tier / 层级: `kernel`; status / 状态: `canonical`.
- python: [`LoopDisposition`](../../loopx/control_plane/turn_driver/loop_controller.py).
- Values / 值: `run_now`, `capability_action_required`, `wait`, `stop`, `user_action_required`, `repair`, `replan`, `terminal`.

## receipt_bound_monitor_phase

Receipt-bound phase of a monitor poll settlement.

- Tier / 层级: `cross_runtime`; status / 状态: `canonical`.
- python: [`ReceiptBoundMonitorPhase`](../../loopx/control_plane/effect_program.py).
- typescript: [`RECEIPT_BOUND_MONITOR_PHASES`](../../loopx/control_plane/quota/settlement_phase.ts).
- Values / 值: `poll_due`, `settlement_pending`, `settled`.

## receipt_bound_replay_phase

Receipt-bound phase of a Turn journal replay settlement.

- Tier / 层级: `cross_runtime`; status / 状态: `canonical`.
- python: [`ReceiptBoundReplayPhase`](../../loopx/control_plane/effect_program.py).
- typescript: [`RECEIPT_BOUND_REPLAY_PHASES`](../../loopx/control_plane/quota/settlement_phase.ts).
- Values / 值: `open`, `settlement_pending`, `settled`.

## scheduler_cadence_transition

Legal scheduler cadence state transition.

- Tier / 层级: `cross_runtime`; status / 状态: `canonical`.
- python: [`SchedulerCadenceTransition`](../../loopx/control_plane/scheduler/state_transition_rules.py).
- typescript: [`SCHEDULER_CADENCE_TRANSITIONS`](../../loopx/control_plane/scheduler/state_transition_rules.ts).
- Values / 值: `initial`, `identity_reset`, `retry_unacknowledged_failure`, `hold_active_initial`, `advance_after_interval`, `hold_until_interval`.

## scheduler_host_transition

Legal scheduler host state transition.

- Tier / 层级: `cross_runtime`; status / 状态: `canonical`.
- python: [`SchedulerHostTransition`](../../loopx/control_plane/scheduler/state_transition_rules.py).
- typescript: [`SCHEDULER_HOST_TRANSITIONS`](../../loopx/control_plane/scheduler/state_transition_rules.ts).
- Values / 值: `apply_required`, `host_match_ack_required`, `recorded_failure_suppressed`, `settled`.

## settlement_binding_kind

How a settlement step binds to its receipt.

- Tier / 层级: `cross_runtime`; status / 状态: `canonical`.
- python: [`SettlementBindingKind`](../../loopx/control_plane/effect_program.py).
- typescript: [`SETTLEMENT_BINDING_KINDS`](../../loopx/control_plane/effect_program.ts).
- Values / 值: `todo`, `autonomous_replan`, `unbound`.

## settlement_failure_kind

Typed failure class of a settlement step.

- Tier / 层级: `cross_runtime`; status / 状态: `canonical`.
- python: [`SettlementFailureKind`](../../loopx/control_plane/effect_program.py).
- typescript: [`SETTLEMENT_FAILURE_KINDS`](../../loopx/control_plane/effect_program.ts).
- Values / 值: `invalid_identity`, `receipt_missing`, `identity_mismatch`, `writeback_missing`, `writeback_rejected`, `quota_spend_rejected`, `terminal_closeout_rejected`, `cancelled`, `permission_denied`, `budget_rejected`, `effect_outcome_unknown`.

## settlement_step_kind

Effect-program settlement step executed for one Turn.

- Tier / 层级: `cross_runtime`; status / 状态: `canonical`.
- python: [`SettlementStepKind`](../../loopx/control_plane/effect_program.py).
- typescript: [`SETTLEMENT_STEP_KINDS`](../../loopx/control_plane/effect_program.ts).
- Values / 值: `validation`, `durable_writeback`, `quota_spend`, `terminal_closeout`.

## todo_completion_continuation

Continuation declared by a completing Todo.

- Tier / 层级: `cross_runtime`; status / 状态: `canonical`.
- python: [`TodoCompletionContinuation`](../../loopx/control_plane/todos/completion_state.py).
- typescript: [`TODO_COMPLETION_CONTINUATIONS`](../../loopx/control_plane/todos/completion_state.ts).
- Values / 值: `active_goal`, `successor`, `no_followup`.

## todo_completion_recovery

Recovery path when a Todo completion cannot continue.

- Tier / 层级: `cross_runtime`; status / 状态: `canonical`.
- python: [`TodoCompletionRecovery`](../../loopx/control_plane/todos/completion_state.py).
- typescript: [`TODO_COMPLETION_RECOVERIES`](../../loopx/control_plane/todos/completion_state.ts).
- Values / 值: `same_turn_terminal_closeout`, `lifecycle_reentry_terminal_closeout`.

## todo_decision_scope_granularity

Granularity of a Todo decision scope.

- Tier / 层级: `cross_runtime`; status / 状态: `canonical`.
- python: [`TODO_DECISION_SCOPE_GRANULARITY_VALUES`](../../loopx/control_plane/todos/contract.py).
- typescript: [`TODO_DECISION_SCOPE_GRANULARITIES`](../../loopx/control_plane/todos/decision_metadata.ts).
- Values / 值: `action`, `lane`, `goal`, `project`, `global`.

## todo_decision_scope_kind

Scope kind of a Todo decision.

- Tier / 层级: `cross_runtime`; status / 状态: `canonical`.
- python: [`TODO_DECISION_SCOPE_KIND_VALUES`](../../loopx/control_plane/todos/contract.py).
- typescript: [`TODO_DECISION_SCOPE_KINDS`](../../loopx/control_plane/todos/decision_metadata.ts).
- Values / 值: `private_read`, `write_scope`, `resource`, `production`, `public_claim`, `direction`, `other`.

## turn_result_kind

Typed public outcome of one executed Turn as settled by the Turn Journal.

- Tier / 层级: `kernel`; status / 状态: `canonical`.
- python: [`LoopXTurnResultKind`](../../loopx/control_plane/turn_driver/transaction.py).
- typescript: [`TURN_RESULT_KINDS`](../../loopx/control_plane/turn_driver/settlement.ts).
- Values / 值: `validated_progress`, `validated_completion`, `repair_required`, `replan_required`, `user_action_required`, `wait`, `iteration_failed`, `host_failure`, `validation_failed`, `writeback_failed`, `quota_spend_failed`, `terminal_closeout_failed`.

## turn_route

Typed delivery route derived from a fresh should-run decision before a Host is engaged.

- Tier / 层级: `kernel`; status / 状态: `canonical`.
- python: [`LoopXTurnRoute`](../../loopx/control_plane/turn_driver/driver.py).
- Values / 值: `ready_for_host`, `capability_action_required`, `repair_required`, `replan_required`, `user_action_required`, `wait`, `blocked`, `contract_error`.
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,9 @@ def assert_agent_scope_frontier_builder_contract() -> None:
extra_fields={"cleared_without_successor_handoff_gates": [{"todo_id": "todo_gate"}]},
)

assert payload["schema_version"] == "agent_scope_frontier_v0"
assert payload["schema_version"] == "agent_scope_frontier_v1"
assert payload["action"] == "successor_replan_required"
assert payload["effective_action"] == payload["action"]
assert "effective_action" not in payload
assert payload["blocks_delivery"] is True
assert payload["requires_replan"] is True
assert payload["quiet_noop_allowed"] is False
Expand Down Expand Up @@ -302,7 +302,7 @@ def assert_agent_scope_frontier_and_hint_contract() -> None:
)

assert frontier is not None, frontier
assert frontier["schema_version"] == "agent_scope_frontier_v0"
assert frontier["schema_version"] == "agent_scope_frontier_v1"
assert frontier["action"] == "successor_replan_required"
assert frontier["requires_replan"] is True
assert frontier["quiet_noop_allowed"] is False
Expand Down
13 changes: 7 additions & 6 deletions examples/control_plane/work-lane-contract-smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@
sys.path.insert(0, str(SMOKE_DIR))
sys.path.insert(0, str(REPO_ROOT))

from loopx.control_plane.scheduler.execution_context import (
from loopx.control_plane.scheduler.execution_context import ( # noqa: E402 - standalone smoke bootstraps repo imports
SchedulerRuntimeProfile,
scheduler_execution_context_for_runtime_profile,
)
from loopx.control_plane.todos.contract import (
from loopx.control_plane.todos.contract import ( # noqa: E402 - standalone smoke bootstraps repo imports
TODO_TASK_CLASS_ADVANCEMENT,
TODO_TASK_CLASS_MONITOR,
)
from loopx.quota import (
from loopx.quota import ( # noqa: E402 - standalone smoke bootstraps repo imports
build_quota_should_run as _build_quota_should_run,
render_quota_should_run_markdown,
)
from loopx.status import (
from loopx.status import ( # noqa: E402 - standalone smoke bootstraps repo imports
compact_todo_group,
compact_post_handoff_run,
normalize_todo_task_class,
)
from work_lane_contract_fixtures import (
from work_lane_contract_fixtures import ( # noqa: E402 - standalone smoke bootstraps repo imports
FUTURE_DUE_AT,
GOAL_ID,
PAST_DUE_AT,
Expand Down Expand Up @@ -1393,8 +1393,9 @@ def assert_peer_requires_reassignment_when_only_other_peer_has_claimed_work() ->
assert guard["effective_action"] == "reassignment_required", guard
assert "agent_lane_next_action" not in guard, guard
frontier = guard["agent_scope_frontier"]
assert frontier["schema_version"] == "agent_scope_frontier_v0", frontier
assert frontier["schema_version"] == "agent_scope_frontier_v1", frontier
assert frontier["action"] == "reassignment_required", frontier
assert "effective_action" not in frontier, frontier
assert frontier["agent_id"] == "codex-side-bypass", frontier
assert "primary_agent" not in frontier, frontier
assert frontier["candidate_counts"]["current_agent_claimed_advancement_count"] == 0, frontier
Expand Down
Loading
Loading