name: y-summary-codex description: Summarize Codex session JSONL logs into y-schema SummaryRoot outputs with evidence mapping and validation, then attach the summary as a git note under y-codex-session-summary. Use for building or updating the Codex session summarization pipeline or when asked to transform a Codex session log into structured summary artifacts.
y-summary-codex
Purpose
Build the summarization pipeline that reads Codex session .jsonl logs and emits validated SummaryRoot JSON, then attaches the final summary as a git note in namespace y-codex-session-summary.
Inputs
- Session log path (absolute or relative to
~/.codex/sessions). - Output directory for
summary.json.
Non-negotiable Guardrails
- YOU must NOT summarize your own progress creating the summary of the work you are reviewing.
- YOU must only summarize the work performed in the session being reviewed.
Required Workflow
Follow these steps in order and keep outputs deterministic.
- Parse session JSONL
- Read line-delimited JSON.
- Normalize core event model: timestamp, type, actor/source, payload, call id, line index.
- Preserve order using
(timestamp, line_index).
- Build evidence map first
- Create deterministic evidence IDs from
(timestamp, event_type, snippet, line_index). - Store evidence tuples with: timestamp, event, snippet, source.
- Do not use assistant reasoning as sole evidence for facts.
- Extract all 11 sections
- Implement extractors using the methods in
references/section-methods.md. - Preserve fact vs inference (set
basisaccordingly). - Every evidence-backed claim must include
evidence_refs. - If data is missing, emit empty structures (not omitted) with low-confidence claims only when explicitly allowed.
- Assemble SummaryRoot
- Set
schema_versiontoy-schema::CURRENT_SCHEMA_VERSION. - Populate all sections (never omit required sections).
- Link evidence by ID only.
- Validate before writing outputs
- Use
y-schema::parse_summaryorvalidate_summaryand fail with actionable errors (JSON path + reason). - Prefer
validate_summaryfor multi-error reporting. - Always run the CLI validator
y validate summaryagainst the final JSON before writing the git note. - If CLI validation fails, stop and surface the error paths; do not write outputs or notes.
- Keep library validation too; CLI validation is the required final gate.
- Write summary.json
- Write
summary.jsonfromSummaryRootonly. - Do not emit human-readable outputs unless explicitly requested by the user.
- Attach git note
- Write the final summary JSON or a compact pointer (see
references/output-contract.md) as a git note under namespacey-codex-session-summary. - Use existing git helper in
/Users/ramos/yapp/y/src/git.rsif applicable.
Determinism Rules
- Sort lists by first evidence timestamp, then stable tie-breaker (line index or path).
- Hash-based IDs must be reproducible from content, not random.
- Avoid nondeterministic iteration over hash maps.
When to read extra references
- Use
references/section-methods.mdfor extraction heuristics and section-specific rules. - Use
references/output-contract.mdfor output formatting and inbox summary structure. - Use
/Users/ramos/yapp/y-skills/y-search-codex/SKILL.mdif you need to locate or search sessions.