personal · tools

The Complete Story of the Engineering Journey System

65 days. 23 sessions. 9 architectural decisions. This is the complete story of how I built a system to stop losing context between AI sessions, and how it ended up documenting its own construction.

The Engineering Journey System (EJS) started as a frustration: every AI coding session began from scratch, losing all the reasoning, decisions, and dead ends from the sessions before. This post traces the full arc of building EJS, from the first decision to make interaction capture mandatory, through sub-agent blindness, SQLite-backed ADR indexing, a four-layer architecture, and 79% context reduction, all the way to a system that is now reusable, non-invasive, and provably works at scale.

Building the Engineering Journey System

Project: Engineering Journey System (EJS) Narrative spans: 2026-02-05 to 2026-04-10 (65 days) Sessions covered: 23 journey sessions ADRs documented: 9 architectural decisions (ADR 0010–0018) Primary human: @mcfuzzysquirrel Agents involved: GitHub Copilot (primary), explore agent, task agent, general-purpose agent


Prologue

The Engineering Journey System is both a documentation artifact and a philosophy. It captures the premise that how humans and AI agents collaborate is as important as what they build, and that this record becomes valuable infrastructure for the next session, the next developer, and the next agent. This story chronicles the journey of building EJS, which is also a test of the system it creates.


The Arc: Foundation (February 5–10)

@mcfuzzysquirrel began with a simple observation: collaboration between humans and agents was leaving an infrastructure gap. Decisions were being made, but the reasoning trail (the prompts, responses, outcomes, and alternatives considered) was being lost or reconstructed imperfectly from memory.

Session 1: Mandatory Interaction Capture (Feb 5)

The first decision was simple but crucial: make interaction capture mandatory in every Session Journey. @mcfuzzysquirrel noticed that journeys were missing a summary of the back-and-forth between human and agent. GitHub Copilot suggested updating the journey template and agent instructions to make the interaction trail explicit.

The insight: A short chronological summary of prompt-response-outcome pairs preserves the “why” without requiring full chat transcripts. This became a core EJS principle: be structured and machine-readable, but remain human-friendly.

ADR 0010 was created, capturing this as the foundation of the Engineering Journey System.

Session 2: Shift to Continuous Updates (Feb 7)

The second decision was architectural: shift from end-of-session reconstruction to start-of-session initialization with continuous updates.

@mcfuzzysquirrel provided evidence from another project (photo-jumper) showing that real-time documentation during multi-step sessions produced far better quality than end-of-session reconstruction. GitHub Copilot designed and implemented a three-phase lifecycle:

  • Phase 1 (Session Start): Initialize the journey file with metadata and problem statement
  • Phase 2 (During Session): Update incrementally as exchanges occur
  • Phase 3 (Session End): Finalize with coherent summaries and machine extracts

This change rippled through the entire EJS stack: agent profile, skill, instructions, and documentation all updated to reflect the new workflow. ADR 0011 documented this as a major process change validated by real-world evidence.

Session 3: Sub-Agent Decision Capture Protocol (Feb 10, Session 1)

When @mcfuzzysquirrel asked “How do we ensure sub-agents capture their decisions in multi-agent processes?”, GitHub Copilot identified a critical gap: sub-agents’ reasoning was lost. The agent delegated repository exploration to the explore sub-agent, which revealed the issue precisely: existing EJS contracts documented multi-agent scenarios but had no structured protocol for sub-agent decision capture or inter-agent handoff tracking.

GitHub Copilot designed a Sub-Agent Contributions section for the journey template with per-agent fields: task delegated, decisions made, alternatives considered, outcome, and handoffs to other agents. This was paired with a new machine extract (SUB_AGENT_EXTRACT) to enable downstream tools to analyze sub-agent collaboration patterns.

ADR 0012 captured this as a distinct decision category: sub-agent reasoning is as important as main-agent reasoning.

Session 4: 3D Asteroids Proof of Concept (Feb 10, Session 2)

