Files
git.stella-ops.org/src/Concelier/__Libraries/StellaOps.Concelier.Exporter.TrivyDb/AGENTS.md
master 66cb6c4b8a
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
feat: Add guild charters and task boards for various components
- Introduced guild charters for Scanner Deno, PHP, Ruby, Native, WebService, Java, Surface.Env, Surface.FS, Surface.Secrets, Surface.Validation, UI, Zastava Observer, Zastava Webhook, Zastava Core, and Plugin Platform.
- Each charter outlines the mission, scope, required reading, and working agreements for the respective guilds.
- Created task boards for Surface.Env, Surface.FS, Surface.Secrets, Surface.Validation, and Zastava components to track progress and dependencies.
- Ensured all documents emphasize determinism, offline readiness, security, and integration with shared Surface libraries.
2025-11-01 02:21:46 +02:00

2.7 KiB

AGENTS

Role

Exporter producing a Trivy-compatible database artifact for self-hosting or offline use. v0: JSON list + metadata; v1: integrate official trivy-db builder or write BoltDB directly; pack and optionally push via ORAS.

Scope

  • Read canonical advisories; serialize payload for builder or intermediate; write metadata.json (generatedAt, counts).
  • Output root: exports/trivy/; deterministic path components.
  • OCI/Trivy expectations: layer media type application/vnd.aquasec.trivy.db.layer.v1.tar+gzip; config media type application/vnd.aquasec.trivy.config.v1+json; tag (e.g., 2).
  • Optional ORAS push; optional offline bundle (db.tar.gz + metadata.json).
  • DI: TrivyExporter + Jobs.TrivyExportJob registered by TrivyExporterDependencyInjectionRoutine.
  • Export_state recording: capture digests, counts, start/end timestamps for idempotent reruns and incremental packaging.

Participants

  • Storage.Mongo.AdvisoryStore as input.
  • Core scheduler runs export job; WebService/Plugins trigger it.
  • JSON exporter (optional precursor) if choosing the builder path.

Interfaces & contracts

  • IFeedExporter.Name = "trivy-db"; ExportAsync(IServiceProvider, CancellationToken).
  • ConcelierOptions.packaging.trivy governs repo/tag/publish/offline_bundle.
  • Deterministic sorting and timestamp discipline (UTC; consider build reproducibility knobs).

In/Out of scope

In: assembling builder inputs, packing tar.gz, pushing to registry when configured. Out: signing (external pipeline), scanner behavior.

Observability & security expectations

  • Metrics: export.trivy.records, size_bytes, duration, oras.push.success/fail.
  • Logs: export path, repo/tag, digest; redact credentials; backoff on push errors.

Tests

  • Author and review coverage in ../StellaOps.Concelier.Exporter.TrivyDb.Tests.
  • Shared fixtures (e.g., MongoIntegrationFixture, ConnectorTestHarness) live in ../StellaOps.Concelier.Testing.
  • Keep fixtures deterministic; match new cases to real-world advisories or regression scenarios.

Required Reading

  • docs/modules/concelier/architecture.md
  • docs/modules/platform/architecture-overview.md

Working Agreement

    1. Update task status to DOING/DONE in both docs/implplan/SPRINTS.md and the local TASKS.md when you start or finish work.
    1. Review this charter and the Required Reading documents before coding; confirm prerequisites are met.
    1. Keep changes deterministic (stable ordering, timestamps, hashes) and align with offline/air-gap expectations.
    1. Coordinate doc updates, tests, and cross-guild communication whenever contracts or workflows change.
    1. Revert to TODO if you pause the task without shipping changes; leave notes in commit/PR descriptions for context.