Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This file records changes to what chant prints or writes for a plain project, th

## Unreleased

- [#5096](https://github.com/INTENTIUS/chant/issues/5096) The k8s lexicon supplies a `manifests` workspace kind (precedence 305, below every other kind that reads YAML): a directory of plain Kubernetes manifests is a member, with a node for every document that has an `apiVersion` and a `kind`, custom resources included. A directory no other kind claimed that holds such files is now a `manifests` member in `chant workspace init` and `chant workspace graph`, where it was left out before. The `argo-app` kind also reads `ApplicationSet` and `AppProject` documents and claims a directory that holds only those. A YAML file that does not parse is a warning that names it.
- [#5070](https://github.com/INTENTIUS/chant/issues/5070) `chant import` of a Kubernetes manifest checks that `@intentius/chant-lexicon-k8s` exports a class for each kind before it writes one. A kind with no class (a custom resource whose CRD the lexicon does not ship, such as `ExternalSecret` or `ManagedCertificate`) is written as `k8sManifest({ apiVersion, kind, ... })`, which builds and comes back as the manifest it was, and the import prints one warning per kind naming `k8s.crds` and `chant generate`. Before, it wrote `new ExternalSecret(...)` and an import of a name the lexicon does not export, so the build failed to load the module while the import exited 0. A kind whose name is another group's class (`Kustomization` of `kustomize.config.k8s.io`, which is not Flux's) is untyped now too, where it was written as the other group's class. A kind with a class is written as before.
- [#5060](https://github.com/INTENTIUS/chant/issues/5060) In a product's workflow (`runIf`) with `beforeMerge` and a spec `control`, the Op waves control job runs again. It used to need the last wave's record jobs and sit inside the product's push `runIf`, so it could never run. It now runs on the default branch's push run, outside the product's `runIf`, after the jobs `firstWaveNeeds` names, and tells the control repo the waves applied at `github.sha` or `$CI_COMMIT_SHA`, adding up no outcomes. GitHub, Forgejo and GitLab. Without `beforeMerge`, or without `runIf`, the job renders as before. Floor: `OP_WAVES_CONTROL_BEFORE_MERGE_FLOOR`.
- [#5061](https://github.com/INTENTIUS/chant/issues/5061) With `wavesBeforeMerge` and the product plan's `reach`, and no `locks: "plan"`, the comment job (GitHub, Forgejo) and the note poll (GitLab, `chantNoteRuns`) answer `/<product> lock` on an open pull request by taking the locks of what the reach line prints at stage `apply` in `_locks/<reach.gate>.json`, without applying, refused with the holder named while another open pull request holds one, and `/<product> unlock` by releasing the pull request's locks. Both reply, run none of the change's code, and are refused for a fork or a commenter without write access. The product plan takes `reach` without `locks: "plan"` under `wavesBeforeMerge`, and then writes no reach lock job. With `locks: "plan"`, or without `wavesBeforeMerge` and `reach`, nothing changes. Floor: `WAVES_BEFORE_MERGE_LOCKS_FLOOR`.
- [#5056](https://github.com/INTENTIUS/chant/issues/5056) `approvals.remainder` resumes the waves terragucci's own records resume. The terraform step gives a live choudoufu root planned through `live-plan-set` its `resourceDigests`, from the set's plan, as the `plan -out` path does, so the applied line names its changes; before, such a wave never resumed as a remainder. Those digests also reach a pull request's recorded plans, so `approvals.preview` compares a live root resource by resource, as it does a `plan -out` root. The remainder's cover leaves out the cost member `(monthly cost)` on both sides, since it digests the wave's monthly change, which moves once part of the wave applied; every change is still compared. Floor: `OP_WAVES_REMAINDER_PARITY_FLOOR`.
Expand Down
5 changes: 4 additions & 1 deletion docs/src/content/docs/cli/audit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ For tooling, `--format json` emits a **versioned** envelope (stable contract). T
"snapshot": { "target": "...", "host": "github.com", "repo": "owner/repo", "commit": "…", "files": ["..."], "generatedAt": "…", "toolVersion": "0.7.0" },
"summary": { "total": 0, "quickWin": 0, "needsReview": 0, "reportOnly": 0, "errors": 0, "warnings": 0, "infos": 0, "security": 0, "correctness": 0, "bestPractice": 0 },
"findings": [
{ "checkId": "GHA033", "severity": "warning", "message": "…", "file": "…", "entity": "…", "lexicon": "github",
{ "checkId": "GHA033", "severity": "warning", "message": "…", "file": "…", "entity": "…", "identity": "…", "lexicon": "github",
"tier": "merge-worthy", "fixKind": "deterministic", "category": "security", "title": "…", "remediation": "…",
"authority": [{ "name": "…", "url": "…" }],
"lineage": [{ "tool": "zizmor", "rule": "excessive-permissions", "url": "…", "relation": "equivalent" }],
Expand All @@ -221,6 +221,8 @@ For tooling, `--format json` emits a **versioned** envelope (stable contract). T
- The `snapshot` anchors findings to an exact commit for reproducibility.
- `status` is `"ok"` when at least one lexicon ran, `"no-lexicons"` when none could (see [Prerequisites](#prerequisites)). Check it before trusting an empty `findings`. An optional `unclaimed` list names files that wanted a lexicon that is not installed.
- An optional `truncated` object (`limit`, `flag`) means the local walk stopped at its file limit, so `findings` covers only part of the tree (see [Scan limits](#scan-limits)).
- An optional `skipped` list names each lexicon whose files were found but not read because an optional parser is not installed (today, `@cdktn/hcl2json` for Terraform). Each entry has `lexicon`, `reason` (`"parser-not-installed"`), `package`, `install` and `paths`, the audited directories it could not read. A lexicon in `skipped` has no findings because it was not read, not because it is clean, so a consumer that treats an empty lexicon as clean should check this list first. The same sentence is printed on stderr, and text reports lead with it as a note.
- `identity` names a finding across runs, so a base and a head can be compared without reading messages. It is built from the rule, the file, the object's name or address, the finding's place in the object (for a container finding, the kind and the container's index) and, for a secret, the value's fingerprint. It does not use the message or the line. Renaming a container inside a Deployment leaves the identity alone; renaming the Deployment changes it. A finding with no further locator is told apart from others on the same object by its order. An aliased Terraform provider is keyed by its alias.
- `lineage` credits the open-source tools whose rules check the same condition, with the upstream rule id and how the two relate. It is credit, not authority, and is empty for a rule with no known counterpart. The [audit rules reference](/chant/lint-rules/audit-rules/#prior-art) lists every tool credited.
- For maximum stability, use `--format sarif`, an industry-standard format versioned independently of chant.

Expand All @@ -229,6 +231,7 @@ For tooling, `--format json` emits a **versioned** envelope (stable contract). T
`--format sarif` emits a [SARIF 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html) document, the interchange format most CI platforms and code-review surfaces (GitHub code scanning, GitLab, Azure DevOps, many SAST/IDE viewers) render as inline, file-and-line annotations instead of scraped text:

- Each `run.tool.driver.rules[]` entry carries the finding's `helpUri` (the same authority citation as the other formats) plus a `help.text` with the catalog's remediation guidance, and a `properties.category`/`properties.dimension` pair (`security`, `correctness`, or `best-practice`) for rule-level triage. A rule with prior art also carries `properties.priorArt`, the same `lineage` entries the JSON report emits.
- Each `run.results[]` entry carries the same `identity` as the JSON report, as `partialFingerprints["chantFindingIdentity/v1"]`.
- Each `run.results[]` entry carries `properties.tier` (`merge-worthy` or `report-only`) alongside the standard `ruleId`, `level`, `message`, and `locations` (file + line, when known).
- Secrets findings (`SEC001`–`SEC010`) redact the same as every other format — a result's `message.text` never carries the matched value, only the rule id, kind, location, and fingerprint.
- `--agents` emits the same property bag under a `chant audit --agents` driver name, so one consumer can triage both. Its rules' `helpUri` points at the rule's own entry in the audit rules reference rather than an external authority, since an `AGT` finding is about a local file.
Expand Down
Loading
Loading