@c4a/context 0.6.18 → 0.7.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.
Files changed (130) hide show
  1. package/README.md +5 -5
  2. package/README.zh-CN.md +5 -5
  3. package/codeIndexPlan.d.ts +84 -0
  4. package/contracts.d.ts +2 -1
  5. package/docs/README.md +7 -0
  6. package/docs/README.zh-CN.md +5 -0
  7. package/docs/getting-started.md +12 -12
  8. package/docs/guides/agent-guide.md +18 -9
  9. package/docs/guides/code-indexer-skill-authoring.md +124 -0
  10. package/docs/guides/indexer-provider-and-customization.md +140 -0
  11. package/docs/guides/lark-resources.md +7 -0
  12. package/docs/guides/markdown-indexer-skill-authoring.md +118 -0
  13. package/docs/guides/package-outputs.md +3 -3
  14. package/docs/reference/code-extractors.md +7 -6
  15. package/docs/reference/indexer-provider-protocol.md +819 -0
  16. package/docs/reference/package-templates.md +18 -10
  17. package/docs/reference/project-api.md +49 -24
  18. package/index.d.ts +48 -2
  19. package/index.js +28239 -3948
  20. package/indexerAgentStepProtocol.d.ts +9391 -0
  21. package/indexerArtifactDependencies.d.ts +689 -0
  22. package/indexerArtifactPolicy.d.ts +335 -0
  23. package/indexerArtifactResult.d.ts +2010 -0
  24. package/indexerAuditFacts.d.ts +66 -0
  25. package/indexerAuditOverrideReadiness.d.ts +27 -0
  26. package/indexerAuditProtocol.d.ts +238 -0
  27. package/indexerAuditRevision.d.ts +726 -0
  28. package/indexerAuditRevisionActions.d.ts +236 -0
  29. package/indexerAuthoringFixture.d.ts +152 -0
  30. package/indexerBaseQuestionAmendment.d.ts +2403 -0
  31. package/indexerBenchmark.d.ts +1062 -0
  32. package/indexerCandidateCompile.d.ts +801 -0
  33. package/indexerCapabilityGroupEvidence.d.ts +129 -0
  34. package/indexerCatalogFallback.d.ts +1262 -0
  35. package/indexerCollectionMapping.d.ts +75 -0
  36. package/indexerContentLayers.d.ts +137 -0
  37. package/indexerControlledInvocation.d.ts +512 -0
  38. package/indexerControlledProgram.d.ts +12535 -0
  39. package/indexerCoreExports.d.ts +21 -0
  40. package/indexerCustomizationDraft.d.ts +13800 -0
  41. package/indexerCustomizationLadder.d.ts +103 -0
  42. package/indexerDependencyView.d.ts +1610 -0
  43. package/indexerEvidenceAdapterResult.d.ts +504 -0
  44. package/indexerExampleDecision.d.ts +1606 -0
  45. package/indexerExampleIdentity.d.ts +132 -0
  46. package/indexerExampleIdentityAudit.d.ts +70 -0
  47. package/indexerExampleLinkageAudit.d.ts +80 -0
  48. package/indexerGeneratedAuthoringAudit.d.ts +208 -0
  49. package/indexerIncrementalImpact.d.ts +221 -0
  50. package/indexerInventoryDisposition.d.ts +443 -0
  51. package/indexerLayerComposition.d.ts +1652 -0
  52. package/indexerLayoutChange.d.ts +329 -0
  53. package/indexerLayoutProposalSet.d.ts +447 -0
  54. package/indexerLayoutResolver.d.ts +342 -0
  55. package/indexerLayoutTransition.d.ts +247 -0
  56. package/indexerLifecycle.d.ts +53 -0
  57. package/indexerMainLifecycle.d.ts +258 -0
  58. package/indexerMainRunLedger.d.ts +888 -0
  59. package/indexerMainRunProtocol.d.ts +6471 -0
  60. package/indexerMainWorkset.d.ts +2141 -0
  61. package/indexerMaterialAnswer.d.ts +738 -0
  62. package/indexerMaterialAnswerActualization.d.ts +91 -0
  63. package/indexerMaterialAnswerExecutionPlan.d.ts +2887 -0
  64. package/indexerMaterialAnswerFlow.d.ts +63 -0
  65. package/indexerMaterialAnswerLayout.d.ts +76 -0
  66. package/indexerMaterialAnswerReview.d.ts +217 -0
  67. package/indexerMaterialAnswerReviewRoute.d.ts +6145 -0
  68. package/indexerMaterialAnswerRunLedger.d.ts +918 -0
  69. package/indexerMaterialAnswerRunProtocol.d.ts +1253 -0
  70. package/indexerMaterialGapLedger.d.ts +3111 -0
  71. package/indexerMaterialQuestionExclusion.d.ts +129 -0
  72. package/indexerMaterialQuestionWorkset.d.ts +508 -0
  73. package/indexerNavigationArtifactGraph.d.ts +5 -0
  74. package/indexerNavigationArtifactPlan.d.ts +39 -0
  75. package/indexerOverlayQuestionAmendment.d.ts +2551 -0
  76. package/indexerOverlayQuestionApplyProposal.d.ts +4697 -0
  77. package/indexerOverlayTrust.d.ts +1425 -0
  78. package/indexerParserCoordinate.d.ts +222 -0
  79. package/indexerParserFactView.d.ts +503 -0
  80. package/indexerPartitionConvergence.d.ts +496 -0
  81. package/indexerPartitionPlan.d.ts +919 -0
  82. package/indexerPartitionStrategyResolution.d.ts +594 -0
  83. package/indexerPhysicalArtifactAudit.d.ts +247 -0
  84. package/indexerPhysicalArtifactManifest.d.ts +449 -0
  85. package/indexerPlannedMaterialAnswer.d.ts +116 -0
  86. package/indexerPostAuthorComposition.d.ts +2000 -0
  87. package/indexerPostAuthorRunLedger.d.ts +1972 -0
  88. package/indexerPrimaryProjection.d.ts +262 -0
  89. package/indexerProfileContract.d.ts +3034 -0
  90. package/indexerProfileMetricAudit.d.ts +218 -0
  91. package/indexerProgramExecutionAuthorization.d.ts +227 -0
  92. package/indexerProgramRunProtocol.d.ts +7642 -0
  93. package/indexerProjectProposal.d.ts +2807 -0
  94. package/indexerProjectedArtifactFanOutAudit.d.ts +159 -0
  95. package/indexerProjectedArtifactPlan.d.ts +217 -0
  96. package/indexerProtocolCommon.d.ts +29 -0
  97. package/indexerProvider.d.ts +2573 -0
  98. package/indexerProviderComposition.d.ts +1357 -0
  99. package/indexerProviderContractReferences.d.ts +13 -0
  100. package/indexerProviderProfileResolution.d.ts +20 -0
  101. package/indexerProviderResolution.d.ts +752 -0
  102. package/indexerProviderResolutionAction.d.ts +678 -0
  103. package/indexerProviderRouting.d.ts +3909 -0
  104. package/indexerProviderSelectionProposal.d.ts +3311 -0
  105. package/indexerQuestionAuthority.d.ts +419 -0
  106. package/indexerReaderTargetInventory.d.ts +161 -0
  107. package/indexerReferenceOnlyAudit.d.ts +90 -0
  108. package/indexerRegistry.d.ts +3019 -0
  109. package/indexerRequirementComparison.d.ts +44 -0
  110. package/indexerRequirementConfirmation.d.ts +1193 -0
  111. package/indexerRequirementLifecycle.d.ts +3314 -0
  112. package/indexerRestrictedSelector.d.ts +63 -0
  113. package/indexerResultReconciliation.d.ts +6844 -0
  114. package/indexerResultReconciliationRun.d.ts +15 -0
  115. package/indexerRunEnvelope.d.ts +384 -0
  116. package/indexerRunProtocolCommon.d.ts +21 -0
  117. package/indexerSharedArtifactFingerprint.d.ts +33 -0
  118. package/indexerStructuredDeclaration.d.ts +513 -0
  119. package/indexerSubjectCatalog.d.ts +230 -0
  120. package/indexerSubjectIdentity.d.ts +19 -0
  121. package/indexerSubjectKeyAuthority.d.ts +785 -0
  122. package/indexerTemplateRendering.d.ts +485 -0
  123. package/indexerToolSnapshot.d.ts +431 -0
  124. package/indexerWorksetRead.d.ts +287 -0
  125. package/package.json +1 -1
  126. package/phases.d.ts +11 -9
  127. package/templates/package-templates/kb/AGENTS.md +1 -1
  128. package/templates/package-templates/kb/skills/knowledge-query/SKILL.md +1 -1
  129. package/templates/package-templates.zh-CN/kb/AGENTS.md +1 -1
  130. package/templates/package-templates.zh-CN/kb/skills/knowledge-query/SKILL.md +1 -1
