patchdrill 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.patchdrill.yml +33 -0
- package/CHANGELOG.md +150 -0
- package/CONTRIBUTING.md +59 -0
- package/LICENSE +21 -0
- package/README.md +601 -0
- package/SECURITY.md +28 -0
- package/action.yml +338 -0
- package/dist/baseline.d.ts +9 -0
- package/dist/baseline.js +38 -0
- package/dist/baseline.js.map +1 -0
- package/dist/cli.d.ts +19 -0
- package/dist/cli.js +662 -0
- package/dist/cli.js.map +1 -0
- package/dist/codeowners.d.ts +14 -0
- package/dist/codeowners.js +104 -0
- package/dist/codeowners.js.map +1 -0
- package/dist/command-plan.d.ts +3 -0
- package/dist/command-plan.js +26 -0
- package/dist/command-plan.js.map +1 -0
- package/dist/demo.d.ts +5 -0
- package/dist/demo.js +525 -0
- package/dist/demo.js.map +1 -0
- package/dist/dependency.d.ts +4 -0
- package/dist/dependency.js +1424 -0
- package/dist/dependency.js.map +1 -0
- package/dist/doctor.d.ts +26 -0
- package/dist/doctor.js +183 -0
- package/dist/doctor.js.map +1 -0
- package/dist/evidence.d.ts +64 -0
- package/dist/evidence.js +352 -0
- package/dist/evidence.js.map +1 -0
- package/dist/git.d.ts +16 -0
- package/dist/git.js +349 -0
- package/dist/git.js.map +1 -0
- package/dist/i18n-catalog.d.ts +8 -0
- package/dist/i18n-catalog.js +446 -0
- package/dist/i18n-catalog.js.map +1 -0
- package/dist/i18n.d.ts +20 -0
- package/dist/i18n.js +67 -0
- package/dist/i18n.js.map +1 -0
- package/dist/init.d.ts +13 -0
- package/dist/init.js +312 -0
- package/dist/init.js.map +1 -0
- package/dist/markdown-links.d.ts +18 -0
- package/dist/markdown-links.js +180 -0
- package/dist/markdown-links.js.map +1 -0
- package/dist/package-scripts.d.ts +3 -0
- package/dist/package-scripts.js +55 -0
- package/dist/package-scripts.js.map +1 -0
- package/dist/planner.d.ts +8 -0
- package/dist/planner.js +2351 -0
- package/dist/planner.js.map +1 -0
- package/dist/policy.d.ts +12 -0
- package/dist/policy.js +255 -0
- package/dist/policy.js.map +1 -0
- package/dist/project.d.ts +2 -0
- package/dist/project.js +1085 -0
- package/dist/project.js.map +1 -0
- package/dist/release-readiness.d.ts +25 -0
- package/dist/release-readiness.js +426 -0
- package/dist/release-readiness.js.map +1 -0
- package/dist/report-annotations.d.ts +3 -0
- package/dist/report-annotations.js +28 -0
- package/dist/report-annotations.js.map +1 -0
- package/dist/report-contract.d.ts +2 -0
- package/dist/report-contract.js +82 -0
- package/dist/report-contract.js.map +1 -0
- package/dist/report-html.d.ts +7 -0
- package/dist/report-html.js +706 -0
- package/dist/report-html.js.map +1 -0
- package/dist/report-sarif.d.ts +2 -0
- package/dist/report-sarif.js +90 -0
- package/dist/report-sarif.js.map +1 -0
- package/dist/report.d.ts +14 -0
- package/dist/report.js +310 -0
- package/dist/report.js.map +1 -0
- package/dist/risk.d.ts +19 -0
- package/dist/risk.js +1226 -0
- package/dist/risk.js.map +1 -0
- package/dist/runner.d.ts +8 -0
- package/dist/runner.js +113 -0
- package/dist/runner.js.map +1 -0
- package/dist/scan.d.ts +2 -0
- package/dist/scan.js +195 -0
- package/dist/scan.js.map +1 -0
- package/dist/schema.d.ts +12 -0
- package/dist/schema.js +30 -0
- package/dist/schema.js.map +1 -0
- package/dist/stack-coverage.d.ts +8 -0
- package/dist/stack-coverage.js +94 -0
- package/dist/stack-coverage.js.map +1 -0
- package/dist/types.d.ts +206 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/verification.d.ts +11 -0
- package/dist/verification.js +108 -0
- package/dist/verification.js.map +1 -0
- package/docs/ANNOTATIONS.md +34 -0
- package/docs/ARCHITECTURE.md +79 -0
- package/docs/BASELINES.md +32 -0
- package/docs/CASE_STUDIES.md +106 -0
- package/docs/CODEOWNERS.md +23 -0
- package/docs/DASHBOARD.md +87 -0
- package/docs/EVIDENCE.md +55 -0
- package/docs/LAUNCH_PLAYBOOK.md +103 -0
- package/docs/MONOREPOS.md +74 -0
- package/docs/POLICY.md +98 -0
- package/docs/PROOF_PACKS.md +57 -0
- package/docs/PR_COMMENTS.md +56 -0
- package/docs/RELEASE.md +35 -0
- package/docs/ROADMAP.md +152 -0
- package/docs/RULE_CATALOG.md +90 -0
- package/docs/SARIF.md +74 -0
- package/docs/SCHEMAS.md +49 -0
- package/docs/SECURITY_POSTURE.md +32 -0
- package/docs/STACK_COVERAGE.md +20 -0
- package/docs/assets/patchdrill-demo.svg +21 -0
- package/docs/media/patchdrill-dashboard.png +0 -0
- package/docs/media/patchdrill-demo.gif +0 -0
- package/examples/case-studies/README.md +20 -0
- package/examples/demo/README.md +21 -0
- package/examples/demo/patchdrill-demo-summary.md +35 -0
- package/examples/demo/patchdrill-demo.html +623 -0
- package/examples/demo/patchdrill-demo.json +355 -0
- package/examples/demo/patchdrill-demo.md +120 -0
- package/examples/demo/patchdrill-demo.sarif +195 -0
- package/examples/report.md +128 -0
- package/examples/risky-agent-pr/README.md +15 -0
- package/examples/risky-agent-pr/patchdrill-demo-summary.md +41 -0
- package/examples/risky-agent-pr/patchdrill-demo.html +681 -0
- package/examples/risky-agent-pr/patchdrill-demo.json +483 -0
- package/examples/risky-agent-pr/patchdrill-demo.md +140 -0
- package/examples/risky-agent-pr/patchdrill-demo.sarif +398 -0
- package/fixtures/stacks/README.md +4 -0
- package/fixtures/stacks/android-gradle/fixture.json +33 -0
- package/fixtures/stacks/aspnet-core-service/fixture.json +36 -0
- package/fixtures/stacks/bazel-workspace/fixture.json +30 -0
- package/fixtures/stacks/buck2-workspace/fixture.json +30 -0
- package/fixtures/stacks/cargo-workspace/fixture.json +48 -0
- package/fixtures/stacks/django-app/fixture.json +25 -0
- package/fixtures/stacks/docker-compose/fixture.json +17 -0
- package/fixtures/stacks/dockerfile-service/fixture.json +17 -0
- package/fixtures/stacks/dotnet-service/fixture.json +36 -0
- package/fixtures/stacks/dotnet-solution-filter/fixture.json +62 -0
- package/fixtures/stacks/fastapi-app/fixture.json +29 -0
- package/fixtures/stacks/go-workspace/fixture.json +48 -0
- package/fixtures/stacks/java-gradle/fixture.json +29 -0
- package/fixtures/stacks/java-maven/fixture.json +32 -0
- package/fixtures/stacks/kubernetes-helm/fixture.json +25 -0
- package/fixtures/stacks/kubernetes-kustomize/fixture.json +21 -0
- package/fixtures/stacks/nested-go-workspace/fixture.json +51 -0
- package/fixtures/stacks/nextjs-app/fixture.json +34 -0
- package/fixtures/stacks/node-turbo-workspace/fixture.json +39 -0
- package/fixtures/stacks/pants-python/fixture.json +33 -0
- package/fixtures/stacks/php-composer/fixture.json +31 -0
- package/fixtures/stacks/python-service/fixture.json +21 -0
- package/fixtures/stacks/rails-app/fixture.json +25 -0
- package/fixtures/stacks/spring-boot-gradle/fixture.json +29 -0
- package/fixtures/stacks/spring-boot-maven/fixture.json +43 -0
- package/fixtures/stacks/swift-package/fixture.json +21 -0
- package/fixtures/stacks/terraform-module/fixture.json +17 -0
- package/fixtures/stacks/uv-python-service/fixture.json +47 -0
- package/fixtures/stacks/xcode-app/fixture.json +72 -0
- package/package.json +80 -0
- package/schemas/patchdrill-doctor.schema.json +171 -0
- package/schemas/patchdrill-evidence.schema.json +239 -0
- package/schemas/patchdrill-policy.schema.json +170 -0
- package/schemas/patchdrill-release-check.schema.json +78 -0
- package/schemas/patchdrill-report.schema.json +647 -0
package/.patchdrill.yml
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
failOn: critical
|
|
2
|
+
maxRisk: 100
|
|
3
|
+
|
|
4
|
+
ignoredPaths:
|
|
5
|
+
- node_modules/**
|
|
6
|
+
- dist/**
|
|
7
|
+
- coverage/**
|
|
8
|
+
- .patchdrill/**
|
|
9
|
+
|
|
10
|
+
requiredCommands:
|
|
11
|
+
- id: full-quality-gate
|
|
12
|
+
label: Full quality gate
|
|
13
|
+
command: npm run check
|
|
14
|
+
reason: PatchDrill must typecheck and pass its deterministic test suite before release.
|
|
15
|
+
|
|
16
|
+
optionalCommands:
|
|
17
|
+
- id: package-dry-run
|
|
18
|
+
label: Package dry run
|
|
19
|
+
command: npm pack --dry-run
|
|
20
|
+
reason: Confirms the npm tarball contains the expected CLI, docs, action, and examples.
|
|
21
|
+
|
|
22
|
+
rules:
|
|
23
|
+
- id: risk-engine-review
|
|
24
|
+
title: Risk engine changed
|
|
25
|
+
severity: medium
|
|
26
|
+
path:
|
|
27
|
+
- src/risk.ts
|
|
28
|
+
- src/policy.ts
|
|
29
|
+
detail: Risk or policy logic changed, so reviewers should inspect false-positive and false-negative behavior.
|
|
30
|
+
remediation: Add targeted tests for every new scoring rule or policy behavior.
|
|
31
|
+
tags:
|
|
32
|
+
- risk-model
|
|
33
|
+
- review
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
- Initial CLI with diff scanning, project detection, risk findings, verification planning, optional command execution, Markdown reports, JSON reports, and GitHub workflow generation.
|
|
6
|
+
- Added `.patchdrill.yml` policy-as-code support.
|
|
7
|
+
- Added SARIF output for GitHub code scanning.
|
|
8
|
+
- Added diff-content detection for secret-looking values and prompt-injection instructions.
|
|
9
|
+
- Added agent-control, MCP configuration, GitHub Actions privilege, and destructive agent-instruction rules.
|
|
10
|
+
- Added SARIF partial fingerprints, CodeQL, OpenSSF Scorecard, and Dependabot configuration.
|
|
11
|
+
- Split CI gating into explicit `--fail-on` severity and `--max-risk` score thresholds.
|
|
12
|
+
- Added Node workspace affected-package targeting and release workflow for npm provenance.
|
|
13
|
+
- Added package.json dependency diff summaries to Markdown and JSON reports.
|
|
14
|
+
- Added pull request comment upsert mode to the GitHub Action and generated workflow.
|
|
15
|
+
- Added JSON Schemas for policy, report, evidence, doctor, and release-check contracts with `patchdrill schema`.
|
|
16
|
+
- Added downstream workspace dependency graph expansion for Node monorepos.
|
|
17
|
+
- Added npm `package-lock.json` dependency diff summaries.
|
|
18
|
+
- Added CODEOWNERS owner hints for changed files.
|
|
19
|
+
- Added baseline comparison against previous JSON reports.
|
|
20
|
+
- Added `--max-risk-delta` gating for baseline regressions.
|
|
21
|
+
- Added `patchdrill init --policy` starter policy generation.
|
|
22
|
+
- Added npm package metadata for repository discovery.
|
|
23
|
+
- Updated architecture docs and action examples for the public package path.
|
|
24
|
+
- Strengthened CI dogfooding with PatchDrill SARIF and report artifacts.
|
|
25
|
+
- Refreshed the example report to cover current Markdown sections.
|
|
26
|
+
- Added GitHub issue forms and a pull request template for contributor intake.
|
|
27
|
+
- Added `schemaVersion` to JSON and Markdown reports.
|
|
28
|
+
- Added `pyproject.toml` PEP 621 and Poetry dependency diff summaries.
|
|
29
|
+
- Added `pnpm-lock.yaml` dependency diff summaries.
|
|
30
|
+
- Added `yarn.lock` dependency diff summaries.
|
|
31
|
+
- Added `go.mod` and `go.sum` dependency diff summaries.
|
|
32
|
+
- Added `Cargo.toml` and `Cargo.lock` dependency diff summaries.
|
|
33
|
+
- Added Maven `pom.xml` dependency diff summaries.
|
|
34
|
+
- Added Gradle `build.gradle` and `build.gradle.kts` dependency diff summaries.
|
|
35
|
+
- Added Gradle `libs.versions.toml` version catalog dependency diff summaries.
|
|
36
|
+
- Added `requirements.txt` dependency diff summaries.
|
|
37
|
+
- Added `poetry.lock` dependency diff summaries.
|
|
38
|
+
- Added `uv.lock` dependency diff summaries.
|
|
39
|
+
- Added `Pipfile.lock` dependency diff summaries.
|
|
40
|
+
- Added `bun.lock` dependency diff summaries.
|
|
41
|
+
- Hardened GitHub Action input handling with environment-backed bash argument arrays.
|
|
42
|
+
- Added configurable command-output retention with visible truncation markers.
|
|
43
|
+
- Updated `patchdrill init` to generate workflows that use the hardened composite Action.
|
|
44
|
+
- Added fail-fast validation for malformed PatchDrill policy files.
|
|
45
|
+
- Fixed the example report confidence score and added a documentation consistency test.
|
|
46
|
+
- Added `Gemfile.lock` and `composer.lock` dependency diff summaries.
|
|
47
|
+
- Reduced high-impact-area false positives for test file paths.
|
|
48
|
+
- Added optional per-command timeout handling for verification runs.
|
|
49
|
+
- Added native Turborepo and Nx task-runner planning for affected Node workspaces.
|
|
50
|
+
- Added migration guidance when legacy binary `bun.lockb` lockfiles change.
|
|
51
|
+
- Added `Gemfile` dependency diff summaries.
|
|
52
|
+
- Added `composer.json` dependency diff summaries.
|
|
53
|
+
- Added built-in `regulated` and `agentic` policy packs for `patchdrill init`.
|
|
54
|
+
- Added Cargo workspace task planning for affected crates and downstream dependents.
|
|
55
|
+
- Added Go workspace task planning for affected modules and downstream dependents.
|
|
56
|
+
- Added packaged stack fixtures and a fixture harness for planner regression coverage.
|
|
57
|
+
- Added native Pants changed-target task planning.
|
|
58
|
+
- Expanded stack fixtures with Next.js, Rails, PHP/Composer, and Terraform examples.
|
|
59
|
+
- Added language-aware source-to-test matching for missing-test risk findings.
|
|
60
|
+
- Added self-contained static HTML dashboards through `scan --html` and `patchdrill dashboard --json`.
|
|
61
|
+
- Added `report-html` output support to the composite GitHub Action and generated workflow.
|
|
62
|
+
- Added Kubernetes and Helm project detection with manifest dry-run, Kustomize render, and Helm lint plans.
|
|
63
|
+
- Expanded stack fixtures with Kustomize, Java/Gradle, and .NET service examples.
|
|
64
|
+
- Added Bazel and Buck2 workspace detection with graph-wide test and build plans.
|
|
65
|
+
- Added Swift Package Manager detection with `swift test` and `swift build` plans.
|
|
66
|
+
- Added Xcode project/workspace detection with shared-scheme `xcodebuild test` and `xcodebuild build` plans.
|
|
67
|
+
- Added Python framework metadata for Django/FastAPI and Django-specific `manage.py` verification plans.
|
|
68
|
+
- Added Spring Boot framework detection, Gradle fallback commands, and `bootJar` packaging plans.
|
|
69
|
+
- Added Android Gradle detection with debug unit test, assemble, and lint verification plans.
|
|
70
|
+
- Added ASP.NET Core detection with .NET build and publish verification plans.
|
|
71
|
+
- Added FastAPI app entrypoint detection with import-smoke verification plans.
|
|
72
|
+
- Added FastAPI changed router/dependency module import-smoke planning.
|
|
73
|
+
- Added GitHub Actions supply-chain findings for unpinned actions, remote script pipes, and untrusted PR metadata interpolation.
|
|
74
|
+
- Added Bazel and Buck2 changed-package target narrowing with graph-wide fallback for root metadata changes.
|
|
75
|
+
- Added Bazel `rdeps` and Buck2 `uquery rdeps` downstream discovery commands for narrowed target plans.
|
|
76
|
+
- Added .NET project-aware test, build, and ASP.NET Core publish plans using `ProjectReference` relationships.
|
|
77
|
+
- Added Android Gradle variant-aware test, assemble, and lint planning from changed source sets.
|
|
78
|
+
- Added Android product-flavor source set parsing so flavor-only changes plan matching debug variant tasks.
|
|
79
|
+
- Added context-aware GitHub Actions finding for `pull_request_target` workflows that check out pull request head code.
|
|
80
|
+
- Added Python/FastAPI changed-test targeting for matching pytest files with whole-suite fallback.
|
|
81
|
+
- Added whole-file GitHub Actions context so privileged PR-head checkout findings work when only one side of the dangerous pattern is newly added.
|
|
82
|
+
- Added NuGet PackageReference and central PackageVersion dependency change summaries.
|
|
83
|
+
- Added context-aware GitHub Actions findings for reusable workflows that inherit all caller secrets, including mutable remote reusable workflow refs.
|
|
84
|
+
- Added workflow trust-boundary findings for `pull_request_target` OIDC token minting, environment-scoped OIDC jobs, and remote reusable workflows receiving caller OIDC permissions.
|
|
85
|
+
- Added .NET solution filter (`.slnf`) detection and filtered `dotnet test`/`dotnet build` plans for large solutions.
|
|
86
|
+
- Added FastAPI dependency override test targeting for changed dependency helper functions.
|
|
87
|
+
- Added .NET solution-filter selection for changed projects when multiple overlapping `.slnf` files exist.
|
|
88
|
+
- Added Xcode `.xctestplan` detection from shared schemes and `xcodebuild test -testPlan` planning.
|
|
89
|
+
- Added Android generated-source variant detection and `variantFilter` disabled-variant avoidance.
|
|
90
|
+
- Added nested local reusable workflow loading so changed workflows expose downstream reusable workflow secret and OIDC trust-boundary findings.
|
|
91
|
+
- Added cloud OIDC credential exchange findings for AWS, Azure, GCP, and Vault auth jobs without GitHub environment protection.
|
|
92
|
+
- Added `patchdrill demo` and committed synchronized sample Markdown, JSON, SARIF, and HTML artifacts.
|
|
93
|
+
- Added GitHub Actions annotation output for findings through `--github-annotations` and the composite Action, with dedicated documentation.
|
|
94
|
+
- Updated generated workflows to make annotations and step summaries explicit.
|
|
95
|
+
- Added compact Markdown summaries for GitHub step summaries and PR comments.
|
|
96
|
+
- Added first-party Maven and Spring Boot Maven stack fixtures.
|
|
97
|
+
- Added audit evidence manifests with report, artifact, and command-output digests.
|
|
98
|
+
- Added evidence manifest verification against generated artifact hashes.
|
|
99
|
+
- Added evidence manifest regeneration for finalized artifacts and CI verification before upload.
|
|
100
|
+
- Added a `risky-agent-pr` demo scenario for showing fail-state agentic PR evidence without a live repository.
|
|
101
|
+
- Made PR comment upserts fork-safe by warning instead of failing when GitHub token permissions prevent commenting.
|
|
102
|
+
- Added compact PR comment preview files to demo artifacts.
|
|
103
|
+
- Updated generated PR workflows to run required verification commands with a per-command timeout.
|
|
104
|
+
- Added package automation script risk findings for lifecycle hooks, removed verification scripts, no-op checks, and remote shell pipes.
|
|
105
|
+
- Added structured package script change summaries to JSON, Markdown, and HTML reports.
|
|
106
|
+
- Expanded `patchdrill explain` with a clearer AI-reviewer boundary, deterministic guarantees, and first-run commands.
|
|
107
|
+
- Ignored all default generated PatchDrill report artifacts to prevent accidental report commits after local scans.
|
|
108
|
+
- Added mutable `docker://` GitHub Action image findings while allowing sha256 digest-pinned references.
|
|
109
|
+
- Added missing-evidence risk findings when required verification commands are planned but not run.
|
|
110
|
+
- Added dependency proof-gap findings for manifest-only dependency changes and lockfile-only resolution drift.
|
|
111
|
+
- Added nested Python package-root detection with scoped pytest, compile, and optional static-analysis plans.
|
|
112
|
+
- Added nested Cargo workspace detection with manifest-path crate and downstream-dependent verification plans.
|
|
113
|
+
- Added nested Go module and workspace detection with scoped `go test` and `go vet` plans.
|
|
114
|
+
- Added `patchdrill doctor` for first-run repository readiness diagnosis.
|
|
115
|
+
- Added `patchdrill release-check` for local npm and GitHub Action release readiness checks.
|
|
116
|
+
- Added JSON output for `patchdrill doctor --format json` and `patchdrill release-check --format json`.
|
|
117
|
+
- Added JSON Schemas for `patchdrill doctor --format json` and `patchdrill release-check --format json`.
|
|
118
|
+
- Added readiness summaries to doctor/release JSON and dogfooded release-check in CI and release workflows.
|
|
119
|
+
- Added local Markdown link verification to release readiness and documentation tests.
|
|
120
|
+
- Added package file allowlist and launch keyword checks to release readiness.
|
|
121
|
+
- Hardened release readiness so shipped schemas must parse, expose matching `$id` values, and appear in README/SCHEMAS documentation.
|
|
122
|
+
- Added release Proof Pack smoke generation plus evidence verification before npm packaging, and taught release readiness to check CI/action/release evidence verification.
|
|
123
|
+
- Strengthened the release Proof Pack smoke so it runs required PatchDrill commands before verifying evidence.
|
|
124
|
+
- Added launch case studies and a fixture-backed stack coverage matrix.
|
|
125
|
+
- Added named dependency analyzer registry and planner ecosystem introspection for coverage and architecture reporting.
|
|
126
|
+
- Added structured verification status to JSON reports so automation consumers do not have to join command plans and results manually.
|
|
127
|
+
- Hardened evidence verification to reject JSON reports whose structured verification status is missing or drifts from command plans and command results.
|
|
128
|
+
- Hardened `patchdrill evidence --json` so it rejects saved JSON reports that fail the report contract before writing a manifest.
|
|
129
|
+
- Hardened `patchdrill dashboard --json` so stale saved reports must pass the report contract before rendering.
|
|
130
|
+
- Required `scan --evidence` to include `--json` so evidence verification can always check the report contract.
|
|
131
|
+
- Hardened release readiness so CI, Action, and release Proof Pack evidence checks must include JSON report artifacts.
|
|
132
|
+
- Added separate fast and integration test scripts while keeping `npm test` and `npm run check` as the full confidence gates.
|
|
133
|
+
- Added an ESLint flat config with type-aware correctness rules, a `typecheck` step that also covers tests, coverage tooling, `.editorconfig`, and `.gitattributes`; `npm run check` now runs build, typecheck, lint, and tests.
|
|
134
|
+
- Fixed an OpenAI-key detector false positive that flagged ordinary kebab-case slugs and CSS class names (e.g. `sk-button-primary`) as critical secrets.
|
|
135
|
+
- Fixed root-level .NET project detection so a repo-root `.csproj` no longer claims every changed path and triggers spurious builds and tests.
|
|
136
|
+
- Fixed renamed-file churn reporting so `git mv` plus edits report real additions and deletions instead of zero.
|
|
137
|
+
- Hardened evidence verification to reject a manifest that records no JSON report artifact, closing a tamper bypass.
|
|
138
|
+
- Hardened Markdown rendering against fenced-code-block breakout and inline-HTML injection from untrusted command output and finding text.
|
|
139
|
+
- Rejected unknown CLI flags and missing flag values, and required `--max-risk-delta` to be paired with `--baseline`.
|
|
140
|
+
- Made the risk score reconstructable from the displayed findings, excluded declaration files from the missing-test signal, and caught the reversed `rm -fr` form.
|
|
141
|
+
- Counted timed-out verification commands once so the verification summary buckets partition the runs.
|
|
142
|
+
- Anchored CODEOWNERS directory patterns and ecosystem/manifest matching by path segment to remove false positives and false negatives.
|
|
143
|
+
- Replaced prefix-only workspace glob matching with real glob matching, and made single-result project detection deterministic regardless of filesystem order.
|
|
144
|
+
- Stopped treating Cargo `*.metadata.*` tables, basename look-alike manifests, and dropped Gradle `enforcedPlatform`/version-catalog entries as phantom dependency changes; captured Gemfile git/source refs.
|
|
145
|
+
- Aligned `patchdrill doctor` script detection with the planner's exact task aliases.
|
|
146
|
+
- Rejected negative and empty policy rule values that could lower or broaden the risk gate, and added `minimum: 0` to the policy schema weight.
|
|
147
|
+
- Allowed reproducible report timestamps via `SOURCE_DATE_EPOCH` for byte-identical Proof Packs.
|
|
148
|
+
- Corrected demo Proof Pack rule IDs to match the engine and rule catalog.
|
|
149
|
+
- Added a Node version matrix (20, 22, 24), workflow concurrency cancellation, and per-job timeouts to CI.
|
|
150
|
+
- Added localized human-facing reports (English, Korean, Japanese, Simplified Chinese) for the console summary, Markdown summary, Markdown report, and HTML dashboard via a deterministic translation catalog. `scan` auto-detects the system locale (`LC_ALL`/`LANG`) and `--locale` overrides it; JSON, SARIF, and the evidence manifest stay English for machine consumers, and English output remains byte-identical.
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
PatchDrill is intentionally small and deterministic. Contributions should keep the default path fast to understand and easy to review.
|
|
4
|
+
|
|
5
|
+
## Development
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install
|
|
9
|
+
npm run check
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
`npm run check` is the full confidence gate. It runs, in order, `build`
|
|
13
|
+
(emitting and type-checking `src/`), `typecheck` (type-checking `src/` **and**
|
|
14
|
+
`tests/` with no emit via `tsconfig.eslint.json`), `lint` (ESLint with
|
|
15
|
+
type-aware rules), and the test suite, which intentionally includes git-backed
|
|
16
|
+
integration fixtures. For a faster local edit loop, use `npm run test:fast`; use
|
|
17
|
+
`npm run test:integration` when changing scan orchestration, dependency diffing,
|
|
18
|
+
stack fixtures, or git-backed behavior.
|
|
19
|
+
|
|
20
|
+
The linter (`eslint.config.js`) enforces type-aware correctness rules such as
|
|
21
|
+
`no-floating-promises` and `no-unnecessary-condition`. Run `npm run lint:fix` to
|
|
22
|
+
auto-apply safe fixes. `.editorconfig` and `.gitattributes` keep formatting and
|
|
23
|
+
line endings consistent, which protects the byte-identical fixtures.
|
|
24
|
+
|
|
25
|
+
## Useful Commands
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm run build
|
|
29
|
+
npm run typecheck
|
|
30
|
+
npm run lint
|
|
31
|
+
npm run lint:fix
|
|
32
|
+
npm run test:fast
|
|
33
|
+
npm test
|
|
34
|
+
npm run test:integration
|
|
35
|
+
npm run test:coverage
|
|
36
|
+
node dist/cli.js scan
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Adding Rules
|
|
40
|
+
|
|
41
|
+
Risk rules live in `src/risk.ts`. Command inference lives in `src/planner.ts`. Project detection lives in `src/project.ts`.
|
|
42
|
+
Policy loading lives in `src/policy.ts`. SARIF and Markdown rendering live in `src/report.ts`.
|
|
43
|
+
|
|
44
|
+
When adding a rule:
|
|
45
|
+
|
|
46
|
+
1. Add a fixture-style test that demonstrates the behavior.
|
|
47
|
+
2. Keep findings explainable.
|
|
48
|
+
3. Prefer a specific path pattern over a broad one.
|
|
49
|
+
4. Avoid network calls in deterministic scan mode.
|
|
50
|
+
5. Do not include secret-like literal values in fixtures unless they are deliberately synthetic and covered by tests that ensure reports do not echo them.
|
|
51
|
+
|
|
52
|
+
## Pull Request Checklist
|
|
53
|
+
|
|
54
|
+
- The change is covered by tests or fixture evidence.
|
|
55
|
+
- `npm run check` passes.
|
|
56
|
+
- `npm pack --dry-run` passes for packaging, docs, action, or release changes.
|
|
57
|
+
- README or docs are updated when behavior changes.
|
|
58
|
+
- New commands are conservative and do not mutate the checkout.
|
|
59
|
+
- The pull request template includes verification evidence and compatibility notes.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 PatchDrill contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|