To validate the Sub-Agent Decision Capture Protocol in a real scenario, @mcfuzzysquirrel asked GitHub Copilot to build a 3D Asteroids game using Babylon.js with multiple specialized sub-agents. The task naturally required:

  • explore agent: Game architecture design (single-file, procedural meshes, chase camera)
  • general-purpose agent: Complete game implementation (715-line index.html with SolidParticleSystem starfield, collision detection, wave progression)
  • task agent: Build validation (server setup, CDN verification)

The handoff chain was clean: explore agent’s design decisions → general-purpose agent used them as context → general-purpose agent’s implementation → task agent validated. Each sub-agent’s reasoning was captured as it happened. When the main agent discovered the CDN was blocked in the sandbox, it pivoted to local npm-installed Babylon.js files. The protocol captured that decision point precisely.

Result: The protocol worked. Sub-agent decisions, alternatives, and handoff chains were fully captured for the first time.


The Arc: Infrastructure (March 2–4)

Session 5: SQLite-Backed ADR Index (March 2)

As the number of ADRs and session journeys grew, @mcfuzzysquirrel identified a new constraint: agents reading full markdown files to reference past decisions consumed significant context window space. GitHub Copilot and the explore sub-agent designed a Python CLI tool using SQLite + FTS5 full-text search.

The implementation was pragmatic: a single scripts/adr-db.py file using only Python stdlib (sqlite3), with 8 commands (sync, list, get, search, summary, list-journeys, get-journey, summary-journeys).

But the implementation surfaced two subtle bugs:

  1. YAML octal parsing: PyYAML interprets zero-padded numbers like 0042 as octal (= 34). The fix: extract adr_id from raw frontmatter text.
  2. f-string regex conflict: Python f-strings consume {1,2} as format expressions. The fix: escape as {{1,2}}.

ADR 0013 documented this as a context-efficiency layer: agents could now query specific ADRs in 50–100 words instead of reading full 1,200+ word markdown files.

Session 6: Reframe as Observer (March 4)

GitHub Copilot raised a crucial contradiction: the EJS agent profile claimed implementation responsibility (“assist with implementation”, “propose solutions”) while the README described an observability layer. For a system designed to be bootstrapped into repos with existing agents, this was a false positioning.

@mcfuzzysquirrel agreed: EJS must be a non-competing observer/recorder, not an implementer.

GitHub Copilot researched the GitHub Copilot platform and discovered three tiers of adoption:

  • Tier 1 (always-on): Via .github/copilot-instructions.md (appended to existing), auto-injected into every interaction
  • Tier 2 (explicit invocation): User says “start EJS session” or explicitly selects the agent
  • Tier 3 (coordinator mode): EJS as orchestrator, delegating to specialized sub-agents

The implementation included bootstrap scripts (scripts/bootstrap-ejs.sh for bash, scripts/bootstrap-ejs.ps1 for PowerShell) that append the EJS recording contract to existing copilot-instructions.md files without replacing them.

Key learning: Custom agents cannot persist across agent switches. They are session-scoped. So Tier 1 (always-on via instructions) became the most reliable layer, supported by optional Tier 2/3 invocations.


The Arc: Platform Understanding (March 11–30)

Session 7: Agent vs. Skill Concepts (March 11)

@mcfuzzysquirrel asked GitHub Copilot to research whether EJS should use GitHub’s “agent” or “skill” concepts. The repository had 533 references to “agent” but 21 references to “skill”, with the skill files planned but unimplemented.

GitHub Copilot and the explore sub-agent discovered that GitHub explicitly designed these as complementary mechanisms:

  • Custom Instructions (.github/copilot-instructions.md): Always-on, lightweight behavior
  • Custom Agents (.github/agents/ejs-journey.agent.md): Manual selection, persona and coordination
  • Agent Skills (.github/skills/<name>/SKILL.md): Automatic loading, task-specific workflows

The research revealed GitHub’s official stance: use all three layers together, each for its purpose. ADR 0014 recorded the decision to implement both agents and skills.

Session 8: Research - Copilot Hooks Layer 0 (March 30, Session 1)

