Skip to content

DocGuard v0.51.0

Latest

Choose a tag to compare

@github-actions github-actions released this 30 Nov 15:26
· 8 commits to main since this release
d766702

Added

  • Quantities in instruction documents are compared (spec 109, docguard.documented-quantities, issue 629, the last part of 628). The claim extractor now reads the trailing # comment of a shell-fence line and a bare s unit (~15s), so semanticClaims.count can grow. New Metrics-Consistency codes: MET005 (warn), a documented minimum Node.js version that disagrees with engines.node; MET006 (warn), a documented duration for a package-script command above the CI budget of that command (*_BUDGET_MS, timeout-minutes); MET007 (informational, no exit-code change), a CI budget ten times or more the documented time. Exit codes: a project with a contradicting Node.js minimum or a documented time above its CI budget gets a new warning (exit 2 under standard, no change under strict).

Fixed

  • Strict no longer demotes a hardcoded secret when the project turned security on (issue 711, spec 106 docguard.field-report-fixes). From 0.48.0, strict (the default) reported every error of security and architecture as a warning, even with "validators": { "security": true } or the enterprise profile, so a committed product credential failed standard (exit 1) but not the default (exit 4 or 2). The demotion now applies only when the merged config does not turn the validator on; both the structured and the legacy count paths read the same set. A finding in a test path stays a warning under strict either way (enforcement.source: strict-test-path), because a test path never fails a strict build. A project that did not turn security on keeps the warnings, and the text output now prints N possible secrets in product code are warnings under strict with the fix; strict.demotedProductSecrets carries the count. SEC001 to SEC004 and ARC* errors change from warn to error for projects that turned the validator on.

  • Salesforce Apex is read (issues 712 to 714). One language entry (cli/shared-languages.mjs: .cls, .trigger, .apex, id apex) feeds every consumer. The secret scan reads Apex and Visualforce (.page, .component), so SEC001 to SEC004 can now fire on them. Apex test classes (*Test.cls, *Tests.cls, *_Test.cls, Test_*.cls, or @isTest) are tests, and @req in them is read, so TRC004 clears. sfdx-project.json is detected as the Salesforce DX ecosystem; projectType is webapp when the package holds lwc/, aura/ or pages/, else unknown as before. SPK008 reads Apex and *-meta.xml, matches a metadata file by its API name and matches directory names, so a completed custom-object task is no longer a phantom; a file that quotes the task text (a saved guard report) is no longer evidence.

  • TSP007 finds Maven and Gradle module tests (issue 713). Test-Spec now detects tests with the classifier traceability uses, so <module>/src/test/java/** at any depth counts. A project that has such tests and no TEST-SPEC.md now has Test-Spec apply, and under strict that is needs-declaration.

  • SEC001 and SEC004 no longer fail on values that cannot be credentials (issue 715). A route path, a URL without credentials (or a query parameter name), a name made of the key's own words (idp_access_token) and a dotted label (auth.refreshAccessToken) are low-confidence warnings whose message names the shape. A JWT, a URL with user:pass@ or a credential query value, and high-entropy values stay errors. Storybook stories, test-utils/ and test-support/ are context: test-path; a story is never test coverage.

  • Guard JSON states its exit decision (issue 716). guard --format json (full and --compact) carries exitCode and outcome; ci --format json carries exitCode and outcome (pass, warnings, blocked). errors keeps its meaning (intrinsic counts). New schemas schemas/docguard-guard-result.schema.json and schemas/docguard-ci-result.schema.json. The ci summary says "1 validator applies".

  • DCV003 no longer lists docs/ or a folder of only documents as a source directory, and TRC002 no longer repeats STR006 for an unedited scaffold (issue 717).

  • One language registry for every scanner (spec 107, docguard.language-registry). Each scanner used to keep its own list of source extensions, each a different subset, so Apex (and Swift, Kotlin, Elixir, Dart, C# in some of them) was read by one check and missed by the next. cli/shared-languages.mjs now has one entry per language, and every check that asks "is this file code?" reads it: TODO tracking (TDO*), drift comments (DRF*), freshness (FRS*), docs-diff, reference existence, changelog, diff suspicion, traceability, anchors, Spec Kit task evidence (SPK008), the secret scan (SEC*), doc ownership, AI-DLC, the instruction audit (PSR*), generate, trace, verify, impact, watch and the hooks. Lists tied to one parser (env reads, Spring routes, ORM schemas, Docs-Sync, test-name conventions) stay where they are with a written reason, and a test fails for any new private list. A Salesforce DX framework name no longer makes API-Surface apply (no Apex route reader exists).

  • The secret scan reads config files, and DocGuard says what it did not read (spec 108, docguard.analysis-disclosure, issues 718 and 719). YAML, .properties/.conf, appsettings*.json, Mule flow XML (src/main/mule/) and Salesforce Flow variables are read by key, and shell scripts by the code pattern, so SEC001 to SEC004 can now fire on a committed application.yml password. Placeholders (${VAR}, ${secure::key}, ${{ secrets.X }}, {{ .Values.x }}, %env()%, {cipher}, ENC(), vault:) are not reported; a literal default in ${VAR:default} is. Well-known defaults (postgres) and the spec 106 value shapes are low-confidence warnings; lockfiles and *.example files are not read; src/test/resources/ is test-path. New informational SEC012 counts files in a recognized language the scan left out (DataWeave, LWC templates). guard --format json carries unanalyzed (language, files, the checks that do not read them); the text output prints one line. MuleSoft (mule-application packaging) is detected; neither it nor Salesforce DX makes API-Surface apply, and generate says the stack has no DocGuard analyzer.

Exit codes: a project with "security": true (or architecture: true, or the enterprise profile) and a product-code secret now exits 1 under strict, as under standard. A Maven or Gradle project with module tests and no TEST-SPEC.md can now exit 4 under strict (Test-Spec applies). Fewer SEC001/SEC004 errors can turn an exit 1 into 2 for the shapes above; new SEC001/SEC004 errors in Apex can turn 2 into 1. A project in a language some checks did not read before (Apex, Elixir, Dart, Kotlin, Swift, C# depending on the check) can see new TDO*, DRF* (an unlogged DRIFT: comment is an error, exit 1), FRS* and SEC* findings, and Doc-Dependency, Requirement-Anchors and Doc-Ownership now apply to it when it has canonical documents, as they do for Java. A committed credential in a config file or shell script is now SEC001 to SEC004, an error, and fails a project that turned security on (exit 1). Changed codes: SEC001, SEC002, SEC003, SEC004, SEC011, SEC012 (new, informational), TSP007, TRC002, TRC004, SPK008, DCV003, TDO002, DRF002, FRS002.

Commits

  • refactor: one language registry, config secret scan and analysis disclosure (specs 107, 108; #718, #719) (#721)
  • feat(metrics): quantities in instruction documents (spec 109, #629, closes #628) (#723)
  • fix: strict secrets, Salesforce Apex, guard exit contract, doc-folder noise (spec 106, #711–#717) (#720)