@@ -41,7 +41,7 @@ kbPackage({
41
41
  llmsPackage({
42
42
  name: "component-lib-llms",
43
43
  template: "src/package-templates/llms",
44
- select: { include: ["codegraph/component-lib/**"] },
44
+ select: { include: ["codeindex/component-lib/**"] },
45
45
  });
46
46
  ```
47
47
 
@@ -259,7 +259,7 @@ its pages instead of producing one index per path segment.
259
259
  The generated
260
260
  `dist/<package-name>/wikis/` tree is the required default
261
261
  KB entry surface. Internal collections are mapped into OKF roots during build:
262
- `codegraph`, `business`, and `product` go to `wikis/`; `architecture`, `sop`,
262
+ `codeindex`, `business`, and `product` go to `wikis/`; `architecture`, `sop`,
263
263
  `faq`, `decision`, and `incident` go to `guides/`; `standards` and `test` go to
264
264
  `rules/`; and `feats` goes to `feats/`. Treat `wikis/` as the structured
265
265
  entity-and-relationship layer. Guides and rules may explain, operationalize,
@@ -307,17 +307,25 @@ wants project-specific behavior beyond knowledge lookup.
307
307
 
308
308
  ## Context OKF Profiles
309
309
 
310
- Approved Markdown under `knowledge/` is the production source of truth:
310
+ Approved Markdown under `knowledge/` and its deterministic
311
+ `knowledge/structure.yaml` projection form the authoring source of truth:
311
312
 
312
313
  - top-level YAML frontmatter uses OKF fields such as `type`, `title`,
313
314
  `description`, `tags`, `timestamp`, and `resource`;
314
- - Context production metadata such as `sources`, `node_type`, `visibility`,
315
- `code_symbols`, relationship records, and `candidate_fingerprint` also lives
316
- at the top level;
315
+ - each Markdown page keeps reader fields, stable page identity, `sources`, and a
316
+ small recovery capsule (`resource`, `node_type`, containment fields, and
317
+ relationship mode);
318
+ - large or repeated machine state such as complete `code_symbols`, code
319
+ evidence, relationship records, candidate fingerprints, and optimization
320
+ decisions lives once in the corresponding `structure.yaml` view record;
321
+ - Context readers hydrate that machine state in memory before verify, audit,
322
+ revision, or build. Do not copy a compact page as a new page without using a
323
+ Context authoring command;
317
324
  - do not nest Context production metadata under `context`; fields such as
318
325
  `context.sources` and `context.code_symbols` are not part of the 0.6 profile;
319
326
  - section provenance lives in `<!-- context:section ... source_ref="..." -->`
320
- comments;
327
+ comments. When a Section needs more than one citation, the CLI preserves the
328
+ complete set in its adjacent `context:source_refs` block;
321
329
  - do not add frontmatter `source_refs`; page-level provenance is derived from
322
330
  section source refs when needed;
323
331
  - do not add `context` or `schema` fields.
@@ -340,7 +348,7 @@ src-N#span:<heading-hint> L<start>-<end>@<span-hash>
340
348
 
341
349
  The code symbol form includes the source-relative file so same-name symbols in
342
350
  different files resolve to one exact symbol-index row. Consumers should still
343
- treat the complete `source_ref` as opaque. Production codegraph pages keep
351
+ treat the complete `source_ref` as opaque. Production codeindex pages keep
344
352
  `candidate_fingerprint` at the top level and do not duplicate this evidence in
345
353
  `code_origin`.
346
354
 
@@ -392,8 +400,8 @@ current closed state.
392
400
 
393
401
  Before writing output, `context build` validates that rendered template paths
394
402
  are safe, unique, and do not collide with copied knowledge paths. For example,
395
- a template file that renders to `wikis/codegraph/foo.md` is rejected if
396
- selected knowledge such as `knowledge/codegraph/foo.md` maps to that same OKF
403
+ a template file that renders to `wikis/codeindex/foo.md` is rejected if
404
+ selected knowledge such as `knowledge/codeindex/foo.md` maps to that same OKF
397
405
  output path. Rename the template file or use `select.exclude` when the
398
406
  collision is intentional.
399
407
 
@@ -29,7 +29,7 @@ the date:
29
29
  ```text
30
30
  knowledge/<collection>/<slug>.md
31
31
  knowledge/<collection>/<containment>/<slug>.md # only for an intentional hierarchy
32
- knowledge/codegraph/<module>/symbol/<slug>.md
32
+ knowledge/codeindex/<module>/symbol/<slug>.md
33
33
  repo:<date>/<module>#symbol:...
34
34
  file:<date>/<module>/<document>#span:...
35
35
  lark:<date>/<module>/<document>#span:...
@@ -41,12 +41,12 @@ dist/<source-name>-kb/...
41
41
  Choose the module boundary before extraction. In a monorepo, register each
42
42
  confirmed package/subdirectory under the same date batch. A repo root that
43
43
  resolves to multiple modules is for inspection; it is not an extraction unit.
44
- Approved codegraph paths use the stable module name; the date remains only in
44
+ Approved codeindex paths use the stable module name; the date remains only in
45
45
  source selectors, phase ids, and evidence refs:
46
46
 
47
47
  ```text
48
- knowledge/codegraph/module-a/...
49
- knowledge/codegraph/module-b/...
48
+ knowledge/codeindex/module-a/...
49
+ knowledge/codeindex/module-b/...
50
50
  ```
51
51
 
52
52
  For prose Views, provide a stable filename `slug` and omit `path`; the CLI
@@ -57,7 +57,7 @@ it is not a required source/module wrapper.
57
57
 
58
58
  The registry stores this as one date entry containing several `modules` entries,
59
59
  and materializes each module at `sources/repo/<date>/<module>`.
60
- Repo module names are project-wide codegraph identities and therefore cannot be
60
+ Repo module names are project-wide codeindex identities and therefore cannot be
61
61
  reused under another date batch. Refresh an existing module through its original
62
62
  date/module selector.
63
63
  When a repo module and the Context workspace share the same Git root, the CLI
@@ -402,7 +402,7 @@ alignProse({
402
402
  ```
403
403
 
404
404
  `collection` is an internal knowledge classification, not a package directory.
405
- Package build maps `codegraph`/`business`/`product` to `wikis/`,
405
+ Package build maps `codeindex`/`business`/`product` to `wikis/`,
406
406
  `architecture`/`sop`/`faq`/`decision`/`incident` to `guides/`,
407
407
  `standards`/`test` to `rules/`, and `feats` to `feats/`. The complete output
408
408
  contract is documented in [Package Outputs](../guides/package-outputs.md).
@@ -587,12 +587,12 @@ does not infer relationships or inject relation markers into verbatim body.
587
587
 
588
588
  ### `extractTs`
589
589
 
590
- Extract exported TypeScript / TSX symbols into draft candidates:
590
+ Extract exported TypeScript / JavaScript / TSX / JSX symbols into draft candidates:
591
591
 
592
592
  ```ts
593
593
  extractTs({
594
594
  source: componentLib,
595
- collection: "codegraph",
595
+ collection: "codeindex",
596
596
  });
597
597
  ```
598
598
 
@@ -601,8 +601,8 @@ Options:
601
601
  | Field | Meaning |
602
602
  |---|---|
603
603
  | `source` | `source("date", "module")` for one repo module |
604
- | `collection` | Code extraction uses `"codegraph"` |
605
- | `include` | Optional glob list inside the selected source; default is `["src/**/*.{ts,tsx}"]` |
604
+ | `collection` | Code extraction uses `"codeindex"` |
605
+ | `include` | Optional glob list inside the selected source; default is `["src/**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}"]` |
606
606
  | `mode` | `"exports"` (default) traces public exports from automatic or configured entries; `"scan"` uses every file matched by `include` as an entry root |
607
607
  | `entries` | Optional source-relative entry files for `"exports"` mode. They override `package.json` entry detection and live only in the Context project configuration |
608
608
  | `exportedOnly` | Defaults to `true` in `"exports"` mode and `false` in `"scan"` mode |
@@ -614,7 +614,7 @@ An explicit index unit records production intent rather than parser settings:
614
614
  ```ts
615
615
  extractTs({
616
616
  source: componentLib,
617
- collection: "codegraph",
617
+ collection: "codeindex",
618
618
  indexUnits: [{
619
619
  id: "component-public-api",
620
620
  inputSources: ["20260712/component-lib"],
@@ -623,6 +623,7 @@ extractTs({
623
623
  moduleTypes: ["sdk-library"],
624
624
  facets: ["public-api", "plugin-extension"],
625
625
  moduleTypeEvidence: ["package.json exports and src/index.ts public entry"],
626
+ documents: ["README.md", "docs/public-api.md"],
626
627
  outputProfile: "public-api-reference",
627
628
  responsibility: "Document stable exported component contracts.",
628
629
  entries: ["src/index.ts"],
@@ -649,6 +650,9 @@ behaviors such as routing, protocol consumption, events, persistence, plugins,
649
650
  release, or cross-module chains. `moduleTypeEvidence` records the inspected
650
651
  paths that support the classification. Classify first, then read the matching
651
652
  Route-provided code-index templates, and only then finish the extraction plan.
653
+ `documents` contains exact source-relative Markdown paths read for that plan;
654
+ Context compares it with discovered module documents instead of treating a
655
+ source-code comment as documentation coverage.
652
656
  `lifecycle` is `"authoritative"`, `"generated"`, `"mirrored"`, `"legacy"`,
653
657
  or `"vendored"`; derived sources normally use `"provenance-only"` rather
654
658
  than duplicating reader-facing pages. These are generic project facts, not
@@ -674,7 +678,7 @@ editing the source repository:
674
678
  ```ts
675
679
  extractTs({
676
680
  source: componentLib,
677
- collection: "codegraph",
681
+ collection: "codeindex",
678
682
  include: ["src/**/*.ts"],
679
683
  entries: ["src/api.ts"],
680
684
  });
@@ -734,7 +738,7 @@ remain report signals and do not create another Gate.
734
738
  Phase id shape:
735
739
 
736
740
  ```text
737
- extract:<source-name-or-repo>:codegraph
741
+ extract:<source-name-or-repo>:codeindex
738
742
  ```
739
743
 
740
744
  Codegraph extraction has two execution policies:
@@ -745,7 +749,7 @@ Codegraph extraction has two execution policies:
745
749
  the Agent re-evaluates `context status --format json`; only
746
750
  `workflow.current` decides whether Review is now required.
747
751
  - `context run <phase-id> --auto-promote` is the explicit CI/CD path. It is valid
748
- only for `phase.extract.ts` codegraph phases, applies deterministic code deltas
752
+ only for `phase.extract.ts` codeindex phases, applies deterministic code deltas
749
753
  without Review, refreshes deterministic close when approved knowledge changed,
750
754
  then runs project verification. Close or verification errors make the command
751
755
  fail; JSON output reports applied/materialized/removed counts plus a `close`
@@ -757,7 +761,7 @@ other semantic knowledge. Agents must not infer a human gate from a phase-local
757
761
  result. Human gates and their inspection/resolution Actions are exposed only by
758
762
  `workflow.current`.
759
763
 
760
- Approved codegraph sections use the local evidence form
764
+ Approved codeindex sections use the local evidence form
761
765
  `src-N#symbol:<file>:<symbol>:<kind>@<digest>`. The file segment makes reverse
762
766
  lookup exact when multiple files contain the same symbol name, kind, and digest;
763
767
  the complete ref remains opaque to agents. New pages keep only top-level
@@ -773,7 +777,7 @@ aggregated repository protocol:
773
777
  extractCustom({
774
778
  id: "extract:service:protocol",
775
779
  sources: [service],
776
- collection: "codegraph",
780
+ collection: "codeindex",
777
781
  indexUnits: [{
778
782
  id: "service-protocol",
779
783
  inputSources: ["20260811/service"],
@@ -844,6 +848,12 @@ least one source-backed structured edge. `context status` therefore treats this
844
848
  pending code extraction target, and Review can verify snapshot freshness
845
849
  without a placeholder `extractTs` phase.
846
850
 
851
+ Each `sections[].markdown` value is Section body content only; do not copy the
852
+ template heading into it. Context renders `sections[].title` and rejects nested
853
+ reader headings at the SDK boundary so empty template chapters cannot leak into
854
+ knowledge. Evidence `symbol` and `kind` are canonical-ref tokens and cannot
855
+ contain `:` or `@`; exact qualified signatures remain reader-facing prose.
856
+
847
857
  `indexUnits` is also the batch scale and ownership contract. Candidate
848
858
  `module` must match one declared unit id or output owner. Older callbacks that
849
859
  omit `indexUnits` remain compatible: Context groups candidates by `module` and
@@ -873,6 +883,21 @@ output profile. Coverage is based on source-backed evidence paths, not Markdown
873
883
  page count, so one aggregate page can pass while an entry-only static module
874
884
  card cannot.
875
885
 
886
+ For a single-source index unit, Context also scans every represented language
887
+ family and Markdown/MDX file after the unit's declared exclusions. The adapter's
888
+ `eligibleFileTargets` and `eligibleLoc` must cover that independent baseline.
889
+ Configuration files may be evidence, but a hand-picked evidence list cannot be
890
+ reused as the source or LOC denominator. Cross-module-flow units remain scored
891
+ against their declared entry, protocol, operation, and handoff boundaries rather
892
+ than treating several repositories as one source-code page.
893
+
894
+ The same baseline discovers conventional sibling page entries, route-register
895
+ calls in Go router files, and exported receiver operations when a Go handler is
896
+ the declared service source of truth. Every discovered identity must appear in
897
+ the target-symbol and boundary denominators. An aggregate page may summarize
898
+ these identities, but an adapter cannot list one representative sibling and
899
+ silently omit the rest.
900
+
876
901
  The extractor returns knowledge semantics (`nodeRef`, rendered Markdown,
877
902
  Review summary and source-backed evidence). It must not write `knowledge/`,
878
903
  `.tmp/context-runtime/lifecycle/candidates.jsonl`, extraction fingerprints or
@@ -893,9 +918,9 @@ import { indexGoRepository } from "@c4a/extract-go";
893
918
  import { extractCustom } from "@c4a/context";
894
919
 
895
920
  extractCustom({
896
- id: "extract:service:codegraph",
921
+ id: "extract:service:codeindex",
897
922
  sources: [service],
898
- collection: "codegraph",
923
+ collection: "codeindex",
899
924
  extract: async ({ projectRoot }) => {
900
925
  const facts = await indexGoRepository(resolveServiceCheckout(projectRoot));
901
926
  return { candidates: buildServiceCandidates(facts) };
@@ -921,7 +946,7 @@ and its evidence coverage auditable before candidate writes.
921
946
  Declare the review step for a collection:
922
947
 
923
948
  ```ts
924
- reviewValidity({ collection: "codegraph" });
949
+ reviewValidity({ collection: "codeindex" });
925
950
  ```
926
951
 
927
952
  Declare one review gate for all current draft collections:
@@ -933,7 +958,7 @@ reviewValidity({ scope: "all" });
933
958
  Phase id:
934
959
 
935
960
  ```text
936
- review:codegraph:validity
961
+ review:codeindex:validity
937
962
  review:all:validity
938
963
  ```
939
964
 
@@ -959,7 +984,7 @@ continue wording does not invoke it.
959
984
 
960
985
  The gate is batch-scoped: prose waits for every planned View across all active
961
986
  structure slots and every declared `pendingStructureTargets` item in the round;
962
- codegraph waits for every pending extract phase in the confirmed module round.
987
+ codeindex waits for every pending extract phase in the confirmed module round.
963
988
  Candidate count/hash therefore describes the complete current batch rather than
964
989
  one page, source slot, or module. Deterministic close later merges all active
965
990
  slots into `knowledge/structure.yaml`, retains only their source, collection,
@@ -989,13 +1014,13 @@ const sample = source("20260712", "sample");
989
1014
 
990
1015
  customPhase("custom:20260712/sample:review", async (ctx) => {
991
1016
  await ctx.ensureSources({ source: sample });
992
- await ctx.extract.ts(extractTs({ source: sample, collection: "codegraph" }));
993
- await ctx.review.html(reviewValidity({ collection: "codegraph" }));
1017
+ await ctx.extract.ts(extractTs({ source: sample, collection: "codeindex" }));
1018
+ await ctx.review.html(reviewValidity({ collection: "codeindex" }));
994
1019
  });
995
1020
  ```
996
1021
 
997
1022
  Custom phases are an orchestration escape hatch. Use `extractCustom()` instead
998
- when project code needs to publish codegraph candidates. The supported runtime
1023
+ when project code needs to publish codeindex candidates. The supported runtime
999
1024
  helpers are:
1000
1025
 
1001
1026
  - `ctx.ensureSources(...)` for repo source readiness.
package/index.d.ts CHANGED
@@ -1,12 +1,58 @@
1
1
  import type { PackageNavigationDefinition, PackageSelectDefinition } from "./contracts.js";
2
2
  import type { PhaseDefinition, PhaseResourceReference } from "./phases.js";
3
3
  import type { ProjectSourceDefinition } from "./sources.js";
4
- export type { CodegraphCollection, DocumentMainlineCollection, EntityStatus, KnowledgeCollection, MainlineCollection, MarkdownTransform, FileCaptureProcessorDefinition, OkfRoot, PackageKind, PackageNavigationDefinition, PackageSelectDefinition, TopLevelNamespace, } from "./contracts.js";
4
+ export * from "./indexerCoreExports.js";
5
+ export { indexerComposerContractSchema, indexerComposerDeclarationSchema, indexerExecutionSchema, indexerProviderLayerFragmentSchema, indexerProviderManifestSchema, indexerProviderOperationSchema, indexerToolSourceDeclarationSchema, isIndexerLayerFragmentKind, isIndexerProviderProtocol, loadIndexerProviderManifest, parseIndexerProviderManifest, } from "./indexerProvider.js";
6
+ export type { IndexerComposerContract, IndexerComposerDeclaration, IndexerExecution, IndexerProviderLayerFragment, IndexerProviderManifest, IndexerProviderOperation, IndexerToolSourceDeclaration, } from "./indexerProvider.js";
7
+ export { canonicalOwnerCellRef, indexRequirementSchema, indexRequirementSetSchema, indexerRegistryDigests, indexerDistributionSchema, indexerRegistryEntrySchema, indexerRegistrySchema, loadIndexerRegistry, parseIndexerRegistry, requirementSetFromRegistry, validateFinalizedIndexerRegistry, } from "./indexerRegistry.js";
8
+ export type { IndexRequirement, IndexRequirementSet, IndexerJson, IndexerDistribution, IndexerRegistry, IndexerRegistryEntry, IndexerScopeTarget, LoadedIndexerRegistry, } from "./indexerRegistry.js";
9
+ export { compareIndexRequirementContraction } from "./indexerRequirementComparison.js";
10
+ export type { RequirementComparisonChange, RequirementContractionComparatorOptions, RequirementContractionComparison, RequirementContractionRelation, ResolvedQuestionContractView, } from "./indexerRequirementComparison.js";
11
+ export * from "./indexerRequirementConfirmation.js";
12
+ export * from "./indexerRequirementLifecycle.js";
13
+ export { deriveIndexerProgramExecutionPolicy, indexerCliReleaseManifestSchema, indexerHostExecutionCapabilitiesSchema, indexerProviderBundleIntegrity, indexerProgramAuthorizationSchema, indexerProgramIdentityDigest, resolvedProviderBundleSchema, resolvedProviderReceiptDigest, resolvedProviderStableFingerprint, validateIndexerProgramAuthorization, validateResolvedProviderBundle, } from "./indexerProviderResolution.js";
14
+ export * from "./indexerProviderResolutionAction.js";
15
+ export type { ExpectedProviderResolution, IndexerCliReleaseManifest, IndexerHostExecutionCapabilities, IndexerProgramAuthorization, IndexerProgramExecutionLevel, IndexerProgramExecutionPolicy, ProviderResolutionRequest, ResolvedProviderBundle, } from "./indexerProviderResolution.js";
16
+ export * from "./indexerProviderComposition.js";
17
+ export * from "./indexerProviderSelectionProposal.js";
18
+ export * from "./indexerCustomizationLadder.js";
19
+ export { indexerMetricContractSchema, indexerArtifactPolicyVariantSchema, indexerInventoryDomainSchema, indexerOperatorContractDigest, indexerOperatorContractSchema, indexerProfileContractDigest, indexerProfileContractEntrySchema, indexerProfileContractSchema, indexerProfileSubjectKeySchema, indexerQuestionTargetDomainSchema, indexerReaderQuestionContractSchema, indexerSubjectKeyContractSchema, inflationSensitiveHardMaximum, validateIndexerOperatorContract, validateIndexerProfileContract, } from "./indexerProfileContract.js";
20
+ export type { IndexerMetricContract, IndexerOperatorContract, IndexerProfileContract, IndexerProfileContractEntry, IndexerProfileSubjectKey, IndexerReaderQuestionContract, IndexerSubjectKeyContract, } from "./indexerProfileContract.js";
21
+ export { authorizeProjectIndexerOverlay, indexerContractOverlayDigest, indexerContractOverlaySchema, indexerOverlayAttestationDigest, indexerOverlayAttestationSchema, indexerOverlayAttestationSigningPayload, indexerOverlayProjectAuthorizationDigest, indexerOverlayProjectAuthorizationSchema, indexerOverlayTrustBundleDigest, indexerOverlayTrustBundleEnvelopeSchema, indexerOverlayTrustBundleSchema, indexerOverlayTrustReceiptDigest, indexerOverlayTrustReceiptSchema, validateIndexerContractOverlay, validateIndexerOverlayAttestation, validateIndexerOverlayTrustBundleEnvelope, verifyEnterpriseIndexerOverlayTrust, } from "./indexerOverlayTrust.js";
22
+ export type { IndexerContractOverlay, IndexerOverlayAttestation, IndexerOverlayConformanceReport, IndexerOverlayProjectAuthorization, IndexerOverlayTrustBundle, IndexerOverlayTrustBundleEnvelope, IndexerOverlayTrustReceipt, } from "./indexerOverlayTrust.js";
23
+ export * from "./indexerOverlayQuestionAmendment.js";
24
+ export * from "./indexerOverlayQuestionApplyProposal.js";
25
+ export * from "./indexerBaseQuestionAmendment.js";
26
+ export { composeIndexerLayerInput, DEFAULT_INDEXER_LAYER_FRAGMENT_LIMITS, indexerCanonicalRefSchema, indexerComposerRefSchema, indexerEvidenceRefSchema, indexerLayerCompositionInputDigest, indexerLayerCompositionInputSchema, indexerLayerFragmentDigest, indexerLayerFragmentPayloadSchema, indexerLayerFragmentSchema, indexerMaterializedLayerFragmentSchema, indexerProviderLayerRefSchema, validateAndMaterializeIndexerLayerFragment, validateIndexerLayerCompositionInput, validateIndexerMaterializedLayerFragment, } from "./indexerLayerComposition.js";
27
+ export type { IndexerEvidenceRef, IndexerLayerCompositionInput, IndexerLayerFragment, IndexerLayerFragmentLimits, IndexerLayerFragmentPayload, IndexerMaterializedLayerFragment, } from "./indexerLayerComposition.js";
28
+ export { canonicalIndexerNodeRef, indexerSubjectKeySchema, } from "./indexerSubjectIdentity.js";
29
+ export type { IndexerSubjectKey } from "./indexerSubjectIdentity.js";
30
+ export * from "./indexerSubjectKeyAuthority.js";
31
+ export { buildIndexerPostAuthorFragmentRequest, composeIndexerPostAuthorEnvelope, indexerComposedResultEnvelopeSchema, indexerComposerInvocationReceiptSchema, indexerEffectiveComposerSchema, indexerEffectiveComposerSetSchema, indexerLayerFragmentRunResultSchema, indexerPostAuthorFragmentRequestSchema, indexerPostAuthorWorksetDigest, indexerPostAuthorWorksetSchema, indexerPostAuthorWorksetSetDigest, indexerPostAuthorWorksetSetSchema, indexerPrimaryResultViewDigest, indexerPrimaryResultViewSchema, materializeIndexerPrimaryResultView, planIndexerPostAuthorComposition, resolveEffectiveIndexerComposers, validateIndexerPostAuthorFragmentResult, validateIndexerPostAuthorFragmentRequest, validateIndexerEffectiveComposerSet, validateIndexerPrimaryResultView, } from "./indexerPostAuthorComposition.js";
32
+ export type { IndexerComposedResultEnvelope, IndexerComposerInvocationReceipt, IndexerEffectiveComposer, IndexerEffectiveComposerSet, IndexerLayerFragmentRunResult, IndexerPostAuthorFragmentRequest, IndexerPostAuthorPlan, IndexerPostAuthorWorkset, IndexerPostAuthorWorksetSet, IndexerPrimaryArtifactView, IndexerPrimaryFactView, IndexerPrimaryResultView, } from "./indexerPostAuthorComposition.js";
33
+ export { buildIndexerMainWorkset, buildIndexerMainWorksetSet, buildIndexerMainTransportBatch, buildIndexerTargetResolutionView, indexerMainWorksetDigest, indexerMainWorksetSchema, indexerMainWorksetSetDigest, indexerMainWorksetSetSchema, indexerMainTransportBatchSchema, indexerOwnerCohortRef, indexerTargetResolutionViewDigest, indexerTargetResolutionViewSchema, validateIndexerMainWorkset, validateIndexerMainWorksetSet, validateIndexerTargetResolutionView, } from "./indexerMainWorkset.js";
34
+ export type { IndexerMainAuthorWorkset, IndexerMainPartitionWorkset, IndexerMainWorkset, IndexerMainWorksetSet, IndexerMainTransportBatch, IndexerTargetResolutionView, } from "./indexerMainWorkset.js";
35
+ export { indexerPartitionGroupProjectionDigest, indexerPartitionPlanBindingDigest, indexerPartitionPlanCanonicalHash, indexerPartitionPlanSchema, indexerPartitionStrategySchema, indexerPartitionStrategySetDigest, validateIndexerPartitionPlan, } from "./indexerPartitionPlan.js";
36
+ export type { IndexerMemberDisposition, IndexerPartitionGroup, IndexerPartitionPlan, IndexerPartitionStrategy, } from "./indexerPartitionPlan.js";
37
+ export * from "./indexerPartitionConvergence.js";
38
+ export * from "./indexerArtifactDependencies.js";
39
+ export * from "./indexerDependencyView.js";
40
+ export * from "./indexerRunEnvelope.js";
41
+ export * from "./indexerSharedArtifactFingerprint.js";
42
+ export * from "./indexerIncrementalImpact.js";
43
+ export * from "./indexerMainRunProtocol.js";
44
+ export * from "./indexerMainLifecycle.js";
45
+ export * from "./indexerSubjectCatalog.js";
46
+ export * from "./indexerMaterialAnswerRunProtocol.js";
47
+ export * from "./indexerProgramRunProtocol.js";
48
+ export * from "./indexerAgentStepProtocol.js";
49
+ export * from "./indexerLifecycle.js";
50
+ export type { CodegraphCollection, CodeIndexCollection, DocumentMainlineCollection, EntityStatus, KnowledgeCollection, MainlineCollection, MarkdownTransform, FileCaptureProcessorDefinition, OkfRoot, PackageKind, PackageNavigationDefinition, PackageSelectDefinition, TopLevelNamespace, } from "./contracts.js";
5
51
  export { assertDocumentMainlineCollection, assertKnowledgeCollection, assertMainlineCollection, assertOkfRoot, assertTopLevelNamespace, DOC_MAINLINE_COLLECTIONS, DEFAULT_PACKAGE_NAVIGATION, KNOWLEDGE_COLLECTIONS, MAINLINE_COLLECTIONS, OKF_ROOTS, TOP_LEVEL_NAMESPACES, } from "./contracts.js";
6
52
  export { assertDocumentEvidenceSectionMetadata, DOCUMENT_COMPILE_ACTION_SCHEMA_VERSION, DOCUMENT_EVIDENCE_SECTION_VALIDATION_STAGES, DOCUMENT_SECTION_CONTENT_MODES, DOCUMENT_STRUCTURE_SCHEMA_VERSION, } from "./documentEvidence.js";
7
53
  export type { DocumentEvidenceSectionMetadata, DocumentEvidenceSectionValidationOptions, DocumentEvidenceSectionValidationStage, DocumentSectionContentMode, } from "./documentEvidence.js";
8
54
  export { alignProse, captureFile, captureLark, compileProse, CODE_INDEX_CAPABILITIES, CODE_INDEX_COVERAGE_KINDS, CODE_INDEX_LIFECYCLES, CODE_INDEX_MODULE_FACETS, CODE_INDEX_MODULE_TYPES, CODE_INDEX_OUTPUT_PROFILES, customPhase, extractCustom, extractTs, ExtractTsConfigurationError, NO_ENTRY_DETECTED, requiredCodeIndexCoverage, mdxJsonDocs, reviewValidity, } from "./phases.js";
9
- export type { AlignProsePhaseDefinition, CaptureFilePhaseDefinition, CaptureLarkPhaseDefinition, CompileProsePhaseDefinition, ContextPhase, ContextPhaseContext, CustomPhaseDefinition, CustomCodeCandidateDraft, CustomCodeCandidateEdge, CustomCodeCandidateSection, CustomCodeCandidateReview, CustomCodeEvidence, CustomCodeExtractionContext, CustomCodeExtractionResult, CustomCodeExtractor, CodeIndexCapability, CodeIndexCapabilityGap, CodeIndexCoverageKind, CodeIndexInspectionAdapter, CodeIndexInspectionContext, CodeIndexInspectionFinding, CodeIndexInspectionFindingKind, CodeIndexInspectionResult, CodeIndexLifecycle, CodeIndexModuleFacet, CodeIndexModuleType, CodeIndexOutputProfile, CodeIndexUnitPlan, ExtractCustomPhaseDefinition, ExtractTsPhaseDefinition, PhaseDefinition, PhaseResourceReference, ReviewValidityPhaseDefinition, ReviewValidityScope, } from "./phases.js";
55
+ export type { AlignProsePhaseDefinition, CaptureFilePhaseDefinition, CaptureLarkPhaseDefinition, CompileProsePhaseDefinition, ContextPhase, ContextPhaseContext, CustomPhaseDefinition, CustomCodeCandidateDraft, CustomCodeCandidateEdge, CustomCodeCandidateSection, CustomCodeCandidateReview, CustomCodeEvidence, CustomCodeExtractionContext, CustomCodeExtractionResult, CustomCodeExtractor, CodeIndexCapability, CodeIndexCapabilityGap, CodeIndexCoverageKind, CodeIndexInspectionAdapter, CodeIndexInspectionContext, CodeIndexInspectionFinding, CodeIndexInspectionFindingKind, CodeIndexInspectionInventory, CodeIndexInspectionResult, CodeIndexIdentityGroup, CodeIndexChainCandidate, CodeIndexChainCandidateDecision, CodeIndexChainCandidateFamily, CodeIndexLifecycle, CodeIndexModuleFacet, CodeIndexModuleType, CodeIndexOutputProfile, CodeIndexUnitPlan, ExtractCustomPhaseDefinition, ExtractTsPhaseDefinition, PhaseDefinition, PhaseResourceReference, ReviewValidityPhaseDefinition, ReviewValidityScope, } from "./phases.js";
10
56
  export { allSources, DEFAULT_FILE_SOURCES_REGISTRY_PATH, DEFAULT_LARK_SOURCES_REGISTRY_PATH, DEFAULT_REPO_SOURCES_REGISTRY_PATH, loadSourcesRegistry, resolveSourceReference, source, } from "./sources.js";
11
57
  export type { DocumentSourceDefinition, DocumentSourceReference, DocumentSourceType, FileSourceDefinition, FileSourceReference, FileSourceRegistryEntry, LarkSourceDefinition, LarkSourceReference, LarkSourceRegistryEntry, LoadSourcesRegistryOptions, ProjectSourceDefinition, RepoProjectSourceDefinition, RepoSourceDefinition, RepoSourceReference, RepoSourceRegistryEntry, RepoSourcesRegistry, SourceCollectionReference, SourceDefinition, SourceReference, SourcesRegistry, SourceType, } from "./sources.js";
12
58
  export type TemplateVarValue = string | number | boolean | null | Record<string, unknown> | readonly Record<string, unknown>[];