@dailephd/my-dev-kit-lab 0.3.1 → 0.3.3

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.
Files changed (29) hide show
  1. package/README.md +24 -18
  2. package/dist/scripts/audits/runAudit.js +8 -2
  3. package/dist/scripts/security/validate.js +16 -47
  4. package/dist/src/audits/codeRot/detectors/deadCodeCandidateDetector.js +191 -1
  5. package/dist/src/audits/codeRot/detectors/docsCodeMismatchDetector.js +202 -4
  6. package/dist/src/audits/codeRot/detectors/duplicateImplementationDetector.js +42 -9
  7. package/dist/src/audits/codeRot/detectors/testRotDetector.js +241 -1
  8. package/dist/src/audits/codeRot/utils/filePatternUtils.js +19 -1
  9. package/dist/src/audits/codeRot/utils/jvmSourceFactsUtils.js +153 -0
  10. package/dist/src/audits/core/auditConfig.js +2 -2
  11. package/dist/src/audits/core/auditRunner.js +19 -0
  12. package/dist/src/audits/core/auditTypes.js +14 -7
  13. package/dist/src/audits/core/javaAnalyzer.js +282 -0
  14. package/dist/src/audits/core/jvmProjectMetadata.js +106 -0
  15. package/dist/src/audits/core/kotlinAnalyzer.js +280 -0
  16. package/dist/src/audits/core/languageAnalyzerRegistry.js +12 -3
  17. package/dist/src/audits/core/projectInventory.js +76 -3
  18. package/dist/src/audits/core/pythonAnalyzer.js +328 -0
  19. package/dist/src/audits/core/pythonProjectMetadata.js +80 -0
  20. package/dist/src/audits/report/auditReportModel.js +3 -0
  21. package/dist/src/audits/report/renderAuditJsonReport.js +2 -0
  22. package/dist/src/audits/report/renderAuditTextReport.js +40 -0
  23. package/dist/src/audits/security/mapSecurityFindingToAuditIssue.js +70 -0
  24. package/dist/src/audits/security/securityAuditAdapter.js +70 -0
  25. package/dist/src/audits/security/securityAuditTypes.js +17 -0
  26. package/dist/src/securityValidation/report/buildSecurityReport.js +31 -0
  27. package/dist/src/securityValidation/report/writeSecurityReportFiles.js +28 -0
  28. package/dist/src/securityValidation/validate/resolveTarget.js +9 -0
  29. package/package.json +6 -8
