@mnstry/atelier 0.2.0-alpha.13 → 0.2.0-alpha.14

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 (58) hide show
  1. package/CHANGELOG.md +233 -0
  2. package/README.md +22 -5
  3. package/docs/blocks/capability-stewardship.md +1 -1
  4. package/docs/blocks/learning-harnesses.md +1 -1
  5. package/docs/capability-stewardship.md +2 -4
  6. package/docs/ingestion.md +3 -3
  7. package/docs/inquiry-harnesses.md +2 -3
  8. package/docs/install.md +3 -3
  9. package/docs/learning-harnesses.md +2 -3
  10. package/docs/local-services.md +42 -3
  11. package/docs/obsidian-contract.md +23 -0
  12. package/docs/obsidian-plugin.md +214 -3
  13. package/docs/obsidian.md +271 -11
  14. package/docs/personal-workspace.md +13 -4
  15. package/docs/release-engineering.md +2 -1
  16. package/docs/repo-boundary-guard.md +26 -3
  17. package/docs/semantic-operation.md +4 -3
  18. package/docs/upgrade.md +174 -2
  19. package/fixtures/templates/local-library.v1.json +2 -1
  20. package/package.json +2 -1
  21. package/plugins/obsidian/main.js +57 -8
  22. package/plugins/obsidian/manifest.json +1 -1
  23. package/src/boundary/content-rules.mjs +532 -67
  24. package/src/boundary/policy.mjs +135 -56
  25. package/src/cli/run.mjs +3 -2
  26. package/src/commands/obsidian.mjs +23 -7
  27. package/src/graph/graph.mjs +13 -5
  28. package/src/graph/knowledge-graph.mjs +19 -1
  29. package/src/ingestion/optional/graphify/graphify_supplier.py +5 -0
  30. package/src/ingestion/optional/graphify/native-closure-pins.json +275 -0
  31. package/src/ingestion/optional/graphify/native-pins.json +306 -0
  32. package/src/knowledge-health/rule-identity.mjs +14 -9
  33. package/src/personal-workspace/index.mjs +1 -1
  34. package/src/personal-workspace/selection.mjs +17 -1
  35. package/src/project/path-match.mjs +2 -1
  36. package/src/projection/obsidian/materialize/prepare-view.mjs +87 -5
  37. package/src/projection/obsidian/personal-workspace.mjs +87 -4
  38. package/src/projection/obsidian/proposals/adapter.mjs +46 -23
  39. package/src/projection/obsidian/proposals/observation.mjs +40 -2
  40. package/src/projection/obsidian/publication/publisher.mjs +72 -5
  41. package/src/projection/project.mjs +3 -2
  42. package/src/runtime/obsidian/engine.mjs +293 -55
  43. package/src/runtime/obsidian/lifecycle.mjs +17 -12
  44. package/src/runtime/obsidian/login-item.mjs +4 -1
  45. package/src/runtime/obsidian/observation.mjs +36 -4
  46. package/src/runtime/obsidian/opening.mjs +3 -2
  47. package/src/runtime/obsidian/personal-selection.mjs +125 -0
  48. package/src/runtime/obsidian/pipeline.mjs +44 -3
  49. package/src/runtime/obsidian/private-lock.mjs +39 -4
  50. package/src/runtime/obsidian/service-main.mjs +58 -12
  51. package/src/runtime/obsidian/service.mjs +66 -6
  52. package/src/runtime/obsidian/view-permission.mjs +334 -0
  53. package/src/ui/control-system.mjs +201 -0
  54. package/src/ui/html-primitives.mjs +3 -0
  55. package/src/upgrade/closure-diagnostics.mjs +135 -0
  56. package/src/upgrade/closure.mjs +649 -0
  57. package/src/upgrade/upgrade.mjs +19 -7
  58. package/templates/external-project-workspace/pack-lifecycle.json +2 -1
@@ -15,6 +15,7 @@ import {
15
15
  writeJson,
16
16
  } from '../project/config.mjs'
17
17
  import { packageRootFrom } from '../project/package-root.mjs'
