nexarch 0.12.10 → 0.12.11
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/dist/commands/init-agent.js +30 -11
- package/package.json +1 -1
|
@@ -477,27 +477,46 @@ function injectTrustAttestationUnavailableBlock(path, reason) {
|
|
|
477
477
|
}
|
|
478
478
|
function injectInitProjectReportingContract(path) {
|
|
479
479
|
const section = [
|
|
480
|
-
"## Nexarch Init-Project
|
|
480
|
+
"## Nexarch Init-Project Completion Contract",
|
|
481
481
|
"",
|
|
482
|
-
"
|
|
483
|
-
"
|
|
482
|
+
"`init-project` is the first step of registration, not the whole task. It returns",
|
|
483
|
+
"`registrationStatus`, `enrichmentCompleted` and a `nextSteps` array. While",
|
|
484
|
+
"`enrichmentCompleted` is `false`, the work is unfinished.",
|
|
484
485
|
"",
|
|
485
|
-
"
|
|
486
|
-
|
|
487
|
-
|
|
486
|
+
"**Run the commands in `nextSteps` before you report back.** They are the step that",
|
|
487
|
+
"puts real content in the graph. Reporting `skeleton_only` and stopping is not a",
|
|
488
|
+
"completed task — it is a description of a task you have not finished.",
|
|
489
|
+
"",
|
|
490
|
+
"For an infrastructure repository, `nextSteps` holds one `ingest-infra` command per",
|
|
491
|
+
"Terraform root module. Until they run, the graph knows the repository exists but",
|
|
492
|
+
"nothing it provisions.",
|
|
488
493
|
"",
|
|
489
|
-
"
|
|
490
|
-
|
|
491
|
-
|
|
494
|
+
"Stop early only when a step genuinely cannot run — missing cloud credentials, a root",
|
|
495
|
+
"module that needs `terraform init`, or an environment you should not touch without",
|
|
496
|
+
"asking. When that happens, say which step stopped you and why, then ask. Do not",
|
|
497
|
+
"silently return a skeleton.",
|
|
492
498
|
"",
|
|
493
|
-
"
|
|
499
|
+
"When reporting:",
|
|
500
|
+
'- `registration_status`: `"skeleton_only"` or `"enriched"` — take it from the command output, do not infer it',
|
|
501
|
+
'- `enrichment_completed`: `true` or `false`',
|
|
502
|
+
'- Describing a skeleton as fully registered overstates what is in the graph; so does reporting success without saying what remains.',
|
|
503
|
+
"",
|
|
504
|
+
"Enrichment uses explicit per-entity `update-entity` runs rather than a bulk shortcut,",
|
|
505
|
+
"so each entity gets evidence-based content.",
|
|
494
506
|
"",
|
|
495
507
|
].join("\n");
|
|
496
508
|
const existing = existsSync(path) ? readFileSync(path, "utf8") : "";
|
|
497
509
|
const managed = wrapManagedSection("init-project-reporting-contract", section.trim());
|
|
498
510
|
let replaced = replaceManagedSection(existing, "init-project-reporting-contract", section.trim());
|
|
499
511
|
if (replaced === existing) {
|
|
500
|
-
|
|
512
|
+
// The section was renamed from "Reporting Contract" to "Completion Contract".
|
|
513
|
+
// Files written before managed markers existed carry the old heading, so both
|
|
514
|
+
// are matched — otherwise the rename would leave the superseded contract in
|
|
515
|
+
// place alongside the new one, and the old one tells the agent to stop.
|
|
516
|
+
replaced = replaceInjectedSection(existing, "## Nexarch Init-Project Completion Contract", managed);
|
|
517
|
+
if (replaced === existing) {
|
|
518
|
+
replaced = replaceInjectedSection(existing, "## Nexarch Init-Project Reporting Contract", managed);
|
|
519
|
+
}
|
|
501
520
|
}
|
|
502
521
|
writeFileSync(path, replaced !== existing ? replaced : `${existing}${existing.endsWith("\n") ? "" : "\n"}${managed}\n`, "utf8");
|
|
503
522
|
}
|