Packages
@argus/shared
The contract package. Every type that crosses a package boundary is defined
here once and imported everywhere else — which is what lets each
infra-shaped dependency (queue, database, ADO, model, checkout) be swapped
between a real implementation and an in-process fake without touching
consumers. It has no @argus/* dependencies; only zod and pino.
Place in the system
All nine other packages import it. It exports no behaviour beyond small, pure helpers — it is the vocabulary of the system.
Key exports
| Module | Contract | Notes |
|---|---|---|
jobs.ts |
ReviewJob = ReviewFullJob | ReviewIncrementalJob | ThreadReplyJob | MentionAnswerJob (zod discriminated union); sessionKeyForJob() |
The session key is org/project/repoId/prId — the per-PR ordering key |
findings.ts |
FindingSchema, FindingsOutputSchema, SEVERITIES (must-fix | note), CATEGORIES (closed 6-value enum), findingsJsonSchema() |
The provider-neutral structured-output contract (PRD §6.4) |
queue.ts |
Queue, QueueConsumer, JobHandler, DeadLetterHandler, ConsumeOptions |
Implemented by @argus/queue |
rules.ts |
RulePack, ResolvedRules, RulesSource |
Implemented by @argus/rules |
ado.ts |
AdoClient plus its value types (PrRef, PrMetadata, AdoThread, AdoComment, ChangedFile, CreateInlineThreadInput, …) |
Implemented by @argus/ado |
runner.ts |
ModelRunner, ModelRunnerInput/Result, ReviewTier (single-shot | agentic), TokenUsage |
Implemented by the worker's runners |
checkout.ts |
CheckoutProvider, PreparedWorkspace, NumstatEntry |
Implemented by the worker's checkouts |
config.ts |
ArgusConfig / ConfigSchema — the validated env contract |
Errors name variables, never values |
logger.ts |
createLogger() (pino-based) with redact() over any key matching /token|secret|pat|password|key/i |
The credential-leak backstop |
findingKey.ts |
findingKey(file, summary) — stable hash for finding dedup across re-reviews |
Drives "never repeat a finding" |
version.ts |
serviceVersion() — ARGUS_VERSION/ARGUS_GIT_SHA surfaced in /health, logs, reports, audit rows |
How it's tested
src/__tests__/ covers the zod schemas (jobs, findings, config), the
redacting logger, findingKey normalisation, and version fallback — pure
unit tests, no fakes needed.