18
+ import { canonicalDiffArgs, gitOutputResult, parseDiffSections } from '../boundary/content-rules.mjs'
18
19
  import {
19
20
  BOUNDARY_POLICY_SCHEMA,
20
21
  checkBoundaryPolicy,
@@ -26,8 +27,10 @@ import { loadExtensionPacks } from '../extension-packs/loader.mjs'
26
27
  import { inspectPackageProvenance, legacyPackageSource } from './provenance.mjs'
27
28
  import { prepareUpgrade, applySavedUpgrade, upgradeOperationStatus, recoverUpgradeDryRun, explainSavedUpgrade } from './transaction.mjs'
28
29
  import { renderUpgradeExplanation } from './explanation.mjs'
30
+ import { planConsumerClosure, runClosurePlanCommand } from './closure.mjs'
29
31
  export { prepareUpgrade, applySavedUpgrade, upgradeOperationStatus, recoverUpgradeDryRun, explainSavedUpgrade }
30
32
  export { prepareTemplateUpgrade } from './transaction.mjs'
33
+ export { planConsumerClosure }
31
34
 
32
35
  export const ATELIER_LOCK_SCHEMA = 'mnstry.atelier-lock@v1'
33
36
  export const ATELIER_MIGRATION_SCHEMA = 'mnstry.atelier-migration@v1'
@@ -411,13 +414,18 @@ function stagedSemanticFindings(project) {
411
414
  const findings = []
412
415
  for (const repo of project.repos ?? []) {
413
416
  if (!isGitRepo(repo.path)) continue
414
- const result = spawnSync('git', ['-C', repo.path, 'diff', '--cached', '--unified=0', '--', '*.md', '*.kg.json'], { encoding: 'utf8' })
415
- if (result.status !== 0 || !result.stdout.trim()) continue
416
- const diff = result.stdout
417
- const changedSemantic = diff
418
- .split('\n')
419
- .some((line) => /^[+-](?![+-])/.test(line) && SEMANTIC_FIELD_RE.test(line))
420
- if (changedSemantic && !REVIEW_MARKER_RE.test(diff)) findings.push(`${repo.name}: staged semantic field change needs Atelier-Boundary-Review marker`)
417
+ // The boundary guard's pinned diff and parser; only a marker added in this
418
+ // change approves it, never a removed line or a file name.
419
+ const result = gitOutputResult(repo.path, [...canonicalDiffArgs(['--cached'], ['--text']), '--', '*.md', '*.kg.json'])
420
+ if (!result.ok) {
421
+ findings.push(`${repo.name}: staged semantic fields could not be read (${result.code})`)
422
+ continue
423
+ }
424
+ const sections = parseDiffSections(result.stdout, { detail: true })
425
+ const changedSemantic = sections.some((section) => section.incomplete
426
+ || section.hunks.some((hunk) => [...hunk.added, ...hunk.removed].some((line) => SEMANTIC_FIELD_RE.test(line))))
427
+ const approved = sections.some((section) => section.hunks.some((hunk) => hunk.added.some((line) => REVIEW_MARKER_RE.test(line))))
428
+ if (changedSemantic && !approved) findings.push(`${repo.name}: staged semantic field change needs Atelier-Boundary-Review marker`)
421
429
  }
422
430
  return findings
423
431
  }
@@ -683,6 +691,10 @@ export function runLockCommand(argv = process.argv.slice(2)) {
683
691
 
684
692
  export function runUpgradeCommand(argv = process.argv.slice(2)) {
685
693
  const args = parseArgs(argv)
694
+ // `closure` plans against an explicit npm root, which need not be an Atelier
695
+ // workspace. It runs before the project is resolved, writes nothing, and lets
696
+ // its typed refusal reach the command wrapper unchanged.
697
+ if (args._[0] === 'closure') return runClosurePlanCommand(args, argv)
686
698
  const project = commandProject({ argv, writeLocalState: args._[0] !== 'explain' })
687
699
  if (['plan', 'apply', 'status', 'recover', 'explain'].includes(args._[0])) {
688
700
  try {
@@ -11,7 +11,8 @@
11
11
  "0.2.0-alpha.10",
12
12
  "0.2.0-alpha.11",
13
13
  "0.2.0-alpha.12",
14
- "0.2.0-alpha.13"
14
+ "0.2.0-alpha.13",
15
+ "0.2.0-alpha.14"
15
16
  ],
16
17
  "status": "active"
17
18
  }