| name | shadow |
| description | Watch exactly one Codex session through one target-skill lens and emit only decision-relevant deltas. Use Tune's passive Seq skill-decision evidence definition for `$shadow $tune`; use for shadow/tail/follow/monitor one session, missed or contrary skill decisions, validation/outcome changes, worker decisions, or goal-cycle status. Do not scan broad history, inspect raw JSONL, create a second continual controller, or repeat full analysis when the cursor contains no new decision evidence. |
Shadow
Mission
$shadow is a one-session decision-delta filter.
No decision-relevant delta, no full report.
/goal owns continuation.
$shadow owns one current-cycle decision.
Required inputs
watched session id or path
target skill
mode: observe | propose | apply
watch objective
include workers: yes | no
prior cursor
Default:
mode = propose
include workers = no
Do not default the target skill to $tune.
Self-shadow guard
Bare:
$shadow $tune
with no distinct watched session or target concern is partial activation.
Emit one compact stop record.
Do not recursively shadow the current session.
Evidence source
Monitor the watched session only through $seq.
Preferred when target lens is $tune or when decision influence matters:
seq observe \
--definition <tune-skill-root>/definitions/seq/skill-decision-audit.json \
--projection evidence \
--root ~/.codex/sessions \
--session-id <session> \
--param needle=<target> \
--format json
Compare stable source-event and line positions with the prior cursor. Include
worker sessions only through an explicit parent/worker path from
seq session-graph.
Narrow physical follow-ups:
session-detail
turns
tool-lifecycle
session-graph
Use the smallest set required.
Do not inspect raw watched-session JSONL with shell, Python, jq, rg, cat, or tail.
If the passive definition cannot expose the required fact:
tooling_gap
seq_tuning_gap
state_unknown
and produce a bounded definition/operator-gap handoff when concrete.
Target skill contract
Read the target skill package outside the watched session evidence boundary:
SKILL.md
agents/openai.yaml
references/decision-contract.json
relevant references/scripts
If SKDC-v1 exists, preserve clause IDs.
If absent, use only a provisional contract and label it inferred.
Productive-cycle gate
A full report is allowed only when at least one is new:
target-skill activation evidence
decision episode
clause compliance/violation
validation failure
user feedback
worker decision
outcome reversal/reopen
watched session state change
prior finding falsified/resolved
explicit full-analysis request
Otherwise emit:
goal_skill_delta_record:
record_version: GSD-v2
cycle_result: status_only_stop
evidence_delta:
changed: no
decision_relevant: no
next_goal_action: stop-cycle
Do not restate unchanged findings.
Decision-aware cycle
When new evidence exists, classify:
trigger appeared
skill activated
decision changed
clause followed/violated
outcome changed
causality unknown
Do not treat a new tool call or message as decision-relevant by itself.
Goal Skill Delta Record
goal_skill_delta_record:
record_version: GSD-v2
goal_id:
cycle_id:
target_skill:
watched_session:
session_id_or_path:
cursor_start:
cursor_end:
state:
workers_included:
contract:
authority: explicit | inferred | absent
fingerprint:
evidence_delta:
changed: yes | no | unknown
new_activation_evidence: yes | no | unknown
new_decision_episodes: 0
new_clause_events: 0
new_validation_failure: yes | no | unknown
new_user_feedback: yes | no | unknown
new_worker_evidence: yes | no | unknown
new_outcome_event:
[]
[]
$tune handoff
When the target lens identifies a skill gap, prefer a small watched-session STE packet:
skill_tuning_evidence:
packet_version: STE-v1
target_skill:
window:
session_id:
cursor_start:
cursor_end:
decision_episodes: []
recurrent_gap_signatures: []
evidence_limitations: []
Do not infer historical recurrence from one watched session.
Modes
observe
Report evidence only.
propose
Default. Emit a tune packet or brief when the decision delta justifies it.
apply
Only when explicitly requested.
$shadow still does not edit the watched session or steer it.
Any target-skill edit follows that skill’s own apply boundary.
Worker sessions
Include workers only when:
- the user requests them;
- target decisions were delegated;
- the target skill requires worker evidence.
Require a parent/worker proof path.
Do not sweep corpus-wide workers.
Stop conditions
Stop the current cycle when:
no decision-relevant delta
watched session stopped
state unknown after one bounded follow-up
action requires approval
evidence insufficient
finding retired/transferred
Seq definition/operator gap
seq_definition_gap:
gap_version: SEQ-DEFINITION-GAP-v1
need:
watched_session:
target_skill:
missing_decision_evidence:
owning_definition:
missing_generic_operator:
bounds:
acceptance_criteria: []
validation_examples: []
The handoff must not request a skill-specific command, dataset, capability
flag, or semantic classifier in Seq.
Report
Shadowing:
- Session:
- Lens:
- Mode:
- State:
Cursor:
- Start:
- End:
- Delta:
Decision evidence:
- Activation:
- Episode:
- Clauses:
- Outcome:
- Strength:
Cycle result:
- Decision-relevant:
- Proposed delta:
- Next action:
Limitations:
Hard rules
- Exactly one root watched session.
$seq only for watched-session evidence.
- No raw JSONL inspection.
- No broad historical claims.
- No full report without decision-relevant delta.
- Raw mention is not activation.
- Activation is not influence.
- Influence is not causality.
- Do not edit in observe/propose.
- Do not promise background monitoring.