@ankhorage/doctor 0.2.1 → 0.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 0c86ddb: Add a profile-based doctor policy engine with non-mutating fix plans.
8
+
3
9
  ## 0.2.1
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # DOCTOR
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v0.2.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v0.2.1](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
7
7
 
8
8
  Executable doctor provider and standalone CLI for lightweight Ankhorage repo and package compliance diagnostics.
9
9
 
@@ -25,10 +25,18 @@ Current command surface:
25
25
  - `repo`
26
26
  - `package`
27
27
 
28
- `doctor#1` intentionally stays lightweight:
28
+ `doctor#2` adds a profile-based policy engine:
29
29
 
30
- - path-aware local repo/package diagnostics are implemented now
31
- - GitHub checks, CI checks, full policy enforcement, and autofix rules are deferred
30
+ - strict `public-package` validation for extracted public package repos
31
+ - light recognized `integration-monorepo` validation for `ankhorage4`
32
+ - non-mutating `fix` plans for deterministic mechanical changes only
33
+
34
+ Still deferred:
35
+
36
+ - GitHub checks
37
+ - CI checks
38
+ - on-disk `fix --apply`
39
+ - deeper cross-repo policy enforcement
32
40
 
33
41
  Path handling:
34
42
 
@@ -1,15 +1,32 @@
1
- import type { DoctorDiagnostic } from './diagnostics.js';
1
+ import type { DoctorDiagnostic, DoctorPolicyProfile, DoctorRuleId } from './diagnostics.js';
2
2
  export type DoctorTargetCheck = 'package' | 'repo';
3
3
  export type DoctorTargetMode = 'fix' | 'package' | 'repo' | 'validate';
4
+ export type DoctorPlannedChangeKind = 'create-directory' | 'create-file' | 'update-json' | 'update-text';
4
5
  export interface DoctorAnalysisRequest {
5
6
  readonly cwd: string;
6
7
  readonly inputPath?: string;
7
8
  readonly mode: DoctorTargetMode;
8
9
  }
10
+ export interface DoctorPlannedChange {
11
+ readonly description: string;
12
+ readonly filePath: string;
13
+ readonly kind: DoctorPlannedChangeKind;
14
+ readonly ruleId: DoctorRuleId;
15
+ readonly safe: boolean;
16
+ }
17
+ export interface DoctorFixPlan {
18
+ readonly changes: readonly DoctorPlannedChange[];
19
+ readonly diagnostics: readonly DoctorDiagnostic[];
20
+ readonly profile: DoctorPolicyProfile;
21
+ readonly targetPath: string;
22
+ }
9
23
  export interface DoctorAnalysisResult {
10
24
  readonly appliedChecks: readonly DoctorTargetCheck[];
11
25
  readonly diagnostics: readonly DoctorDiagnostic[];
26
+ readonly fixPlan: DoctorFixPlan | null;
12
27
  readonly hasPackageJson: boolean;
28
+ readonly plannedChanges: readonly DoctorPlannedChange[];
29
+ readonly profile: DoctorPolicyProfile;
13
30
  readonly repoMarkers: readonly string[];
14
31
  readonly targetPath: string;
15
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"analysis.d.ts","sourceRoot":"","sources":["../src/analysis.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,MAAM,CA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