Skip to main content

Module turn_scope

Module turn_scope 

Source
Expand description

§Module: turn_scope

TurnScope manifest — phase 2 of the operation-scoped drift model (#op-scoped-drift-2, tasks/agent-doc/plan-operation-scoped-drift.md).

§Spec

  • An Address names an addressable location in the document: a component occurrence, optionally narrowed to a specific node key. A node_key of None is a whole-component address.
  • A TurnScope is the operation manifest for the current turn: the driver node it is answering, the read_set it depends on, and the write_set it will mutate. It is emitted at turn start from preflight prompt_targets.
  • TurnScope::for_driver builds the canonical scope: read {driver, exchange tail}; write {exchange append, driver strike, backlog, status, review, done/archive, gitlink, editor writeback}. The driver also appears in the write set because the turn strikes the queue item it consumes.

§Agentic Contracts

  • The manifest is the substrate the phase-3 affectedness classifier reads; phase 2 only emits it. It never blocks a cycle.
  • When no driver node resolves (a non-queue prompt), driver is None and the sets cover only the output components every turn touches.

Structs§

Address
An addressable location in the document.
ClassifiedOp
One classified operation in a cycle’s affectedness summary.
CycleAffectedness
Aggregate affectedness of a cycle’s operations against the turn scope.
TurnScope
The operation manifest for the current turn.

Enums§

AffectednessClass
The effect class an incoming operation has on the current turn (#op-scoped-drift-3). Mirrors the 5-class taxonomy in the plan.

Constants§

COMPONENT_BACKLOG
COMPONENT_DONE
COMPONENT_DONE_ARCHIVE
COMPONENT_EDITOR_WRITEBACK
COMPONENT_EXCHANGE
COMPONENT_GITLINK
COMPONENT_QUEUE
COMPONENT_REVIEW
COMPONENT_STATUS
MANAGED_CONFLICT_COMPONENTS
All managed surfaces that can participate in conflict classification.
MANAGED_OUTPUT_COMPONENTS
Managed output surfaces a turn may mutate.

Functions§

classify_cycle
Classify every op in a cycle against the turn scope, routing the coarse all-drift-is-affecting assumption into the 5-class taxonomy. Independent and provenance-spoofed ops do not affect the turn.
classify_op
Classify a single operation against the current turn scope.
op_address
The component-occurrence-narrowed address of a durable op.