@@ -0,0 +1,31 @@
1
+ export function buildSecurityReportFromSummary(summary, options = {}) {
2
+ return {
3
+ metadata: {
4
+ toolRoot: summary.toolRoot,
5
+ toolPackageName: summary.toolPackageName,
6
+ toolPackageVersion: summary.toolPackageVersion,
7
+ targetRoot: summary.targetRoot,
8
+ targetDescription: summary.targetDescription,
9
+ packageName: summary.packageName,
10
+ packageVersion: summary.packageVersion,
11
+ branch: summary.auditedBranch,
12
+ commit: summary.auditedCommit,
13
+ isSelf: summary.isSelf,
14
+ generatedAt: summary.finishedAt,
15
+ totalDurationMs: new Date(summary.finishedAt).getTime() - new Date(summary.startedAt).getTime(),
16
+ profile: options.profile,
17
+ selectedChecks: options.selectedChecks,
18
+ failOnThreshold: options.failOnThreshold,
19
+ formats: options.formats,
20
+ failOnBreached: options.failOnBreached,
21
+ isFullReleaseGate: summary.isFullReleaseGate,
22
+ },
23
+ sections: [],
24
+ allChecks: summary.checks,
25
+ allFindings: summary.findings,
26
+ verdict: summary.verdict,
27
+ recommendedNextStep: summary.recommendedNextStep,
28
+ attackResults: summary.attackResults,
29
+ verdictReasonSummary: summary.verdictReasonSummary,
30
+ };
31
+ }
@@ -0,0 +1,28 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { renderJsonReport, renderTextReport } from "./renderSecurityReport.js";
4
+ export function writeSecurityReportFiles(options) {
5
+ const reportDir = options.outDir;
6
+ if (!fs.existsSync(reportDir)) {
7
+ fs.mkdirSync(reportDir, { recursive: true });
8
+ }
9
+ const basename = options.reportPathSuffix
10
+ ? `${options.prefix}-${options.reportPathSuffix}-security-validation`
11
+ : `${options.prefix}-security-validation`;
12
+ const textPath = options.formats.includes("text")
13
+ ? path.join(reportDir, `${basename}.txt`)
14
+ : null;
15
+ const jsonPath = options.formats.includes("json")
16
+ ? path.join(reportDir, `${basename}.json`)
17
+ : null;
18
+ const writtenPaths = [];
19
+ if (textPath) {
20
+ fs.writeFileSync(textPath, renderTextReport(options.report), "utf8");
21
+ writtenPaths.push(textPath);
22
+ }
23
+ if (jsonPath) {
24
+ fs.writeFileSync(jsonPath, renderJsonReport(options.report), "utf8");
25
+ writtenPaths.push(jsonPath);
26
+ }
27
+ return { textPath, jsonPath, writtenPaths };
28
+ }
@@ -8,6 +8,15 @@ export function resolveValidationTarget(targetPathArg, toolRoot) {
8
8
  // Returns the prefix to use for report filenames based on target metadata.
9
9
  // For self-validation: "v<version>" (preserves existing behavior).
10
10
  // For external targets: "<sanitized-name>-v<version>" or "<sanitized-dirname>".
11
+ //
12
+ // v0.3.2 Batch 4 — the parameter type is deliberately narrowed to a Pick of
13
+ // SecurityValidationTarget (rather than the full type) so the audit security
14
+ // adapter (src/audits/security/securityAuditAdapter.ts) can call this with a
15
+ // plain object built from a SecurityValidationSummary (which carries these
16
+ // same four fields but isn't itself a SecurityValidationTarget) instead of
17
+ // re-resolving the target a second time. Every existing caller already passes
18
+ // a full SecurityValidationTarget, which satisfies this narrower type
19
+ // unchanged.
11
20
  export function reportFilenamePrefix(target) {
12
21
  if (target.isSelf && target.packageVersion) {
13
22
  return `v${target.packageVersion}`;
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@dailephd/my-dev-kit-lab",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "type": "module",
5
5
  "description": "Evidence, benchmark, and evaluation companion for my-dev-kit.",
6
6
  "bin": {
7
7
  "my-dev-kit-lab": "dist/scripts/run-final-demo.js"
8
8
  },
9
- "files": [
10
- "dist/scripts/",
11
- "!dist/scripts/docs/",
12
- "dist/src/",
13
- "benchmarks/",
9
+ "files": [
10
+ "dist/scripts/",
11
+ "!dist/scripts/docs/",
12
+ "dist/src/",
13
+ "benchmarks/",
14
14
  "docs/METRICS.md",
15
15
  "examples/",
16
16
  "tests/fixtures/"
@@ -64,8 +64,6 @@
64
64
  "experiment:list": "tsx scripts/experiments/listExperiments.ts",
65
65
  "experiment:describe": "tsx scripts/experiments/describeExperiment.ts",
66
66
  "experiment:run": "tsx scripts/experiments/runExperiment.ts",
67
- "ecosystem:sync": "tsx scripts/docs/syncEcosystemDocs.ts",
68
- "ecosystem:check": "tsx scripts/docs/checkEcosystemDocs.ts",
69
67
  "run-final-demo": "tsx scripts/run-final-demo.ts",
70
68
  "run-agent-prompt": "tsx scripts/run-agent-prompt.ts",
71
69
  "run-controlled-experiment": "tsx scripts/run-controlled-experiment.ts",