GitHub Copilot then investigated whether GitHub’s new Copilot Coding Agent hooks (.github/hooks/*.json) could address reliability gaps in EJS. These are platform-managed shell scripts that execute deterministically at defined points in an agent’s lifecycle (sessionStart, sessionEnd, subagentStop, userPromptSubmitted).

The key insight: deterministic ≠ semantic. Hooks excel at guaranteed structural tasks (file creation, DB sync), but cannot perform semantic tasks (understanding context, writing rationale, evaluating ADR rubrics). The recommendation: use hooks as a new Layer 0 below the existing instruction/skill/agent layers.

Session 9: Implement Copilot Hooks as Layer 0 (March 30, Session 2)

@mcfuzzysquirrel selected Option B: Lifecycle Bookends + Sub-Agent Capture, four hooks to handle session initialization, validation, and sub-agent event logging. ADR 0016 documented this as a layered reliability architecture:

Layer Mechanism Responsibility
0 Copilot hooks Guaranteed structure (file creation, DB sync, validation)
1 Always-on instructions Silent automatic recording
2 Skills Task-specific workflows (session init, wrap-up)
3 Agent Persona and coordination

The hooks layer guaranteed that every session would have a journey file scaffold and database sync, regardless of agent compliance.


The Arc: Simplification (March 13, and March 30–April 8)

Session 10: Research - Simplify Always-On Instructions (March 13, Part 1)

@mcfuzzysquirrel asked: could the EJS instruction surface be simplified? Measurements showed .github/copilot-instructions.md had grown to 112 lines (~940 words), consuming significant context budget in every agent interaction. And much of that content was duplicated across templates and skills.

GitHub Copilot quantified the redundancy and presented three options:

  • Option A (Micro-Instruction): Reduce to ~30 lines, move structural detail to templates
  • Option B (Consolidated): Merge skills into instructions (increases always-on context, rejected)
  • Option C (Hybrid): Micro-instruction + sub-agent delegation fragment

The recommendation: Option A + sub-agent fragment from Option C. Move from “tell agents everything they need to know” to “tell agents WHAT to capture and WHERE; templates define HOW.”

Session 11: Implement Micro-Instruction Simplification (March 13, Part 2)

GitHub Copilot executed a 5-phase implementation plan:

  1. Phase 1: Rewrote copilot-instructions.md from 112 lines to 33 lines (79% context reduction)
  2. Phase 2: Simplified the ejs-session-init skill by removing redundant DB-first protocol block
  3. Phase 3: Updated bootstrap scripts with new detection marker
  4. Phase 4: Updated README and session lifecycle patterns documentation
  5. Phase 5: Created ADR 0015

End result: The micro-instruction now covers 6 core EJS behaviors in ~197 words. The wrapup skill and templates carry all the procedural detail. ADR 0015 documented that 54/54 tests passed with zero regressions.

Session 12: Remove Git Hooks (April 8, Session 2)

With Copilot hooks now handling structural automation deterministically, the old git hooks (.githooks/post-commit, .githooks/pre-push) became redundant. They only reminded developers about missing journey files, something Copilot hooks now guaranteed.

@mcfuzzysquirrel made the architectural decision: remove the git hooks. When a deterministic platform mechanism supersedes an optional manual mechanism, keeping the manual one adds maintenance burden without value.

ADR 0017 documented this as a simplification that narrowed EJS’s scope: Copilot workflows only.


The Arc: Reinforcement (April 9–10)

Session 13: Research - JSON Journey Format (April 9, Session 1)

@mcfuzzysquirrel asked whether converting journey files to JSON would make EJS more efficient. The hypothesis: JSON is machine-friendly → easier parsing → less context.

GitHub Copilot systematically dismantled this hypothesis:

  • Measured JSON encoding overhead: 20–50% larger for equivalent narrative text
  • Confirmed SQLite database already has all query commands (sync, list, get, search, summary-journeys)
  • Found that summary-journeys truncates intent at 300 characters, which is insufficient for understanding sessions

The key insight: Format doesn’t matter for context efficiency. What matters is whether agents actually use the database. The DB abstraction layer decouples file format from query efficiency.

Rejection: Keep Markdown (human-readable). Recommendation: Add a richer story command that returns full intent (up to 400 chars) plus extracted decision and learning.

Session 14: Implement story Command (April 9, Session 2)

GitHub Copilot implemented the story command for adr-db.py. Per-session, it returns:

  • Session ID and date
  • Full intent (up to 400 chars)
  • Extracted first decision
  • Extracted first learning
  • ADR status if one was created

The implementation required careful regex work to handle variations in agent writing styles (e.g., **Technical insights:** with the closing ** after the colon). Four iterations refined the extraction logic until it worked cleanly on all 16 existing session files.

Updated copilot-instructions.md to reference story explicitly. DB-first is now actionable: agents know which command to run first.

Session 15: Create ADR 0018 (April 10, Session 1)

@mcfuzzysquirrel requested an ADR documenting all these changes. GitHub Copilot analyzed the diff from PR #19 (15 files modified, 1,558 insertions) and structured ADR 0018 around three related decisions that together reinforce the DB-first architecture:

  1. Reject JSON format migration (evidence-based, with measured overhead)
  2. Add story command (fills capability gap)
  3. Promote story in all documentation (makes rule actionable)

Key Learnings & Themes

Theme 1: Right Tool for Right Task

The architecture evolved to assign concerns to the right mechanism:

  • Hooks: Deterministic structure (emergence of Layer 0)
  • Instructions: Always-on awareness (Tier 1)
  • Skills: Task-specific workflows (automatic loading)
  • Agents: Persona and coordination (manual selection or Tier 2/3)

Each layer has a distinct responsibility. The cleanest architecture respects these boundaries.

Theme 2: Question Assumptions, Measure First

Multiple research sessions (JSON format, agent vs. skill) showed the value of asking “why?” and measuring before migrating:

  • JSON format looked promising but measured as 20–50% larger for text
  • SQLite database was already built. The gap was behavioral enforcement, not technology
  • “Format = efficiency” hypothesis broke under scrutiny; the DB abstraction layer delivered the real efficiency gain

Theme 3: Sub-Agent Blindness is Real

Sessions 3–4 and later session 9 revealed a structural problem: sub-agents don’t receive parent agent instructions, so their decisions vanish unless explicitly captured. The Sub-Agent Decision Capture Protocol (ADR 0012) and the subagentStop hook (ADR 0016) directly addressed this gap.

Theme 4: Simplification Through Separation of Concerns

The micro-instruction simplification (ADR 0015) succeeded because it applied a principle: instructions define behavior, templates define structure, skills provide detail. When each layer knew its job, redundancy fell away and the always-on context budget shrank 79%.

Theme 5: Platform Constraints Shape Architecture

Research into GitHub’s customization mechanisms (Session 7) revealed they were designed as three complementary layers, not alternatives. The three-tier adoption model (Session 6) and the four-layer stack (Session 9) emerged directly from understanding what the platform actually supports.


The Four-Layer Architecture in Final Form

By April 10, EJS had stabilized into a four-layer stack:

┌─────────────────────────────────────────────────┐
│ Layer 3: Agent (Persona & Coordination)          │
│ .github/agents/ejs-journey.agent.md              │
│ (Tier 2: Explicit invocation, Tier 3: Coordinator)
└─────────────────────────────────────────────────┘
                        ▲
┌─────────────────────────────────────────────────┐
│ Layer 2: Skills (Task-Specific Workflows)        │
│ .github/skills/ejs-session-init/SKILL.md         │
│ .github/skills/ejs-session-wrapup/SKILL.md       │
│ .github/skills/ejs-sub-agent-capture/SKILL.md    │
└─────────────────────────────────────────────────┘
                        ▲
┌─────────────────────────────────────────────────┐
│ Layer 1: Instructions (Always-On Recording)      │
│ .github/copilot-instructions.md (33 lines)       │
│ (Tier 1: Always-on via copilot-instructions)    │
└─────────────────────────────────────────────────┘
                        ▲
┌─────────────────────────────────────────────────┐
│ Layer 0: Hooks (Guaranteed Structure)            │
│ .github/hooks/ejs-hooks.json                     │
│ sessionStart, sessionEnd, subagentStop,          │
│ userPromptSubmitted (shell scripts)              │
└─────────────────────────────────────────────────┘

Each layer has a distinct mechanism:

  • Layer 0: Deterministic, platform-managed, runs regardless of agent compliance
  • Layer 1: LLM-based, silent, always-on for every interaction
  • Layer 2: LLM-based, auto-loading when relevant, encapsulates multi-step workflows
  • Layer 3: LLM-based, persona, explicit invocation or coordination

Supporting Infrastructure

  • SQLite Database (scripts/adr-db.py): Context-efficient query interface with story as primary command
  • Bootstrap Scripts: bootstrap-ejs.sh (bash) and bootstrap-ejs.ps1 (PowerShell), which enable non-competitive adoption into existing repos
  • Journey Template & ADRs: Document decisions, alternatives, and learnings
  • Session Lifecycle Patterns: Guide agents on when/how to record

Where It Stands (April 10, 2026)

@mcfuzzysquirrel and GitHub Copilot have built infrastructure that captures the entire evolution of itself. Each decision is documented with alternatives, rationale, consequences, and learnings. Sub-agents’ contributions are tracked. The system is layered, with each layer knowing its job. Context efficiency has been optimized through separation of concerns. The always-on instruction budget was cut 79% while preserving all functionality.

The 3D Asteroids game validated the core assumption: humans and agents can collaborate on non-trivial work while capturing the full reasoning trail. The SQLite database proved agents can query past decisions efficiently without reading full markdown files. The Copilot hooks proved that deterministic layer 0 guarantees can sit beneath semantic layers 1–3 without interference.

The system is also designed for reuse. The bootstrap scripts allow other repositories to adopt EJS layering into their existing instruction and agent setup. The research documents and ADRs provide evidence-based rationale for every major decision, so future agents (and humans) can understand what was built and why.


Epilogue: The Meta-Journey

The Engineering Journey System was built by capturing its own engineering journey. This story is itself an artifact of the system, extracted from 23 journey sessions, 9 ADRs, and the SQLite database that indexes them all. That the narrative can be queried and generated from structured data is the point.

The hypothesis worked: infrastructure for capturing human-agent collaboration can be lightweight, reusable, and non-invasive. It can be layered from deterministic platform mechanisms (hooks) up through semantic AI reasoning (agents and skills). It also works at scale, from a single decision in a single session to a complete project history across dozens of sessions and multiple specialized agents.

On April 10, @mcfuzzysquirrel sat at a significant waypoint. The EJS foundation was solid. The question for the next phase is how far it can scale, and whether the patterns discovered here transfer to larger teams, more complex workflows, and agents beyond Copilot.


Quick Reference: The Nine Decisions (ADRs 0010–0018)

# Title Date Status Core Decision
0010 Adopt Engineering Journey System 2026-02-05 Accepted Structured session journeys capture collaboration, decisions, and learnings
0011 Start-of-Session Continuous Updates 2026-02-07 Accepted Real-time capture superior to end-of-session reconstruction
0012 Sub-Agent Decision Capture Protocol 2026-02-10 Accepted Sub-agent decisions need their own section + structured capture
0013 SQLite-Backed ADR Index 2026-03-02 Accepted Database for efficient queries; agents use story not raw files
0014 Agent Skills for Session Lifecycle 2026-03-11 Accepted Use agents + skills as complementary layers (both, not either/or)
0015 Micro-Instruction Simplification 2026-03-13 Accepted Reduce always-on context 79%; templates carry structural detail
0016 Copilot Hooks as Layer 0 2026-03-30 Accepted Deterministic platform hooks layer beneath semantic agent layers
0017 Remove Git Hooks 2026-04-08 Accepted Copilot hooks fully supersede git hooks; remove redundancy
0018 Story Command & DB-First Reinforcement 2026-04-09 Accepted Reject JSON format; add story command; promote DB-first order

Narrative compiled: April 10, 2026
Summary: 65 days, 23 sessions, 9 decisions, 4-layer architecture, ready for scale.