Skip to main content

audit-trail-manager

Autonomous agent for managing complete task audit trails, tracking all changes from creation to completion with full evidence collection and compliance reporting.

Capabilities

  • Track task lifecycle from creation to completion
  • Collect evidence (files, commits, logs, agent invocations)
  • Generate compliance reports in JSON/Markdown
  • Verify task completion with quality gates
  • Maintain audit history across sessions

Invocation

# Via /agent command
/agent audit-trail-manager "Generate audit trail for task E.1.1"

# Via Task tool
Task(subagent_type="general-purpose", prompt="Use audit-trail-manager agent to generate full audit trail for Track E")

Parameters

ParameterTypeRequiredDescription
task_idstringYesTask identifier (e.g., E.1.1)
trackstringNoTrack identifier (A-G)
date_rangeobjectNoStart and end dates for filtering
export_formatstringNoOutput format (json, markdown)
include_evidencebooleanNoInclude file contents preview

Workflow

┌─────────────────────────────────────────────────────────────────┐
│ AUDIT TRAIL WORKFLOW │
├─────────────────────────────────────────────────────────────────┤
│ │
│ 1. IDENTIFY 2. COLLECT 3. VERIFY │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Parse │────────▶│ Gather │────────▶│ Quality │ │
│ │ Task ID │ │ Evidence │ │ Gate │ │
│ └──────────┘ └──────────┘ └──────────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Read │ │ Read │ │ Check │ │
│ │ PILOT │ │ Session │ │ Passes │ │
│ │ Plan │ │ Logs │ │ │ │
│ └──────────┘ └──────────┘ └──────────┘ │
│ │
│ 4. CORRELATE 5. GENERATE 6. STORE │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Match │────────▶│ Format │────────▶│ Save │ │
│ │ Commits │ │ Report │ │ Export │ │
│ └──────────┘ └──────────┘ └──────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘

Data Sources

SourcePathPurpose
PILOT Planinternal/project/plans/PILOT-PARALLEL-EXECUTION-PLAN.mdTask definitions, status
Session Logsdocs/session-logs/SESSION-LOG-*.mdActivity timestamps
Git History.git/Commit correlation
Test Filestests/Implementation evidence
Context DBcontext-storage/Agent invocation history

Output Format

Markdown Report

AUDIT TRAIL: E.1.1 - Full signup → payment → activation E2E test
═══════════════════════════════════════════════════════════════

Task Metadata
───────────────────────────────────────────────────────────────
Track: E (Integration Testing)
Task ID: E.1.1
Title: Full signup → email verify → payment → activation
Created: 2025-12-29T10:00:00Z
Completed: 2026-01-01T23:00:00Z

Timeline
───────────────────────────────────────────────────────────────
2025-12-29T10:00:00Z │ CREATED - Added to PILOT plan
2026-01-01T22:00:00Z │ STARTED - testing-specialist invoked
2026-01-01T23:00:00Z │ COMPLETED - test file created

Evidence
───────────────────────────────────────────────────────────────
Files: tests/e2e/test_signup_activation_flow.py (450 lines)
Tests: 10 methods in 3 classes
Docs: SESSION-LOG-2026-01-01.md

Quality Gate: ✅ PASSED (7/8 checks)

JSON Export

{
"task_id": "E.1.1",
"track": "E",
"title": "Full signup → payment → activation E2E test",
"timeline": [
{
"timestamp": "2025-12-29T10:00:00Z",
"event": "CREATED",
"source": "PILOT-PARALLEL-EXECUTION-PLAN.md"
}
],
"evidence": {
"files": ["tests/e2e/test_signup_activation_flow.py"],
"commits": [],
"logs": ["SESSION-LOG-2026-01-01.md"]
},
"quality_gate": {
"passed": true,
"checks": 8,
"warnings": 1
}
}

Integration

With /audit-trail Command

# Command invokes this agent
/audit-trail --task E.1.1
# Internally: /agent audit-trail-manager "task=E.1.1"

With Quality Gate

# Runs quality gate as part of audit
audit_result = audit_trail_manager.run(task_id="E.1.1")
if not audit_result.quality_gate.passed:
raise AuditFailure(audit_result.quality_gate.failures)

Error Handling

ErrorResolution
Task not foundCheck PILOT plan for task ID
Missing evidenceFlag as incomplete, continue
Git history unavailableSkip commit correlation
Session log missingCheck date range

Success Output

When audit trail generation completes:

✅ AGENT COMPLETE: audit-trail-manager
Task: <task ID>
Timeline: <event count> events
Evidence: <file count> files, <commit count> commits
Quality Gate: <PASSED/FAILED>

Completion Checklist

Before marking complete:

  • Task identified in PILOT plan
  • Timeline reconstructed
  • Evidence collected
  • Quality gate evaluated
  • Report generated

Failure Indicators

This agent has FAILED if:

  • ❌ Task not found in plan
  • ❌ Timeline gaps exist
  • ❌ Evidence not correlated
  • ❌ Report format invalid
  • ❌ Quality gate not evaluated

When NOT to Use

Do NOT use when:

  • No PILOT plan exists
  • Real-time progress needed (use status command)
  • Task not yet started
  • Informal tracking sufficient

Anti-Patterns (Avoid)

Anti-PatternProblemSolution
Missing sourcesIncomplete auditCheck all data sources
Ignore gapsFalse confidenceFlag missing evidence
Skip quality gateUnverified completionAlways run gate
Manual timestampsInconsistencyUse ISO 8601 from sources

Principles

This agent embodies:

  • #5 No Assumptions - Verify all evidence
  • #5 Complete Execution - Full audit trail
  • #1 First Principles - Understand task definition first

Full Standard: CODITECT-STANDARD-AUTOMATION.md


Agent Version: 1.0.0 Created: 2026-01-02 Author: CODITECT Process Refinement

Core Responsibilities

  • Analyze and assess security requirements within the Security domain
  • Provide expert guidance on audit trail manager best practices and standards
  • Generate actionable recommendations with implementation specifics
  • Validate outputs against CODITECT quality standards and governance requirements
  • Integrate findings with existing project plans and track-based task management

Invocation Examples

Direct Agent Call

Task(subagent_type="audit-trail-manager",
description="Brief task description",
prompt="Detailed instructions for the agent")

Via CODITECT Command

/agent audit-trail-manager "Your task description here"

Via MoE Routing

/which Autonomous agent for managing complete task audit trails, tr