Source tracking

Snapshots

snapshot stores a baseline of the tracked workspace files:

archledger --json source snapshot --reason after-archledger-update

source-state.json stores SHA-256 content hashes only for files. It does not persist mtimes or file sizes. Directory hashes are derived from file hashes after scanning.

Changes

changed compares the current workspace against the stored baseline:

archledger --json source changed
archledger --json source changed --include-drafts

If [tracking].enabled = false, both commands fail explicitly instead of creating or reading misleading tracking state.

Linking source_refs

When a fragment documents concrete implementation artifacts, add source_refs that point at relative workspace paths:

source_refs:
  - archledger/repository.py#ArchitectureRepository
  - path: archledger/storage/project_config.py
    symbols:
      - ProjectConfig
      - load_project_config
    reason: "Tracking configuration validation"
  - path: archledger/templates/
    reason: "Bundled templates"

Use POSIX separators, keep the paths relative to the workspace root, and end directory references with /.