Skip to content

Runtime: normalize .aamf log and output artifact directory structure #89

Description

@jafreck

Summary

AAMF writes useful observability artifacts today, but the runtime/agent/command logs and generated artifacts are spread across mixed top-level directories. This issue defines and implements a normalized directory layout for clearer operations, retention, and troubleshooting.

Problem

Current outputs are functional but harder to navigate at scale:

  • Mixed log classes in a mostly flat logs/ layout.
  • State files, runtime artifacts, and reports are not consistently grouped by purpose.
  • Cleanup/retention operations are harder to target safely.

Goals

  • Make runtime outputs predictable and self-describing.
  • Separate state, logs, artifacts, and reports.
  • Preserve backward compatibility for existing readers/scripts during migration.

Proposed Target Layout

Within .aamf/migration/{projectName}/:

  • state/
    • checkpoint.json
    • checkpoint.backup.json
    • run-manifest.json (optional summary metadata)
  • logs/runtime/
    • migration.log
  • logs/agents/{agent}/{taskId}/
    • per-invocation stdout/stderr logs
  • logs/commands/{build|test}/
    • command execution logs
  • artifacts/contexts/
    • context JSON files
  • artifacts/results/
    • structured sidecar result JSONs
  • artifacts/planning/
    • planning outputs (groups.json, tasks-*.json, etc.)
  • artifacts/parity/
    • parity/final parity reports
  • artifacts/adjudication/
    • adjudication outputs
  • reports/
    • progress.md
    • observability/ report outputs
  • metrics/
    • invocations.jsonl, summary.json

Proposed Scope

  1. Centralize path derivation in one helper/module to avoid drift.
  2. Update runtime/orchestrator/context-builder/logger/agent-launcher to write to normalized paths.
  3. Add temporary compatibility shims (read from old paths when new path missing).
  4. Update README and fixtures/tests for new layout.
  5. Ensure keepArtifacts and reset behaviors continue to work correctly.

Acceptance Criteria

  • Runtime, agent, and command logs are written under dedicated logs/* subtrees.
  • Checkpoint files move under state/ and continue to load/save atomically.
  • Context and result sidecars are written/read from normalized artifact paths.
  • Progress and observability reports remain generated and discoverable.
  • Existing runs can still be resumed/read via compatibility fallback paths.
  • README and tests reflect the new structure.

Test Plan

  • Unit tests for path helper mappings.
  • Integration tests verifying directory tree creation and expected file placement.
  • Backward-compat tests: old-path artifacts still readable after upgrade.

Notes

This issue focuses on filesystem contract normalization only. Functional migration behavior should remain unchanged except for path locations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions