@ttsc/evidence 0.25.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 (74) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +279 -0
  3. package/lib/index.d.ts +65 -0
  4. package/lib/index.js +87 -0
  5. package/lib/internal/loadPrismaModels.d.ts +1 -0
  6. package/lib/internal/loadPrismaModels.js +197 -0
  7. package/lib/internal/loadSwaggerOperations.d.ts +1 -0
  8. package/lib/internal/loadSwaggerOperations.js +156 -0
  9. package/lib/internal/normalizeSwaggerDocument.d.ts +1 -0
  10. package/lib/internal/normalizeSwaggerDocument.js +7 -0
  11. package/lib/structures/ITtscEvidenceDocumentedConfig.d.ts +32 -0
  12. package/lib/structures/ITtscEvidenceDocumentedConfig.js +2 -0
  13. package/lib/structures/ITtscEvidenceGraphClaim.d.ts +14 -0
  14. package/lib/structures/ITtscEvidenceGraphClaim.js +2 -0
  15. package/lib/structures/ITtscEvidenceGraphClaimBase.d.ts +102 -0
  16. package/lib/structures/ITtscEvidenceGraphClaimBase.js +2 -0
  17. package/lib/structures/ITtscEvidenceGraphConfig.d.ts +19 -0
  18. package/lib/structures/ITtscEvidenceGraphConfig.js +2 -0
  19. package/lib/structures/ITtscEvidenceGraphMarkdownClaim.d.ts +40 -0
  20. package/lib/structures/ITtscEvidenceGraphMarkdownClaim.js +2 -0
  21. package/lib/structures/ITtscEvidenceGraphMarkdownReference.d.ts +76 -0
  22. package/lib/structures/ITtscEvidenceGraphMarkdownReference.js +2 -0
  23. package/lib/structures/ITtscEvidenceGraphPrismaClaim.d.ts +65 -0
  24. package/lib/structures/ITtscEvidenceGraphPrismaClaim.js +2 -0
  25. package/lib/structures/ITtscEvidenceGraphPrismaReference.d.ts +75 -0
  26. package/lib/structures/ITtscEvidenceGraphPrismaReference.js +2 -0
  27. package/lib/structures/ITtscEvidenceGraphReference.d.ts +14 -0
  28. package/lib/structures/ITtscEvidenceGraphReference.js +2 -0
  29. package/lib/structures/ITtscEvidenceGraphReferenceBase.d.ts +73 -0
  30. package/lib/structures/ITtscEvidenceGraphReferenceBase.js +2 -0
  31. package/lib/structures/ITtscEvidenceGraphSwaggerReference.d.ts +39 -0
  32. package/lib/structures/ITtscEvidenceGraphSwaggerReference.js +2 -0
  33. package/lib/structures/ITtscEvidenceGraphTypeScriptClaim.d.ts +54 -0
  34. package/lib/structures/ITtscEvidenceGraphTypeScriptClaim.js +2 -0
  35. package/lib/structures/ITtscEvidenceGraphTypeScriptReference.d.ts +83 -0
  36. package/lib/structures/ITtscEvidenceGraphTypeScriptReference.js +2 -0
  37. package/lib/structures/index.d.ts +13 -0
  38. package/lib/structures/index.js +29 -0
  39. package/lib/typings/ITtscLintContributorRules.d.ts +34 -0
  40. package/lib/typings/ITtscLintContributorRules.js +2 -0
  41. package/lib/typings/ITtscLintRuleOptionsMap.d.ts +20 -0
  42. package/lib/typings/ITtscLintRuleOptionsMap.js +2 -0
  43. package/lib/typings/TtscEvidenceGraphMarkdownSymbol.d.ts +32 -0
  44. package/lib/typings/TtscEvidenceGraphMarkdownSymbol.js +2 -0
  45. package/lib/typings/TtscEvidenceGraphPrismaSymbol.d.ts +38 -0
  46. package/lib/typings/TtscEvidenceGraphPrismaSymbol.js +2 -0
  47. package/lib/typings/TtscEvidenceGraphTypeScriptSymbol.d.ts +64 -0
  48. package/lib/typings/TtscEvidenceGraphTypeScriptSymbol.js +2 -0
  49. package/lib/typings/index.d.ts +5 -0
  50. package/lib/typings/index.js +21 -0
  51. package/native/base.go +298 -0
  52. package/native/config.go +798 -0
  53. package/native/declaration.go +240 -0
  54. package/native/documented.go +353 -0
  55. package/native/exports.go +484 -0
  56. package/native/glob.go +207 -0
  57. package/native/graph.go +1409 -0
  58. package/native/health.go +45 -0
  59. package/native/hints.go +261 -0
  60. package/native/imports.go +373 -0
  61. package/native/inputs.go +125 -0
  62. package/native/loader.go +424 -0
  63. package/native/markdown.go +423 -0
  64. package/native/model.go +296 -0
  65. package/native/prisma.go +719 -0
  66. package/native/prisma_cache.go +213 -0
  67. package/native/prisma_locator.go +417 -0
  68. package/native/singular.go +369 -0
  69. package/native/swagger.go +331 -0
  70. package/native/swagger_cache.go +274 -0
  71. package/native/todo.go +138 -0
  72. package/native/typescript.go +1199 -0
  73. package/native/typescript_cache.go +96 -0
  74. package/package.json +64 -0
