@profile-as-code/core 0.1.1 → 0.1.3
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/achievements.d.ts +83 -0
- package/dist/achievements.d.ts.map +1 -0
- package/dist/achievements.js +207 -0
- package/dist/achievements.js.map +1 -0
- package/dist/cite.d.ts +91 -0
- package/dist/cite.d.ts.map +1 -0
- package/dist/cite.js +440 -0
- package/dist/cite.js.map +1 -0
- package/dist/completeness.d.ts +2 -2
- package/dist/completeness.d.ts.map +1 -1
- package/dist/completeness.js +22 -5
- package/dist/completeness.js.map +1 -1
- package/dist/generated/ai-policy.gen.d.ts +36 -0
- package/dist/generated/ai-policy.gen.d.ts.map +1 -0
- package/dist/generated/ai-policy.gen.js +31 -0
- package/dist/generated/ai-policy.gen.js.map +1 -0
- package/dist/generated/platforms.gen.d.ts +8 -0
- package/dist/generated/platforms.gen.d.ts.map +1 -1
- package/dist/generated/platforms.gen.js +68 -0
- package/dist/generated/platforms.gen.js.map +1 -1
- package/dist/generated/schema.zod.d.ts +57 -0
- package/dist/generated/schema.zod.d.ts.map +1 -1
- package/dist/generated/schema.zod.js +6 -1
- package/dist/generated/schema.zod.js.map +1 -1
- package/dist/geo.d.ts +39 -4
- package/dist/geo.d.ts.map +1 -1
- package/dist/geo.js +127 -43
- package/dist/geo.js.map +1 -1
- package/dist/index.d.ts +39 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -3
- package/dist/index.js.map +1 -1
- package/dist/load.d.ts.map +1 -1
- package/dist/load.js +17 -0
- package/dist/load.js.map +1 -1
- package/dist/normalize.d.ts +57 -0
- package/dist/normalize.d.ts.map +1 -0
- package/dist/normalize.js +133 -0
- package/dist/normalize.js.map +1 -0
- package/dist/presence.d.ts +113 -0
- package/dist/presence.d.ts.map +1 -0
- package/dist/presence.js +229 -0
- package/dist/presence.js.map +1 -0
- package/dist/registry.d.ts +6 -3
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +8 -4
- package/dist/registry.js.map +1 -1
- package/dist/structured-data.d.ts +4 -3
- package/dist/structured-data.d.ts.map +1 -1
- package/dist/structured-data.js +72 -7
- package/dist/structured-data.js.map +1 -1
- package/dist/types.d.ts +49 -10
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +16 -2
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
- package/dist/paste-source.d.ts +0 -14
- package/dist/paste-source.d.ts.map +0 -1
- package/dist/paste-source.js +0 -17
- package/dist/paste-source.js.map +0 -1
package/dist/types.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export type Profile = import("zod").z.infer<typeof profileSchema>;
|
|
|
17
17
|
/** Workspace flavor (D15, §17): person (default) or brand. */
|
|
18
18
|
export type Flavor = NonNullable<Profile["flavor"]>;
|
|
19
19
|
/** Normalized profile: array properties are always defined (empty when absent). */
|
|
20
|
-
export type LoadedProfile = Omit<Profile, "bios" | "headlines" | "skills" | "experience" | "projects" | "publications" | "checks" | "socialHandles" | "press" | "education" | "languages" | "deployments" | "credentials" | "artifacts"> & {
|
|
20
|
+
export type LoadedProfile = Omit<Profile, "bios" | "headlines" | "skills" | "experience" | "projects" | "publications" | "checks" | "socialHandles" | "press" | "education" | "languages" | "deployments" | "credentials" | "artifacts" | "faq" | "releases" | "achievements"> & {
|
|
21
21
|
flavor: Flavor;
|
|
22
22
|
bios: NonNullable<Profile["bios"]>;
|
|
23
23
|
headlines: NonNullable<Profile["headlines"]>;
|
|
@@ -33,6 +33,11 @@ export type LoadedProfile = Omit<Profile, "bios" | "headlines" | "skills" | "exp
|
|
|
33
33
|
deployments: NonNullable<Profile["deployments"]>;
|
|
34
34
|
credentials: NonNullable<Profile["credentials"]>;
|
|
35
35
|
artifacts: NonNullable<Profile["artifacts"]>;
|
|
36
|
+
faq: NonNullable<Profile["faq"]>;
|
|
37
|
+
/** v1.15 (D23): the release events; always defined on a loaded profile. */
|
|
38
|
+
releases: NonNullable<Profile["releases"]>;
|
|
39
|
+
/** v1.16 (D24, #446): the career impact log; always defined on a loaded profile. */
|
|
40
|
+
achievements: NonNullable<Profile["achievements"]>;
|
|
36
41
|
};
|
|
37
42
|
/**
|
|
38
43
|
* v1.6 (#103): the link ROLE — a TRANSLATION LAYER of this engine onto schema.org,
|
|
@@ -42,7 +47,8 @@ export type LoadedProfile = Omit<Profile, "bios" | "headlines" | "skills" | "exp
|
|
|
42
47
|
* aggregator → schema.org:mainEntityOfPage (medium: aggregates references)
|
|
43
48
|
* Absent = `realization` (additive: pre-v1.6 workspaces keep validating; output changes
|
|
44
49
|
* are declared in SPEC §15.4).
|
|
45
|
-
*
|
|
50
|
+
* Classification: SPEC §15.4 (link roles). Sources: W3C WebSchemas/sameAs,
|
|
51
|
+
* schema.org datamodel.
|
|
46
52
|
*/
|
|
47
53
|
export type LinkRole = "identity" | "realization" | "aggregator";
|
|
48
54
|
export type Identity = NonNullable<Profile["identity"]>;
|
|
@@ -83,8 +89,15 @@ export type GeneratedLangMap = {
|
|
|
83
89
|
* v1.1: role/degree/field can be a plain string (v1) or a bilingual langMap.
|
|
84
90
|
* Reading helper — consumers never null-check or narrow by hand.
|
|
85
91
|
* Proper nouns (org, institution, venue) are never langMap — pass them directly (SPEC §11).
|
|
92
|
+
*
|
|
93
|
+
* `lang` (issue #415): the language-aware form of the same rule `compile()`
|
|
94
|
+
* applies to text fields — the REQUESTED language, falling back to `en`, with
|
|
95
|
+
* an empty string counting as absent. It exists for consumers that print a
|
|
96
|
+
* FACT block (the `refine` task template) where compile passes the raw langMap
|
|
97
|
+
* through untouched; without a `lang` the behaviour is the pre-#415 one
|
|
98
|
+
* (`en` only), so no existing caller changes.
|
|
86
99
|
*/
|
|
87
|
-
export declare function textOf(v: string | GeneratedLangMap | undefined): string;
|
|
100
|
+
export declare function textOf(v: string | GeneratedLangMap | undefined, lang?: Lang): string;
|
|
88
101
|
/** The platform set — the generated `PLATFORM_SLUGS` (D3/D16, #154).
|
|
89
102
|
*
|
|
90
103
|
* `schema/profile.schema.json` (`$defs.platform.enum`) stays the single
|
|
@@ -116,6 +129,11 @@ export interface GeoCheck {
|
|
|
116
129
|
score: number;
|
|
117
130
|
/** 0..1 — share of the total score this check contributes. */
|
|
118
131
|
weight: number;
|
|
132
|
+
/** SPEC §8 (#399): a code that has nothing to measure in this workspace.
|
|
133
|
+
* `applicable: false` is excluded from the weighted mean (and from its section's
|
|
134
|
+
* score) instead of scoring a sentinel; absent = applicable. The declared
|
|
135
|
+
* `weight` stays visible so a reader can see what the code would carry. */
|
|
136
|
+
applicable?: boolean;
|
|
119
137
|
detail: string;
|
|
120
138
|
/** v1.10 (#289), additive: the reporting tier. Absent = `warn` (the pre-v1.10
|
|
121
139
|
* checks are all warnings). `info` NEVER changes the pass/fail story — a
|
|
@@ -127,8 +145,14 @@ export interface GeoSection {
|
|
|
127
145
|
label: string;
|
|
128
146
|
detail: string;
|
|
129
147
|
checks: GeoCheck[];
|
|
130
|
-
/** 0..100 for this section alone.
|
|
148
|
+
/** 0..100 for this section alone. When `applicable` is false this is a
|
|
149
|
+
* placeholder (0), not a measurement — no code in the section can contribute
|
|
150
|
+
* weight. Absent = applicable (all current sections). */
|
|
131
151
|
score: number;
|
|
152
|
+
/** §8/#399: present and false when no code in the section can contribute
|
|
153
|
+
* weight (every code N/A, or every applicable code declares weight 0). The
|
|
154
|
+
* section then has no mean and contributes nothing to the overall. */
|
|
155
|
+
applicable?: boolean;
|
|
132
156
|
}
|
|
133
157
|
export interface StructuredDataReadiness {
|
|
134
158
|
/** schema.org entity emitted: `Person` (default) or `Organization` (brand flavor, D15/§17). */
|
|
@@ -191,12 +215,13 @@ export interface StructuredDataReadiness {
|
|
|
191
215
|
* (Person and Organization both carry hasCredential in schema.org). */
|
|
192
216
|
hasCredential?: EducationalOccupationalCredentialLd[];
|
|
193
217
|
};
|
|
194
|
-
/** v1.10 (issue #288): the `FAQPage` node — a DIFFERENT
|
|
195
|
-
* the entity, so it is its own field, never folded into
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
218
|
+
/** v1.10 (issue #288, consumer half #316): the `FAQPage` node — a DIFFERENT
|
|
219
|
+
* schema.org @type than the entity, so it is its own field, never folded into
|
|
220
|
+
* `jsonLd`. Emitted iff root `faq[]` exists (never an empty FAQPage). No `@id`
|
|
221
|
+
* by design: the engine never invents an anchor (the same rule the entity node
|
|
222
|
+
* follows, §15.4), and a URL fragment convention is not a declared decision.
|
|
223
|
+
* A declared `faq[].source` travels as `Answer.citation` (schema.org `Answer`
|
|
224
|
+
* is a `CreativeWork`). */
|
|
200
225
|
faqJsonLd?: {
|
|
201
226
|
"@context": "https://schema.org";
|
|
202
227
|
"@type": "FAQPage";
|
|
@@ -206,6 +231,8 @@ export interface StructuredDataReadiness {
|
|
|
206
231
|
acceptedAnswer: {
|
|
207
232
|
"@type": "Answer";
|
|
208
233
|
text: string;
|
|
234
|
+
/** The declared pointer backing this answer (v1.10, #288/#316). */
|
|
235
|
+
citation?: string;
|
|
209
236
|
};
|
|
210
237
|
}>;
|
|
211
238
|
};
|
|
@@ -251,7 +278,19 @@ export interface GeoReport {
|
|
|
251
278
|
};
|
|
252
279
|
/** Flat list of every scored check (for `pasco validate` output). */
|
|
253
280
|
checks: GeoCheck[];
|
|
281
|
+
/**
|
|
282
|
+
* The index's own provenance (SPEC §8, #433): a deterministic score over the
|
|
283
|
+
* fields the workspace DECLARES, computed by fixed criteria — never a
|
|
284
|
+
* measurement of what answer engines actually cite. A consumer that quotes
|
|
285
|
+
* `score` must read this first; `measured: false` is the machine-readable
|
|
286
|
+
* half of the same statement.
|
|
287
|
+
*/
|
|
288
|
+
basis: GeoBasisVersion;
|
|
289
|
+
measured: false;
|
|
254
290
|
}
|
|
291
|
+
/** The version of the weights and predicates that produced a `GeoReport.score`.
|
|
292
|
+
* Bump it when a weight or a predicate changes (SPEC §8, #433). */
|
|
293
|
+
export type GeoBasisVersion = "geo-heuristic-v2";
|
|
255
294
|
/** The language-aware slice a renderer consumes (SPEC §7, compile()). */
|
|
256
295
|
export interface PlatformProfile {
|
|
257
296
|
platform: Platform;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,2EAA2E;AAC3E,MAAM,MAAM,OAAO,GAAG,OAAO,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAElE,8DAA8D;AAC9D,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;AAEpD,mFAAmF;AACnF,MAAM,MAAM,aAAa,GAAG,IAAI,CAC9B,OAAO,EACL,MAAM,GACN,WAAW,GACX,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,cAAc,GACd,QAAQ,GACR,eAAe,GACf,OAAO,GACP,WAAW,GACX,WAAW,GACX,aAAa,GACb,aAAa,GACb,WAAW,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,2EAA2E;AAC3E,MAAM,MAAM,OAAO,GAAG,OAAO,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAElE,8DAA8D;AAC9D,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;AAEpD,mFAAmF;AACnF,MAAM,MAAM,aAAa,GAAG,IAAI,CAC9B,O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AC,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,qEAAqE;IACrE,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IACvC;0DACsD;IACtD,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;;;;0FAOsF;IACtF,cAAc,CAAC,EAAE,uBAAuB,CAAC;IACzC;;;;;2BAKuB;IACvB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,8EAA8E;IAC9E,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB;;;;;4CAKwC;IACxC,YAAY,CAAC,EAAE,OAAO,mBAAmB,EAAE,kBAAkB,CAAC;CAC/D"}
|
package/dist/types.js
CHANGED
|
@@ -15,11 +15,25 @@ import { PLATFORM_SLUGS } from "./generated/platforms.gen.js";
|
|
|
15
15
|
* v1.1: role/degree/field can be a plain string (v1) or a bilingual langMap.
|
|
16
16
|
* Reading helper — consumers never null-check or narrow by hand.
|
|
17
17
|
* Proper nouns (org, institution, venue) are never langMap — pass them directly (SPEC §11).
|
|
18
|
+
*
|
|
19
|
+
* `lang` (issue #415): the language-aware form of the same rule `compile()`
|
|
20
|
+
* applies to text fields — the REQUESTED language, falling back to `en`, with
|
|
21
|
+
* an empty string counting as absent. It exists for consumers that print a
|
|
22
|
+
* FACT block (the `refine` task template) where compile passes the raw langMap
|
|
23
|
+
* through untouched; without a `lang` the behaviour is the pre-#415 one
|
|
24
|
+
* (`en` only), so no existing caller changes.
|
|
18
25
|
*/
|
|
19
|
-
export function textOf(v) {
|
|
26
|
+
export function textOf(v, lang) {
|
|
20
27
|
if (v == null)
|
|
21
28
|
return "";
|
|
22
|
-
|
|
29
|
+
if (typeof v === "string")
|
|
30
|
+
return v;
|
|
31
|
+
if (lang !== undefined) {
|
|
32
|
+
const direct = v[lang];
|
|
33
|
+
if (direct)
|
|
34
|
+
return direct;
|
|
35
|
+
}
|
|
36
|
+
return v.en ?? "";
|
|
23
37
|
}
|
|
24
38
|
/** The platform set — the generated `PLATFORM_SLUGS` (D3/D16, #154).
|
|
25
39
|
*
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAuG9D;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,MAAM,CAAC,CAAwC,EAAE,IAAW;IAC1E,IAAI,CAAC,IAAI,IAAI;QAAE,OAAO,EAAE,CAAC;IACzB,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,CAAC,CAAC;IACpC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;QACvB,IAAI,MAAM;YAAE,OAAO,MAAM,CAAC;IAC5B,CAAC;IACD,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;AACpB,CAAC;AAED;;;;;;;sBAOsB;AACtB,MAAM,CAAC,MAAM,SAAS,GAAwB,cAAc,CAAC;AAE7D,MAAM,CAAC,MAAM,KAAK,GAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.1.
|
|
7
|
+
"version": "0.1.3",
|
|
8
8
|
"description": "Core engine of profile-as-code: load (schema-validate), driftCheck, geoCheck, compile. Contract source is schema/profile.schema.json (D3) — Zod is generated, never hand-written.",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"license": "MIT",
|
package/dist/paste-source.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared paste-renderer core (#150): the ONE home of the paste invariant —
|
|
3
|
-
* adapters delegate, never re-implement (the `structured-data.ts` v1.6 /
|
|
4
|
-
* `packages/markdown` precedent; AGENTS.md map).
|
|
5
|
-
*/
|
|
6
|
-
import type { PlatformProfile } from "./types.js";
|
|
7
|
-
/**
|
|
8
|
-
* Paste-source text for a compile() slice: EXACTLY ONE bios row's verbatim
|
|
9
|
-
* text + "\n" — never a merge, because the D18 ledger hashes exactly one row
|
|
10
|
-
* per entry (`trackableUnits()`, SPEC §19.1): a composite would hash something
|
|
11
|
-
* no single row owns and staleness could never match. "" → unbuild (§15.1).
|
|
12
|
-
*/
|
|
13
|
-
export declare function pasteSource(p: PlatformProfile): string;
|
|
14
|
-
//# sourceMappingURL=paste-source.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"paste-source.d.ts","sourceRoot":"","sources":["../src/paste-source.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAa,eAAe,EAAE,MAAM,YAAY,CAAC;AAK7D;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,eAAe,GAAG,MAAM,CAMtD"}
|
package/dist/paste-source.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/** Deterministic body priority for a paste surface: `long` > `medium` > `short`. */
|
|
2
|
-
const LENGTH_PRIORITY = ["long", "medium", "short"];
|
|
3
|
-
/**
|
|
4
|
-
* Paste-source text for a compile() slice: EXACTLY ONE bios row's verbatim
|
|
5
|
-
* text + "\n" — never a merge, because the D18 ledger hashes exactly one row
|
|
6
|
-
* per entry (`trackableUnits()`, SPEC §19.1): a composite would hash something
|
|
7
|
-
* no single row owns and staleness could never match. "" → unbuild (§15.1).
|
|
8
|
-
*/
|
|
9
|
-
export function pasteSource(p) {
|
|
10
|
-
for (const length of LENGTH_PRIORITY) {
|
|
11
|
-
const bio = p.bios.find((b) => b.length === length);
|
|
12
|
-
if (bio !== undefined)
|
|
13
|
-
return `${bio.text}\n`;
|
|
14
|
-
}
|
|
15
|
-
return "";
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=paste-source.js.map
|
package/dist/paste-source.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"paste-source.js","sourceRoot":"","sources":["../src/paste-source.ts"],"names":[],"mappings":"AAOA,oFAAoF;AACpF,MAAM,eAAe,GAAyB,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,CAAkB;IAC5C,KAAK,MAAM,MAAM,IAAI,eAAe,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;QACpD,IAAI,GAAG,KAAK,SAAS;YAAE,OAAO,GAAG,GAAG,CAAC,IAAI,IAAI,CAAC;IAChD,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
|