Skip to main content
Version: 3.0.1

LLM Execution Model

How LLMs and humans collaborate on documentation updates.


Principle: LLM-Driven, Human-in-the-Loop

Default: LLM executes autonomously using code, docs, and patterns as sources of truth.

Human involvement: Only for review gates and high-value questions that can't be answered from available sources.


When LLM Proceeds Autonomously

LLM Can Execute Without Human

TaskSources LLM Uses
Identify code changesgit diff, git log
Map changes to SRS domainsDomain mappings (archived: PASS_C_DOMAIN_MAPPING.md)
Extract inventories (schema, events, jobs)Code analysis
Write new requirementsSRS templates + code analysis
Update SDD sectionsExisting SDD patterns + code analysis
Update code_tags.jsoncode_tags.json structure + existing entries
Add Implementation sectionsCode boundary analysis
Run validation scriptsAutomated checks
Create Change Manifestsgit + PRD analysis

LLM Decision Framework

Can I find the answer in code? -> Yes -> Proceed
Can I find the answer in existing docs? -> Yes -> Proceed
Is this a pattern we've established? -> Yes -> Apply pattern
Does this require product/business context? -> Yes -> Ask human
Is this a subjective/policy decision? -> Yes -> Ask human

When to Involve Human

Review Gates (Human Must Approve Before Continuing)

GateWhat Human ReviewsWhen
Change ManifestCompleteness, missed itemsAfter Phase 1
Impact AnalysisCorrect SRS/SDD mappingAfter Phase 2
New RequirementsStatement, ACs make senseAfter Phase 3
Architecture ChangesDesign decisionsAfter Phase 4
Final ValidationSign-off on releaseAfter Phase 7

Escalation Triggers (LLM Asks Human)

SituationExampleWhat to Ask
Business logic unclear"Why does this rule exist?""What is the business reason for X?"
Conflicting sourcesCode does X, doc says Y"Which is correct: code or doc?"
Missing contextNo doc or code explains behavior"What should happen when X?"
Policy decisionMultiple valid approaches"Which approach do you prefer?"
External knowledgeCustomer requirement, compliance"Is there a constraint I should know?"
Deprecation decisionsShould feature be removed?"Confirm deprecation of X?"

What NOT to Ask Human

Don't AskWhyLLM Should Instead
"Is this requirement format correct?"Template existsFollow SRS templates
"Where should I add the code mapping?"Pattern existsFollow code_tags.json structure
"How do I structure the SDD section?"Pattern existsFollow existing SDD sections
"What's the next REQ ID?"ComputableCount existing IDs
"Does this code implement the requirement?"AnalyzableRead code and determine

Parallelization Patterns

From Learned Experience (archived: CODE_REVIEW_PLAN.md)

Pass A (Gap Closure): Schema gaps || Behavior gaps

  • GAP-013+017 (schema) ran parallel to GAP-027+028 (runtime)

Pass B (Inventories): All 6 inventories are independent

  • DB Schema || Events || Integrations || Jobs || Auth || Audit

Pass C (Backend Linking): By domain, in waves

  • Wave 1: Auth/User Management
  • Wave 2: File Import
  • Wave 3: Rules & Analytics
  • Wave 4: Audit
  • Wave 5: Remaining domains

Pass D (Frontend): By component type

  • Page components || Feature components || Composables

Applying to Version Updates

PhaseParallelizable?Pattern
Change DetectionPartiallyCode areas can be analyzed in parallel
Impact AnalysisNoRequires complete change manifest
SRS UpdatesYesOne agent per domain
SDD UpdatesPartiallyIndependent sections in parallel
Code Mapping SyncYesOne agent per domain/module
ValidationNoRequires all updates complete

Agent Task Structure

When spawning agents for parallel work:

Critical Rule (from CLAUDE.md): Never send multiple docs for conversion to a single subagent. Each agent should be responsible for a single file output. Instead of "convert these five files," launch 5 separate agents.

Single-Domain Agent

Task: Update SRS for {domain}
- Read: docusaurus/docs/srs/{domain}.md
- Read: Domain mappings (archived: PASS_C_DOMAIN_MAPPING.md) for code boundaries
- Analyze: Code changes affecting this domain
- Write: Updated SRS file
- Output: Summary of changes made

Inventory Extraction Agent

Task: Extract {inventory_type} inventory
- Scan: Relevant code paths (from archived CODE_REVIEW_PLAN.md)
- Document: Items found with locations
- Output: Inventory data for SDD merge

Code Mapping Agent

Task: Update code_tags.json for {domain}
- Read: Domain mappings (archived: PASS_C_DOMAIN_MAPPING.md) for boundaries
- Read: docusaurus/docs/srs/{domain}.md for REQ IDs
- Update: tests/catalogue/code_tags.json (all three views: by_file, by_srs, by_sdd)
- Update: Implementation section in SRS
- Output: Count of entries added/modified, validation results

Evidence and Audit Trail

LLM Must Document

WhatWhereFormat
Decisions madeReviewer Notes in SRSMarkdown
Code findingsEvidence logDate, location, finding
Human responsesSESSION_HANDOFFQ&A format
Validation resultsVALIDATION_CHECKLISTPass/fail

Evidence Log Entry Format

From archived CODE_REVIEW_PLAN.md:

## {Date} - {Gap ID or Change ID}

**Verified:** {What was checked}
**Code Location:** {File path + method}
**Finding:** {What was found}
**Doc Update:** {What changed in SRS/SDD}
**Code Update:** {code_tags.json updated? Y/N}
**Confidence:** High / Medium / Low

Session Handoff

When session ends or context limit approaches:

# SESSION_HANDOFF

## Status
- Phase: {Current phase}
- Completed: {What's done}
- In Progress: {Current task}
- Remaining: {What's left}

## Human Decisions Needed
- [ ] {Question 1}
- [ ] {Question 2}

## Files Modified This Session
- {file1}: {what changed}
- {file2}: {what changed}

## Next Session Start Point
{Exact instructions for resuming}

Summary: The 80/20 Rule

80% LLM-driven:

  • Code analysis
  • Pattern application
  • Document generation
  • Validation execution
  • Inventory extraction

20% Human-in-the-loop:

  • Review gates (approval before proceeding)
  • Business/product questions
  • Conflict resolution
  • Policy decisions
  • Final sign-off