@@ -0,0 +1,73 @@
1
+ /**
2
+ * What every evidence population declares: which artifact kind it materializes,
3
+ * and how strictly the owning claim must acknowledge it.
4
+ *
5
+ * Ordinary coverage is deliberately permissive. Either tag can acknowledge a
6
+ * unit, one host may cite any number of units, and one acknowledgement per unit
7
+ * is enough. That is right for a documentary obligation and too weak for a
8
+ * proof obligation, where a single exclusion or a single host citing the whole
9
+ * population discharges it without proving anything.
10
+ *
11
+ * These properties tighten the acknowledgement relation of one reference, never
12
+ * of the graph. A strict operation obligation and an ordinary requirement
13
+ * obligation therefore sit in the same claim without either inheriting the
14
+ * other's intent, and two references over the same files stay independent.
15
+ *
16
+ * Every constraint is opt-in and its zero value is the historical behavior, so
17
+ * a reference that declares none of them is the reference that existed before
18
+ * they did.
19
+ */
20
+ export interface ITtscEvidenceGraphReferenceBase<Type extends string> {
21
+ /** Identifies the artifact kind this population materializes. */
22
+ type: Type;
23
+ /**
24
+ * Whether this reference refuses `@evidenceExclude` as an acknowledgement.
25
+ *
26
+ * A refused exclusion is reported where it is written and contributes no
27
+ * coverage here, so its target still owes positive `@evidence`. The same
28
+ * declaration may still acknowledge another reference that allows exclusions,
29
+ * because an exclusion decides one obligation rather than the target itself.
30
+ *
31
+ * Set it where non-applicability is not an answer the population accepts: a
32
+ * published API operation is exercised by its test suite or the suite is
33
+ * incomplete, and "not applicable" is the sentence that hides the second
34
+ * case.
35
+ *
36
+ * @default false
37
+ */
38
+ noEvidenceExclude?: boolean;
39
+ /**
40
+ * Whether at most one claim host may cite each unit of this population.
41
+ *
42
+ * Ordinary coverage lets any number of hosts cite one unit. That is correct
43
+ * for a requirement several modules honor, and wrong for evidence meant to
44
+ * have an owner: without this constraint one thorough host can cite a unit
45
+ * that every other host also names, and nothing records which of them is
46
+ * answerable for it.
47
+ *
48
+ * Distinct semantic hosts are counted, never declarations or tags. Merged
49
+ * declarations and overload sets remain one host, repeated tags on one host
50
+ * count once, and `@evidenceExclude` never contributes a host. A unit no host
51
+ * cites is reported as missing coverage instead.
52
+ *
53
+ * @default false
54
+ */
55
+ uniqueEvidence?: boolean;
56
+ /**
57
+ * Whether each selected claim host must cite exactly one unit of this
58
+ * population.
59
+ *
60
+ * The denominator is the claim's complete selected host population, so a host
61
+ * carrying no `@evidence` tag counts as zero and fails exactly as a host
62
+ * citing two units does. Repeated tags for one unit count once, while an
63
+ * aggregate target contributes every selected descendant in its scope: citing
64
+ * a parent of two selected units counts as two.
65
+ *
66
+ * Set it where one host answers for one thing. A test function that proves
67
+ * one operation stays reviewable; the same function citing eight operations
68
+ * proves only that eight names appear in its JSDoc.
69
+ *
70
+ * @default false
71
+ */
72
+ singleEvidencePerSymbol?: boolean;
73
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,39 @@
1
+ import type { ITtscEvidenceGraphReferenceBase } from "./ITtscEvidenceGraphReferenceBase";
2
+ /**
3
+ * A population of Swagger or OpenAPI operations that the owning claim must
4
+ * cite.
5
+ *
6
+ * Swagger references are evidence-only: an API operation can ground a
7
+ * TypeScript or Markdown claim, but a Swagger document cannot host `@evidence`
8
+ * declarations. Every operation under the normalized document's `paths` object
9
+ * becomes one independent evidence unit.
10
+ */
11
+ export interface ITtscEvidenceGraphSwaggerReference extends ITtscEvidenceGraphReferenceBase<"swagger"> {
12
+ /**
13
+ * Exact Swagger or OpenAPI document location.
14
+ *
15
+ * A location is either a local file path or an `http:`/`https:` URL. A local
16
+ * path is resolved against the active `ttsc` project root and may name a JSON
17
+ * or YAML document anywhere on the filesystem: inside the project
18
+ * (`api/openapi.yaml`), above it (`../contracts/swagger.json`), or absolute
19
+ * (`/srv/contracts/swagger.json`, `C:/contracts/swagger.json`). An OpenAPI
20
+ * document is routinely generated somewhere with no relationship to the
21
+ * project that consumes it, and the local form is the one an author can pin
22
+ * and diff. A drive-relative Windows path such as `C:openapi.json` is
23
+ * refused, because it resolves against whatever directory that drive
24
+ * currently sits on rather than against a stable base.
25
+ *
26
+ * URLs are fetched while the project rule runs, so an unavailable remote
27
+ * document fails the build instead of silently removing its operations from
28
+ * the evidence graph.
29
+ *
30
+ * This value is an exact location, not a glob and not a directory. The
31
+ * document is normalized through `@typia/utils` to `OpenApi.IDocument` before
32
+ * its operations are indexed. Use a claim's `reference` array when it owes
33
+ * separate coverage to more than one Swagger document.
34
+ *
35
+ * Operation targets use the whitespace-free `<METHOD>:<path>` form, such as
36
+ * `POST:/members` or `GET:/members/{id}`.
37
+ */
38
+ file: string;
39
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,54 @@
1
+ import type { TtscEvidenceGraphTypeScriptSymbol } from "../typings/TtscEvidenceGraphTypeScriptSymbol";
2
+ import type { ITtscEvidenceGraphClaimBase } from "./ITtscEvidenceGraphClaimBase";
3
+ /**
4
+ * A population of TypeScript declarations claiming its referenced evidence.
5
+ *
6
+ * JSDoc puts an evidence edge on the public declaration making the claim,
7
+ * rather than on the file around it. Supported hosts are exported interfaces,
8
+ * type aliases, namespaces, functions, data variables, type properties, and the
9
+ * public class callable forms documented by
10
+ * {@link TtscEvidenceGraphTypeScriptSymbol}.
11
+ *
12
+ * Both `@evidence <target> <reason>` and `@evidenceExclude <target> <reason>`
13
+ * require a target and a non-empty explanation. Ownership evidence must sit on
14
+ * a host selected by {@link symbol}. An exclusion may instead sit on any
15
+ * supported public export in the matching {@link files}, without changing the
16
+ * target scope this claim excludes.
17
+ */
18
+ export interface ITtscEvidenceGraphTypeScriptClaim extends ITtscEvidenceGraphClaimBase<"typescript"> {
19
+ /**
20
+ * Directory whose TypeScript population {@link files} select.
21
+ *
22
+ * A relative root resolves from the active `ttsc` project root, so a monorepo
23
+ * package can select an explicitly included sibling with `../api`.
24
+ *
25
+ * This property does not add files to the TypeScript Program and never scans
26
+ * the directory. Only source files already supplied by `ttsc` can match, so
27
+ * the owning `tsconfig` must include the rooted population explicitly.
28
+ */
29
+ root?: string;
30
+ /**
31
+ * Root-relative glob patterns for TypeScript files in the active `ttsc`
32
+ * Program that must cite the referenced evidence. A matching file outside the
33
+ * Program is not available to the rule and does not count as a match.
34
+ *
35
+ * For example, `src/**` selects the complete source subtree, while
36
+ * `scripts/check-?.ts` selects `check-a.ts` but not `check-ab.ts`.
37
+ */
38
+ files: string[];
39
+ /**
40
+ * TypeScript symbol kind or kinds eligible to host this claim's ownership
41
+ * evidence.
42
+ *
43
+ * Omit this property to select exported type, function, and property symbols.
44
+ * A single value selects one kind; a non-empty array selects the union of its
45
+ * kinds. A mixed variable statement containing callable and data declarations
46
+ * can host both function and property claims. `@evidenceExclude` may use any
47
+ * supported public export in a matching file as a central carrier regardless
48
+ * of this selector. A JSDoc block on an unsupported or unexported declaration
49
+ * does not satisfy either form.
50
+ *
51
+ * @default ["type", "function", "property"]
52
+ */
53
+ symbol?: TtscEvidenceGraphTypeScriptSymbol | TtscEvidenceGraphTypeScriptSymbol[];
54
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,83 @@
1
+ import type { TtscEvidenceGraphTypeScriptSymbol } from "../typings/TtscEvidenceGraphTypeScriptSymbol";
2
+ import type { ITtscEvidenceGraphReferenceBase } from "./ITtscEvidenceGraphReferenceBase";
3
+ /**
4
+ * A population of TypeScript evidence that the owning claim must cite.
5
+ *
6
+ * An exported symbol expresses a contract that a program can check
7
+ * mechanically. Treating selected symbols as graph nodes lets a claim point to
8
+ * a named type, callable, or property instead of citing a file as
9
+ * undifferentiated implementation.
10
+ *
11
+ * The selection keeps the evidence graph deliberate. It can cover public types
12
+ * by default, then opt into functions or properties only where their individual
13
+ * contracts deserve documentary proof.
14
+ */
15
+ export interface ITtscEvidenceGraphTypeScriptReference extends ITtscEvidenceGraphReferenceBase<"typescript"> {
16
+ /**
17
+ * Installed package whose declarations form this population.
18
+ *
19
+ * Omit it to select the active project. When present, {@link files} resolves
20
+ * against the package root instead of the project root, so the globs read as
21
+ * a consumer thinks of the package rather than carrying its `node_modules`
22
+ * location.
23
+ *
24
+ * A package population is read from disk rather than from the `ttsc` program.
25
+ * That is the point: a symbol nothing imports is absent from the program by
26
+ * definition, and it is exactly the symbol an obligation needs to name.
27
+ *
28
+ * Without {@link files}, the package's own declaration entry is the
29
+ * population, and every symbol reachable from it is a candidate unit
30
+ * addressed by its accessor path from that entry — which is what makes
31
+ * `api.functional.questions.get` nameable. The entry is read from the `types`
32
+ * condition of the `exports` map, then `typesVersions`, then the `types` or
33
+ * `typings` field — never `main`, which names the JavaScript a consumer runs
34
+ * rather than the declarations a citation can address.
35
+ */
36
+ package?: string;
37
+ /**
38
+ * Project-relative glob patterns for candidate TypeScript files in the active
39
+ * `ttsc` project. A matching file outside the project's `tsconfig` program is
40
+ * not available to the rule and does not count as a match.
41
+ *
42
+ * When {@link package} is set these are package-relative instead, and the
43
+ * files are read from disk rather than from the program.
44
+ *
45
+ * These are globs, not regular expressions. `*` matches within one path
46
+ * segment, `**` crosses any number of path segments, and `?` matches one
47
+ * character. Both `/` and `\` are accepted as separators, while path identity
48
+ * remains case-sensitive on every operating system.
49
+ *
50
+ * Patterns are evaluated from left to right. A pattern prefixed with `!`
51
+ * removes its matches; a later positive pattern can include them again. The
52
+ * array must contain at least one positive pattern.
53
+ *
54
+ * For example, `src/**` selects the complete source subtree, while
55
+ * `scripts/check-?.ts` selects `check-a.ts` but not `check-ab.ts`.
56
+ *
57
+ * A bare directory such as `src` or `src/` does not include its children;
58
+ * write `src/**` when the whole subtree belongs to this reference.
59
+ *
60
+ * Required for a local reference; there is no implicit project population.
61
+ * Only a {@link package} reference may omit it, and then the package's
62
+ * declaration entry defines the population instead.
63
+ */
64
+ files?: string[];
65
+ /**
66
+ * Symbol kind or kinds eligible to become evidence units.
67
+ *
68
+ * Omit this property to select exported interfaces, type aliases, and
69
+ * namespaces. A single value selects one obligation kind; a non-empty array
70
+ * selects the union. Selected units remain independent obligations until an
71
+ * ancestor type or namespace target acknowledges their shared scope.
72
+ * Ancestors of selected units are addressable even when their own kind is
73
+ * omitted from this selector.
74
+ *
75
+ * The exact declaration forms and qualified target identities are documented
76
+ * by {@link TtscEvidenceGraphTypeScriptSymbol}. This is unlike a claim's
77
+ * `symbol`, which selects declaration hosts: a reference's symbol array
78
+ * expands the evidence units one obligation covers.
79
+ *
80
+ * @default type
81
+ */
82
+ symbol?: TtscEvidenceGraphTypeScriptSymbol | TtscEvidenceGraphTypeScriptSymbol[];
83
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ export * from "./ITtscEvidenceDocumentedConfig";
2
+ export * from "./ITtscEvidenceGraphClaim";
3
+ export * from "./ITtscEvidenceGraphClaimBase";
4
+ export * from "./ITtscEvidenceGraphConfig";
5
+ export * from "./ITtscEvidenceGraphMarkdownClaim";
6
+ export * from "./ITtscEvidenceGraphMarkdownReference";
7
+ export * from "./ITtscEvidenceGraphPrismaClaim";
8
+ export * from "./ITtscEvidenceGraphPrismaReference";
9
+ export * from "./ITtscEvidenceGraphReference";
10
+ export * from "./ITtscEvidenceGraphReferenceBase";
11
+ export * from "./ITtscEvidenceGraphSwaggerReference";
12
+ export * from "./ITtscEvidenceGraphTypeScriptClaim";
13
+ export * from "./ITtscEvidenceGraphTypeScriptReference";
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./ITtscEvidenceDocumentedConfig"), exports);
18
+ __exportStar(require("./ITtscEvidenceGraphClaim"), exports);
19
+ __exportStar(require("./ITtscEvidenceGraphClaimBase"), exports);
20
+ __exportStar(require("./ITtscEvidenceGraphConfig"), exports);
21
+ __exportStar(require("./ITtscEvidenceGraphMarkdownClaim"), exports);
22
+ __exportStar(require("./ITtscEvidenceGraphMarkdownReference"), exports);
23
+ __exportStar(require("./ITtscEvidenceGraphPrismaClaim"), exports);
24
+ __exportStar(require("./ITtscEvidenceGraphPrismaReference"), exports);
25
+ __exportStar(require("./ITtscEvidenceGraphReference"), exports);
26
+ __exportStar(require("./ITtscEvidenceGraphReferenceBase"), exports);
27
+ __exportStar(require("./ITtscEvidenceGraphSwaggerReference"), exports);
28
+ __exportStar(require("./ITtscEvidenceGraphTypeScriptClaim"), exports);
29
+ __exportStar(require("./ITtscEvidenceGraphTypeScriptReference"), exports);
@@ -0,0 +1,34 @@
1
+ import type { TtscLintRuleSetting } from "@ttsc/lint";
2
+ declare module "@ttsc/lint" {
3
+ interface ITtscLintContributorRules {
4
+ /**
5
+ * Requires one public identity per TypeScript file, named after the file.
6
+ *
7
+ * The counted unit is an identity rather than an export, so declaration
8
+ * merging of a single name stays legal: `export interface ISomething`
9
+ * beside `export namespace ISomething`, `export class Something` beside
10
+ * `export namespace Something`, and `export const something` beside `export
11
+ * default something` are each one identity.
12
+ *
13
+ * A file that only re-exports owns no identity and is never reported, and
14
+ * an `index` file is exempt from the name match while still limited to one
15
+ * identity.
16
+ *
17
+ * The rule takes no options; per-directory scoping belongs in the outer
18
+ * `files` setting of `lint.config.ts`.
19
+ */
20
+ "evidence/singular"?: TtscLintRuleSetting;
21
+ /**
22
+ * Reports every JSDoc `@todo` tag in a checked file.
23
+ *
24
+ * A remaining `@todo` is a contract the declaration has not realized yet,
25
+ * so each tag fails the build with its own text until the declaration is
26
+ * realized and the tag removed. Every declaration's block is read, exported
27
+ * or not, on any symbol kind.
28
+ *
29
+ * The rule takes no options; per-directory scoping belongs in the outer
30
+ * `files` setting of `lint.config.ts`.
31
+ */
32
+ "evidence/todo"?: TtscLintRuleSetting;
33
+ }
34
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,20 @@
1
+ import type { ITtscEvidenceDocumentedConfig } from "../structures/ITtscEvidenceDocumentedConfig";
2
+ import type { ITtscEvidenceGraphConfig } from "../structures/ITtscEvidenceGraphConfig";
3
+ declare module "@ttsc/lint" {
4
+ interface ITtscLintRuleOptionsMap {
5
+ /**
6
+ * Declares this project's evidence graph.
7
+ *
8
+ * The claims define the citing populations and the independently complete
9
+ * evidence references each one must acknowledge.
10
+ */
11
+ "evidence/graph": ITtscEvidenceGraphConfig;
12
+ /**
13
+ * Requires a JSDoc block on every selected export.
14
+ *
15
+ * A JSDoc block is the only place an `@evidence` tag is read from, so an
16
+ * export without one cannot participate in the graph at all.
17
+ */
18
+ "evidence/documented": ITtscEvidenceDocumentedConfig;
19
+ }
20
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,32 @@
1
+ /**
2
+ * A Markdown node kind that can become an evidence unit or host an evidence
3
+ * declaration.
4
+ *
5
+ * `"file"` is the document root. `"h1"` through `"h4"` select ATX heading
6
+ * sections at that exact level; Setext headings and H5/H6 headings are outside
7
+ * this contract.
8
+ *
9
+ * These nodes form the Markdown outline: the file contains every heading, and a
10
+ * heading contains the lower-level headings before the next heading of equal or
11
+ * higher level. An `@evidence` target, or an `@evidenceExclude` target allowed
12
+ * by its reference policy, acknowledges its selected node and every selected
13
+ * descendant. A reference selector still defines which descendants are
14
+ * obligations; an unselected ancestor remains addressable as their aggregate
15
+ * scope.
16
+ *
17
+ * A file evidence target is its project-relative path with `/` separators. A
18
+ * declaration may spell those separators as `/` or `\`. A heading target
19
+ * appends its anchor, such as `docs/orders.md#create-order`. An explicit
20
+ * `{#anchor}` suffix wins. Its anchor must start with an ASCII letter or digit
21
+ * and may then contain ASCII letters, digits, `.`, `_`, `:`, and `-`.
22
+ *
23
+ * Without an explicit anchor, the heading becomes a lowercase slug: letters,
24
+ * numbers, and `_` remain; whitespace and `-` collapse to `-`; other
25
+ * punctuation is removed. Two selected headings that produce the same target
26
+ * are ambiguous and need distinct explicit anchors.
27
+ *
28
+ * Targets are one whitespace-delimited declaration token. A Markdown source
29
+ * path therefore cannot contain whitespace; the rule reports such a file with a
30
+ * rename diagnostic instead of creating an impossible obligation.
31
+ */
32
+ export type TtscEvidenceGraphMarkdownSymbol = "file" | "h1" | "h2" | "h3" | "h4";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,38 @@
1
+ /**
2
+ * A Prisma schema node kind that can become an evidence unit or a selected host
3
+ * for ownership evidence.
4
+ *
5
+ * `"model"` selects a declared model. `"column"` selects a stored field of one,
6
+ * and `"relation"` selects a relation field. The split follows Prisma's own
7
+ * resolution rather than the schema text: a relation has two sides, only one of
8
+ * which usually carries `@relation`, and the back-reference carries no
9
+ * attribute at all.
10
+ *
11
+ * A model contains its columns and relations, so an `@evidence` target or an
12
+ * `@evidenceExclude` target allowed by its reference policy acknowledges every
13
+ * selected member of it. A reference selector still defines which members are
14
+ * obligations; a model whose own kind is omitted from the selector remains
15
+ * addressable as their aggregate scope.
16
+ *
17
+ * Targets carry a `prisma:` prefix and are one whitespace-free token: a model
18
+ * is `prisma:Sale`, and a member is `prisma:Sale.price`. The prefix is what
19
+ * keeps a model named `Sale` from competing with a TypeScript type of the same
20
+ * name, and the dot is unambiguous because a Prisma identifier is unicode
21
+ * alphanumeric plus `_` and `-` and can never contain one.
22
+ *
23
+ * A model name is unique across the whole schema folder, so a target never
24
+ * names the file a model is declared in and moving a model between files of one
25
+ * schema cannot break a citation.
26
+ *
27
+ * A view is a `"model"` unit. That is Prisma's own shape rather than a choice
28
+ * made here — its parser returns a view among the datamodel's models, with the
29
+ * same fields and documentation a table has — so `prisma:SaleSummary` addresses
30
+ * a view exactly as it addresses a table.
31
+ *
32
+ * Enums, composite types, indexes, and datasource or generator settings are
33
+ * outside this contract. They materialize no unit and host no declaration. A
34
+ * claim may separately accept `@evidenceExclude` in an unattached top-level
35
+ * triple-slash run in a matching file; that carrier has no Prisma symbol and
36
+ * never hosts `@evidence`.
37
+ */
38
+ export type TtscEvidenceGraphPrismaSymbol = "model" | "column" | "relation";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,64 @@
1
+ /**
2
+ * A public TypeScript contract kind that can become an evidence unit or a
3
+ * selected host for ownership evidence.
4
+ *
5
+ * The selector is intentionally semantic rather than a list of AST node names:
6
+ * `"function"` includes the common ways a project exports callable behavior,
7
+ * and qualified identities keep nested contracts addressable without adding a
8
+ * file path to every target.
9
+ *
10
+ * - `"type"` selects exported interfaces, type aliases, and namespaces. Classes
11
+ * and enums do not become type units.
12
+ * - `"function"` selects exported function declarations, exported `const`
13
+ * variables initialized with an arrow function or function expression
14
+ * (including parentheses and type-only expression wrappers), public instance
15
+ * and static methods of exported classes, function-valued public class fields
16
+ * (an arrow/function initializer or direct function type), and the same
17
+ * callable forms exported from namespaces. Constructors and accessors are not
18
+ * selected.
19
+ * - `"property"` selects property signatures declared directly by exported
20
+ * interfaces and object-shaped type aliases, plus exported `const`, `let`,
21
+ * and `var` declarations at module or namespace scope. A `const` initialized
22
+ * with an arrow or function expression remains a function; every other
23
+ * variable, including a function-typed declaration or function-valued `let`
24
+ * or `var`, is a property. Every exported leaf in an object or array binding
25
+ * pattern is a property. Class fields and methods are not property units.
26
+ *
27
+ * TypeScript units form containment scopes. An interface or object-shaped type
28
+ * alias contains its selected properties. A namespace contains every selected
29
+ * public unit nested below it, including nested namespaces. An `@evidence`
30
+ * target, or an `@evidenceExclude` target allowed by its reference policy,
31
+ * acknowledges its selected node and every selected descendant. A reference
32
+ * selector defines the obligation kinds while their unselected type ancestors
33
+ * remain addressable as aggregate scopes.
34
+ *
35
+ * Top-level identities use the public export name, and namespace members
36
+ * prepend their namespace, such as `Orders.create`. A namespace itself uses its
37
+ * qualified name, such as `Orders` or `Outer.Inner`. A local declaration
38
+ * exposed as `export { Local as Public }` therefore uses `Public`. A named
39
+ * default declaration keeps its declaration name; anonymous and default-only
40
+ * aliases have no stable target and are not selected. Members of an ambient
41
+ * namespace are public without their own `export` modifier. A type-only
42
+ * namespace alias exposes the namespace, its public type-space descendants, and
43
+ * their type properties without exposing data, functions, or class callables.
44
+ * Type properties use `TypeName.property`. Static class callables use
45
+ * `ClassName.method`; instance callables use `ClassName.prototype.method`.
46
+ * Computed names are not selected, even when their expression is a literal.
47
+ * Literal names must be whitespace-free because a declaration target is one
48
+ * whitespace-delimited token. A dot inside a literal name is rendered
49
+ * unchanged; if that spelling collides with qualification, the target is
50
+ * ambiguous.
51
+ *
52
+ * These targets deliberately omit file paths. If selected files expose the same
53
+ * qualified target, a declaration using that target is ambiguous; rename or
54
+ * further qualify the public symbols. A re-export whose declaration lives in
55
+ * another file does not create a second unit in the barrel file. TypeScript
56
+ * target characters are matched exactly; Markdown path-separator normalization
57
+ * does not rewrite literal symbol names.
58
+ *
59
+ * Every supported public declaration described here may carry
60
+ * `@evidenceExclude` when its file belongs to a claim, even when that claim's
61
+ * selector omits its kind. The selector still controls `@evidence`; an
62
+ * unsupported or unexported declaration carries neither form.
63
+ */
64
+ export type TtscEvidenceGraphTypeScriptSymbol = "type" | "function" | "property";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import "./ITtscLintContributorRules";
2
+ import "./ITtscLintRuleOptionsMap";
3
+ export * from "./TtscEvidenceGraphMarkdownSymbol";
4
+ export * from "./TtscEvidenceGraphPrismaSymbol";
5
+ export * from "./TtscEvidenceGraphTypeScriptSymbol";
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ require("./ITtscLintContributorRules");
18
+ require("./ITtscLintRuleOptionsMap");
19
+ __exportStar(require("./TtscEvidenceGraphMarkdownSymbol"), exports);
20
+ __exportStar(require("./TtscEvidenceGraphPrismaSymbol"), exports);
21
+ __exportStar(require("./TtscEvidenceGraphTypeScriptSymbol"), exports);