aienvmp 0.1.33 → 0.1.35

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,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.35
4
+
5
+ - Added a shared AI preflight contract across status, context, plan, and handoff outputs.
6
+ - Reused the same artifact map, read order, safe commands, decision, and enforcement guidance across AI-facing JSON.
7
+ - Reduced drift risk between multi-agent handoffs and environment planning.
8
+
9
+ ## 0.1.34
10
+
11
+ - Added AI navigation metadata to `.aienvmp/status.json`.
12
+ - Included artifact paths, read order, safe commands, and agent-use rules in the compact status output.
13
+ - Kept the status enhancement read-only and lightweight so `sync` remains the simple default flow.
14
+
3
15
  ## 0.1.33
4
16
 
5
17
  - Made `.aienvmp/status.json` a first-class artifact written by `aienvmp sync`.
package/README.md CHANGED
@@ -54,6 +54,8 @@ AIENV.md
54
54
  ```
55
55
 
56
56
  Trust states are machine-readable: `observed`, `planned`, `changed`, `review`, `verified`, `stale`.
57
+ `status.json` also lists AI read order, artifact paths, and safe commands.
58
+ `status`, `context`, `plan`, and `handoff` share the same AI preflight contract.
57
59
 
58
60
  AI agents can observe, plan, and record. Only a human or CI should mark environment facts as verified.
59
61
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aienvmp",
3
- "version": "0.1.33",
3
+ "version": "0.1.35",
4
4
  "description": "AI-first environment maps and lightweight runtime SBOMs for shared development machines.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,6 +8,7 @@ import { recommendedActions } from "../actions.js";
8
8
  import { buildPlan, compactStepSummary } from "./plan.js";
9
9
  import { aiDecision } from "../decision.js";
10
10
  import { enforcementAdvice } from "../enforcement.js";
11
+ import { buildPreflight } from "../preflight.js";
11
12
 
12
13
  export async function contextWorkspace(args) {
13
14
  const dir = workspaceDir(args);
@@ -20,9 +21,11 @@ export async function contextWorkspace(args) {
20
21
  const decision = aiDecision(warnings, intents);
21
22
  const actions = recommendedActions(manifest, { warnings, intents });
22
23
  const stepSummary = compactStepSummary(buildPlan(manifest, warnings, intents, policy));
24
+ const preflight = buildPreflight(manifest, warnings, intents);
23
25
  if (args.json) {
24
26
  console.log(JSON.stringify({
25
27
  status: warnings.length ? "review-required" : "clear",
28
+ preflight,
26
29
  decision,
27
30
  enforcement: enforcementAdvice(warnings),
28
31
  recommendedActions: actions,
@@ -7,6 +7,7 @@ import { openIntents, readJsonl, readTimeline } from "../timeline.js";
7
7
  import { changedTrust } from "../trust.js";
8
8
  import { recommendedActions } from "../actions.js";
9
9
  import { aiDecision } from "../decision.js";
10
+ import { buildPreflight } from "../preflight.js";
10
11
 
11
12
  export async function handoffWorkspace(args) {
12
13
  const dir = workspaceDir(args);
@@ -49,6 +50,7 @@ export function buildHandoff(manifest, timeline = [], warnings = [], intents = [
49
50
  status: reviewRequired ? "review-required" : "clear",
50
51
  trust: manifest.trust || {},
51
52
  schemaVersion: manifest.schemaVersion || 1,
53
+ preflight: buildPreflight(manifest, warnings, intents),
52
54
  decision: aiDecision(warnings, intents),
53
55
  workspace: manifest.workspace,
54
56
  safeRuntime: {
@@ -8,6 +8,7 @@ import { recommendedActions } from "../actions.js";
8
8
  import { openIntents, readJsonl, readTimeline } from "../timeline.js";
9
9
  import { aiDecision } from "../decision.js";
10
10
  import { enforcementAdvice } from "../enforcement.js";
11
+ import { buildPreflight } from "../preflight.js";
11
12
 
12
13
  export async function planWorkspace(args) {
13
14
  const dir = workspaceDir(args);
@@ -39,6 +40,7 @@ export function buildPlan(manifest, warnings = [], intents = [], policy = {}) {
39
40
  schemaVersion: 1,
40
41
  generatedAt: new Date().toISOString(),
41
42
  status,
43
+ preflight: buildPreflight(manifest, warnings, intents),
42
44
  workspace: manifest.workspace || {},
43
45
  trust: manifest.trust || {},
44
46
  decision: aiDecision(warnings, intents),
@@ -5,9 +5,7 @@ import { readJson } from "../fsutil.js";
5
5
  import { loadPolicy, policyWarnings } from "../policy.js";
6
6
  import { intentsPath, manifestPath, statusJsonPath, timelinePath, workspaceDir } from "../paths.js";
7
7
  import { openIntents, readJsonl, readTimeline } from "../timeline.js";
8
- import { recommendedActions } from "../actions.js";
9
- import { aiDecision } from "../decision.js";
10
- import { enforcementAdvice } from "../enforcement.js";
8
+ import { buildPreflight } from "../preflight.js";
11
9
 
12
10
  export async function statusWorkspace(args) {
13
11
  const dir = workspaceDir(args);
@@ -39,27 +37,5 @@ export async function writeStatusArtifact(dir, status) {
39
37
  }
40
38
 
41
39
  export function buildStatus(manifest = {}, warnings = [], intents = []) {
42
- const decision = aiDecision(warnings, intents);
43
- const enforcement = enforcementAdvice(warnings);
44
- const actions = recommendedActions(manifest, { warnings, intents });
45
- const state = decision.reviewRequired ? "review-required" : "clear";
46
- const topAction = actions[0] || null;
47
- return {
48
- schemaVersion: 1,
49
- state,
50
- summary: state === "clear"
51
- ? "Project-local work can continue. Record intent before environment changes."
52
- : "Review warnings or open intents before environment changes.",
53
- decision,
54
- enforcement,
55
- counts: {
56
- warnings: warnings.length,
57
- openIntents: intents.length,
58
- runtimes: Object.keys(manifest.runtimes || {}).length,
59
- dependencies: Number(manifest.dependencySnapshot?.summary?.packages || 0),
60
- vulnerabilities: Number(manifest.security?.summary?.total || 0)
61
- },
62
- topAction,
63
- nextCommand: topAction?.command || decision.nextCommand
64
- };
40
+ return buildPreflight(manifest, warnings, intents);
65
41
  }
@@ -0,0 +1,65 @@
1
+ import { recommendedActions } from "./actions.js";
2
+ import { aiDecision } from "./decision.js";
3
+ import { enforcementAdvice } from "./enforcement.js";
4
+
5
+ export function buildPreflight(manifest = {}, warnings = [], intents = []) {
6
+ const decision = aiDecision(warnings, intents);
7
+ const enforcement = enforcementAdvice(warnings);
8
+ const actions = recommendedActions(manifest, { warnings, intents });
9
+ const state = decision.reviewRequired ? "review-required" : "clear";
10
+ const topAction = actions[0] || null;
11
+ return {
12
+ schemaVersion: 1,
13
+ state,
14
+ summary: state === "clear"
15
+ ? "Project-local work can continue. Record intent before environment changes."
16
+ : "Review warnings or open intents before environment changes.",
17
+ decision,
18
+ enforcement,
19
+ counts: {
20
+ warnings: warnings.length,
21
+ openIntents: intents.length,
22
+ runtimes: Object.keys(manifest.runtimes || {}).length,
23
+ dependencies: Number(manifest.dependencySnapshot?.summary?.packages || 0),
24
+ vulnerabilities: Number(manifest.security?.summary?.total || 0)
25
+ },
26
+ agentUse: {
27
+ purpose: "First AI-readable environment preflight for this workspace.",
28
+ rule: "Read status first, use context for details, record intent before environment changes.",
29
+ projectLocalWork: decision.canContinueProjectLocalWork ? "allowed" : "review-first",
30
+ environmentChanges: decision.canChangeEnvironmentWithoutReview ? "allowed" : "intent-and-review-first"
31
+ },
32
+ artifacts: preflightArtifacts(),
33
+ readOrder: [
34
+ ".aienvmp/status.json",
35
+ "AIENV.md",
36
+ ".aienvmp/manifest.json",
37
+ ".aienvmp/plan.json",
38
+ ".aienvmp/timeline.jsonl",
39
+ ".aienvmp/intents.jsonl"
40
+ ],
41
+ commands: {
42
+ refresh: "aienvmp sync",
43
+ status: "aienvmp status --write",
44
+ context: "aienvmp context --json",
45
+ plan: "aienvmp plan --write",
46
+ handoff: "aienvmp handoff --record --actor agent:id",
47
+ recordIntent: "aienvmp intent --actor agent:id --action planned-change"
48
+ },
49
+ topAction,
50
+ nextCommand: topAction?.command || decision.nextCommand
51
+ };
52
+ }
53
+
54
+ export function preflightArtifacts() {
55
+ return {
56
+ status: ".aienvmp/status.json",
57
+ envMap: "AIENV.md",
58
+ manifest: ".aienvmp/manifest.json",
59
+ dashboard: ".aienvmp/dashboard.html",
60
+ planJson: ".aienvmp/plan.json",
61
+ planMarkdown: ".aienvmp/plan.md",
62
+ intents: ".aienvmp/intents.jsonl",
63
+ timeline: ".aienvmp/timeline.jsonl"
64
+ };
65
+ }