nexarch 0.9.6 → 0.9.8

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.
@@ -444,6 +444,32 @@ function injectTrustAttestationUnavailableBlock(path, reason) {
444
444
  }
445
445
  writeFileSync(path, replaced !== existing ? replaced : `${existing}${existing.endsWith("\n") ? "" : "\n"}${managed}\n`, "utf8");
446
446
  }
447
+ function injectInitProjectReportingContract(path) {
448
+ const section = [
449
+ "## Nexarch Init-Project Reporting Contract",
450
+ "",
451
+ "When you run `npx nexarch@latest init-project`, treat it as skeleton registration only.",
452
+ "Do not claim full completion until enrichment commands are actually executed.",
453
+ "",
454
+ "Required final status fields in your reply after init-project:",
455
+ '- `registration_status`: `"skeleton_only"` or `"enriched"`',
456
+ '- `enrichment_completed`: `true` or `false`',
457
+ "",
458
+ "Hard rule:",
459
+ '- If `enrichment_completed=false`, you MUST include: `Enrichment pending: run update-entity/enrichment steps.`',
460
+ '- If `enrichment_completed=false`, NEVER say: "fully registered", "fully done", or equivalent.',
461
+ "",
462
+ "You may set `registration_status=\"enriched\"` only after executing enrichment actions (e.g. update-entity for project/sub-packages, aliases, and any chosen gap wiring).",
463
+ "",
464
+ ].join("\n");
465
+ const existing = existsSync(path) ? readFileSync(path, "utf8") : "";
466
+ const managed = wrapManagedSection("init-project-reporting-contract", section.trim());
467
+ let replaced = replaceManagedSection(existing, "init-project-reporting-contract", section.trim());
468
+ if (replaced === existing) {
469
+ replaced = replaceInjectedSection(existing, "## Nexarch Init-Project Reporting Contract", managed);
470
+ }
471
+ writeFileSync(path, replaced !== existing ? replaced : `${existing}${existing.endsWith("\n") ? "" : "\n"}${managed}\n`, "utf8");
472
+ }
447
473
  function injectGenericAgentConfig(registry) {
448
474
  const templateByCode = new Map(registry.instructionTemplates.map((t) => [t.code, t]));
449
475
  const genericTargets = [...registry.instructionTargets]
@@ -1114,6 +1140,7 @@ export async function initAgent(args) {
1114
1140
  else {
1115
1141
  injectTrustAttestationUnavailableBlock(r.path, trustAttestation.reason ?? "unknown");
1116
1142
  }
1143
+ injectInitProjectReportingContract(r.path);
1117
1144
  }
1118
1145
  catch {
1119
1146
  // non-fatal
@@ -1222,6 +1249,12 @@ export async function initAgent(args) {
1222
1249
  consentPrompt: "I detected a likely project in this directory. Do you want me to run init-project now?",
1223
1250
  actionIfApproved: "run_init_project",
1224
1251
  command: "npx nexarch@latest init-project --dir . --json",
1252
+ reportingContract: {
1253
+ requiredFields: ["registration_status", "enrichment_completed"],
1254
+ allowedRegistrationStatus: ["skeleton_only", "enriched"],
1255
+ forbiddenWhenEnrichmentPending: ["fully registered", "fully done"],
1256
+ mandatoryLineWhenEnrichmentPending: "Enrichment pending: run update-entity/enrichment steps.",
1257
+ },
1225
1258
  }
1226
1259
  : {
1227
1260
  detected: false,
@@ -1646,8 +1646,8 @@ ${finalStep} — Identify architecturally significant components not auto-detect
1646
1646
  ║ ENRICHMENT TASK — action required ║
1647
1647
  ╚══════════════════════════════════════════════════════════════════╝
1648
1648
 
1649
- The mechanical scan has written a skeleton graph entry for this project.
1650
- You now need to enrich it with meaningful content.
1649
+ The mechanical scan has written a skeleton graph entry for this project (NOT fully enriched).
1650
+ You now need to enrich it with meaningful content before considering registration complete.
1651
1651
 
1652
1652
  PROJECT ENTITY : ${projectExternalKey}
1653
1653
  PROJECT DIR : ${dir}
@@ -1655,6 +1655,10 @@ ECOSYSTEM(S) : ${ecosystemLabel}
1655
1655
  MANIFEST : ${manifestHint}
1656
1656
  ${readmeHints.length > 0 ? `README FILES : ${readmeHints.join(", ")}` : "README FILES : (none found — check docs/)"}
1657
1657
 
1658
+ IMPORTANT REPORTING RULE:
1659
+ Do NOT report "fully registered" or "fully done" after init-project alone.
1660
+ Correct status after init-project is: "skeleton created; enrichment pending" until Steps 1+ are completed.
1661
+
1658
1662
  STEP 1 — Read the project README / docs and build your understanding of:
1659
1663
  • What does this project do? (business purpose, key features)
1660
1664
  • Who are the users?
@@ -1750,6 +1754,7 @@ ${subPkgSection}${adrSection}${gapCheckSection}`;
1750
1754
  console.log(`\nDone.`);
1751
1755
  console.log(` Entities : ${output.entities.succeeded ?? 0} written, ${output.entities.failed ?? 0} failed`);
1752
1756
  console.log(` Relationships: ${output.relationships.succeeded ?? 0} written`);
1757
+ console.log(" Status : skeleton created; enrichment pending");
1753
1758
  if (output.metrics.relationshipsSkippedAsDuplicate > 0) {
1754
1759
  console.log(` Deduped rels : ${output.metrics.relationshipsSkippedAsDuplicate} skipped as duplicates before upsert`);
1755
1760
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexarch",
3
- "version": "0.9.6",
3
+ "version": "0.9.8",
4
4
  "description": "Your architecture workspace for AI delivery.",
5
5
  "keywords": [
6
6
  "nexarch",