@agent-workspace/core 0.2.1 → 0.4.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.
@@ -1,19 +1,29 @@
1
1
  /** Current AWP specification version */
2
- export declare const AWP_VERSION = "0.2.0";
2
+ export declare const AWP_VERSION = "0.4.0";
3
3
  /** Current SMP protocol version */
4
4
  export declare const SMP_VERSION = "1.0";
5
+ /** Current RDP protocol version */
6
+ export declare const RDP_VERSION = "1.0";
7
+ /** Current CDP protocol version */
8
+ export declare const CDP_VERSION = "1.0";
5
9
  /** Required workspace files */
6
10
  export declare const REQUIRED_FILES: readonly ["IDENTITY.md", "SOUL.md"];
7
11
  /** Optional workspace files */
8
- export declare const OPTIONAL_FILES: readonly ["AGENTS.md", "USER.md", "TOOLS.md", "HEARTBEAT.md", "BOOTSTRAP.md", "MEMORY.md"];
12
+ export declare const OPTIONAL_FILES: readonly ["AGENTS.md", "USER.md", "TOOLS.md", "HEARTBEAT.md", "MEMORY.md"];
9
13
  /** All known workspace files */
10
- export declare const ALL_WORKSPACE_FILES: readonly ["IDENTITY.md", "SOUL.md", "AGENTS.md", "USER.md", "TOOLS.md", "HEARTBEAT.md", "BOOTSTRAP.md", "MEMORY.md"];
14
+ export declare const ALL_WORKSPACE_FILES: readonly ["IDENTITY.md", "SOUL.md", "AGENTS.md", "USER.md", "TOOLS.md", "HEARTBEAT.md", "MEMORY.md"];
11
15
  /** Workspace manifest path */
12
16
  export declare const MANIFEST_PATH = ".awp/workspace.json";
13
17
  /** Memory directory */
14
18
  export declare const MEMORY_DIR = "memory";
15
19
  /** Artifacts directory */
16
20
  export declare const ARTIFACTS_DIR = "artifacts";
21
+ /** Reputation profiles directory */
22
+ export declare const REPUTATION_DIR = "reputation";
23
+ /** Delegation contracts directory */
24
+ export declare const CONTRACTS_DIR = "contracts";
25
+ /** Projects directory */
26
+ export declare const PROJECTS_DIR = "projects";
17
27
  /** File type to filename mapping */
18
28
  export declare const FILE_TYPE_MAP: Record<string, string>;
19
29
  /**
@@ -27,4 +37,12 @@ export declare const SCHEMAS_DIR: string;
27
37
  export declare function getSchemaPath(schemaFileName: string): string;
28
38
  /** Schema file mapping */
29
39
  export declare const SCHEMA_MAP: Record<string, string>;
40
+ /** EWMA learning rate for reputation updates */
41
+ export declare const REPUTATION_EWMA_ALPHA = 0.15;
42
+ /** Monthly decay rate for reputation scores */
43
+ export declare const REPUTATION_DECAY_RATE = 0.02;
44
+ /** Baseline score that scores decay toward (unknown state) */
45
+ export declare const REPUTATION_BASELINE = 0.5;
46
+ /** Milliseconds per average month (30.44 days) */
47
+ export declare const MS_PER_MONTH: number;
30
48
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAKA,wCAAwC;AACxC,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC,mCAAmC;AACnC,eAAO,MAAM,WAAW,QAAQ,CAAC;AAEjC,+BAA+B;AAC/B,eAAO,MAAM,cAAc,qCAAsC,CAAC;AAElE,+BAA+B;AAC/B,eAAO,MAAM,cAAc,4FAOjB,CAAC;AAEX,gCAAgC;AAChC,eAAO,MAAM,mBAAmB,sHAGtB,CAAC;AAEX,8BAA8B;AAC9B,eAAO,MAAM,aAAa,wBAAwB,CAAC;AAEnD,uBAAuB;AACvB,eAAO,MAAM,UAAU,WAAW,CAAC;AAEnC,0BAA0B;AAC1B,eAAO,MAAM,aAAa,cAAc,CAAC;AAEzC,oCAAoC;AACpC,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAUhD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,QAAmC,CAAC;AAE5D;;GAEG;AACH,wBAAgB,aAAa,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,0BAA0B;AAC1B,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,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,MAAM,CAAC;AAEvC,kDAAkD;AAClD,eAAO,MAAM,YAAY,QAA8B,CAAC"}
package/dist/constants.js CHANGED
@@ -2,9 +2,13 @@ import { dirname, join } from "node:path";
2
2
  import { fileURLToPath } from "node:url";
3
3
  const __dirname = dirname(fileURLToPath(import.meta.url));
4
4
  /** Current AWP specification version */
5
- export const AWP_VERSION = "0.2.0";
5
+ export const AWP_VERSION = "0.4.0";
6
6
  /** Current SMP protocol version */
7
7
  export const SMP_VERSION = "1.0";
8
+ /** Current RDP protocol version */
9
+ export const RDP_VERSION = "1.0";
10
+ /** Current CDP protocol version */
11
+ export const CDP_VERSION = "1.0";
8
12
  /** Required workspace files */
9
13
  export const REQUIRED_FILES = ["IDENTITY.md", "SOUL.md"];
10
14
  /** Optional workspace files */
@@ -13,20 +17,22 @@ export const OPTIONAL_FILES = [
13
17
  "USER.md",
14
18
  "TOOLS.md",
15
19
  "HEARTBEAT.md",
16
- "BOOTSTRAP.md",
17
20
  "MEMORY.md",
18
21
  ];
19
22
  /** All known workspace files */
20
- export const ALL_WORKSPACE_FILES = [
21
- ...REQUIRED_FILES,
22
- ...OPTIONAL_FILES,
23
- ];
23
+ export const ALL_WORKSPACE_FILES = [...REQUIRED_FILES, ...OPTIONAL_FILES];
24
24
  /** Workspace manifest path */
25
25
  export const MANIFEST_PATH = ".awp/workspace.json";
26
26
  /** Memory directory */
27
27
  export const MEMORY_DIR = "memory";
28
28
  /** Artifacts directory */
29
29
  export const ARTIFACTS_DIR = "artifacts";
30
+ /** Reputation profiles directory */
31
+ export const REPUTATION_DIR = "reputation";
32
+ /** Delegation contracts directory */
33
+ export const CONTRACTS_DIR = "contracts";
34
+ /** Projects directory */
35
+ export const PROJECTS_DIR = "projects";
30
36
  /** File type to filename mapping */
31
37
  export const FILE_TYPE_MAP = {
32
38
  identity: "IDENTITY.md",
@@ -35,9 +41,12 @@ export const FILE_TYPE_MAP = {
35
41
  user: "USER.md",
36
42
  tools: "TOOLS.md",
37
43
  heartbeat: "HEARTBEAT.md",
38
- bootstrap: "BOOTSTRAP.md",
39
44
  "memory-longterm": "MEMORY.md",
40
45
  "knowledge-artifact": "artifacts/",
46
+ "reputation-profile": "reputation/",
47
+ "delegation-contract": "contracts/",
48
+ project: "projects/",
49
+ task: "projects/",
41
50
  };
42
51
  /**
43
52
  * Absolute path to the schemas directory bundled with @agent-workspace/core.
@@ -61,5 +70,20 @@ export const SCHEMA_MAP = {
61
70
  "memory-daily": "memory-daily.schema.json",
62
71
  "memory-longterm": "memory-longterm.schema.json",
63
72
  "knowledge-artifact": "knowledge-artifact.schema.json",
73
+ "reputation-profile": "reputation-profile.schema.json",
74
+ "delegation-contract": "delegation-contract.schema.json",
75
+ project: "project.schema.json",
76
+ task: "task.schema.json",
64
77
  };
78
+ // ============================================================================
79
+ // Reputation Constants (RDP)
80
+ // ============================================================================
81
+ /** EWMA learning rate for reputation updates */
82
+ export const REPUTATION_EWMA_ALPHA = 0.15;
83
+ /** Monthly decay rate for reputation scores */
84
+ export const REPUTATION_DECAY_RATE = 0.02;
85
+ /** Baseline score that scores decay toward (unknown state) */
86
+ export const REPUTATION_BASELINE = 0.5;
87
+ /** Milliseconds per average month (30.44 days) */
88
+ export const MS_PER_MONTH = 30.44 * 24 * 60 * 60 * 1000;
65
89
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D,wCAAwC;AACxC,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC;AAEnC,mCAAmC;AACnC,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC;AAE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,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAE1C,8DAA8D;AAC9D,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEvC,kDAAkD;AAClD,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=constants.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.test.d.ts","sourceRoot":"","sources":["../src/constants.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,73 @@
1
+ import { describe, it, expect } from "vitest";
2
+ import { AWP_VERSION, SMP_VERSION, RDP_VERSION, REQUIRED_FILES, OPTIONAL_FILES, ALL_WORKSPACE_FILES, MANIFEST_PATH, MEMORY_DIR, ARTIFACTS_DIR, REPUTATION_DIR, CONTRACTS_DIR, FILE_TYPE_MAP, SCHEMA_MAP, getSchemaPath, } from "./constants.js";
3
+ describe("AWP constants", () => {
4
+ describe("version constants", () => {
5
+ it("has valid semver AWP version", () => {
6
+ expect(AWP_VERSION).toMatch(/^\d+\.\d+\.\d+$/);
7
+ });
8
+ it("has valid SMP version", () => {
9
+ expect(SMP_VERSION).toMatch(/^\d+\.\d+$/);
10
+ });
11
+ it("has valid RDP version", () => {
12
+ expect(RDP_VERSION).toMatch(/^\d+\.\d+$/);
13
+ });
14
+ });
15
+ describe("file constants", () => {
16
+ it("has required files", () => {
17
+ expect(REQUIRED_FILES).toContain("IDENTITY.md");
18
+ expect(REQUIRED_FILES).toContain("SOUL.md");
19
+ expect(REQUIRED_FILES).toHaveLength(2);
20
+ });
21
+ it("has optional files", () => {
22
+ expect(OPTIONAL_FILES).toContain("AGENTS.md");
23
+ expect(OPTIONAL_FILES).toContain("USER.md");
24
+ expect(OPTIONAL_FILES).toContain("MEMORY.md");
25
+ });
26
+ it("ALL_WORKSPACE_FILES combines required and optional", () => {
27
+ expect(ALL_WORKSPACE_FILES).toHaveLength(REQUIRED_FILES.length + OPTIONAL_FILES.length);
28
+ for (const file of REQUIRED_FILES) {
29
+ expect(ALL_WORKSPACE_FILES).toContain(file);
30
+ }
31
+ for (const file of OPTIONAL_FILES) {
32
+ expect(ALL_WORKSPACE_FILES).toContain(file);
33
+ }
34
+ });
35
+ });
36
+ describe("path constants", () => {
37
+ it("has expected manifest path", () => {
38
+ expect(MANIFEST_PATH).toBe(".awp/workspace.json");
39
+ });
40
+ it("has expected directory paths", () => {
41
+ expect(MEMORY_DIR).toBe("memory");
42
+ expect(ARTIFACTS_DIR).toBe("artifacts");
43
+ expect(REPUTATION_DIR).toBe("reputation");
44
+ expect(CONTRACTS_DIR).toBe("contracts");
45
+ });
46
+ });
47
+ describe("FILE_TYPE_MAP", () => {
48
+ it("maps identity type to IDENTITY.md", () => {
49
+ expect(FILE_TYPE_MAP["identity"]).toBe("IDENTITY.md");
50
+ });
51
+ it("maps soul type to SOUL.md", () => {
52
+ expect(FILE_TYPE_MAP["soul"]).toBe("SOUL.md");
53
+ });
54
+ it("maps operations type to AGENTS.md", () => {
55
+ expect(FILE_TYPE_MAP["operations"]).toBe("AGENTS.md");
56
+ });
57
+ });
58
+ describe("SCHEMA_MAP", () => {
59
+ it("maps type names to schema files", () => {
60
+ expect(SCHEMA_MAP["identity"]).toBe("identity.schema.json");
61
+ expect(SCHEMA_MAP["soul"]).toBe("soul.schema.json");
62
+ expect(SCHEMA_MAP["knowledge-artifact"]).toBe("knowledge-artifact.schema.json");
63
+ });
64
+ });
65
+ describe("getSchemaPath", () => {
66
+ it("returns absolute path to schema file", () => {
67
+ const path = getSchemaPath("identity.schema.json");
68
+ expect(path).toContain("schemas");
69
+ expect(path).toContain("identity.schema.json");
70
+ });
71
+ });
72
+ });
73
+ //# sourceMappingURL=constants.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.test.js","sourceRoot":"","sources":["../src/constants.test.ts"],"names":[],"mappings":"AAAA,OAA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
  export type { WorkspaceManifest, BaseFrontmatter, IdentityFrontmatter, SoulFrontmatter, SoulValue, SoulBoundary, SoulGovernance, UserFrontmatter, OperationsFrontmatter, ToolsFrontmatter, HeartbeatFrontmatter, HeartbeatTask, MemoryDailyFrontmatter, MemoryEntry, MemoryLongtermFrontmatter, AnyFrontmatter, WorkspaceFile, } from "./types/workspace.js";
2
- export type { ArtifactFrontmatter, ProvenanceEntry, } from "./types/artifact.js";
3
- export type { AgentCard, AgentSkill, DIDDocument, VerificationMethod, } from "./types/identity.js";
4
- export { AWP_VERSION, SMP_VERSION, REQUIRED_FILES, OPTIONAL_FILES, ALL_WORKSPACE_FILES, MANIFEST_PATH, MEMORY_DIR, ARTIFACTS_DIR, FILE_TYPE_MAP, SCHEMA_MAP, SCHEMAS_DIR, getSchemaPath, } from "./constants.js";
2
+ export type { ArtifactFrontmatter, ProvenanceEntry } from "./types/artifact.js";
3
+ export type { AgentCard, AgentSkill, DIDDocument, VerificationMethod } from "./types/identity.js";
4
+ export type { ReputationProfileFrontmatter, ReputationDimension, ReputationSignal, } from "./types/reputation.js";
5
+ export type { DelegationContractFrontmatter, ContractTask, ContractScope, ContractConstraints, ContractEvaluation, } from "./types/contract.js";
6
+ export type { ProjectFrontmatter, ProjectMember, TaskFrontmatter } from "./types/project.js";
7
+ export { AWP_VERSION, SMP_VERSION, RDP_VERSION, CDP_VERSION, REQUIRED_FILES, OPTIONAL_FILES, ALL_WORKSPACE_FILES, MANIFEST_PATH, MEMORY_DIR, ARTIFACTS_DIR, REPUTATION_DIR, CONTRACTS_DIR, PROJECTS_DIR, FILE_TYPE_MAP, SCHEMA_MAP, SCHEMAS_DIR, getSchemaPath, REPUTATION_EWMA_ALPHA, REPUTATION_DECAY_RATE, REPUTATION_BASELINE, MS_PER_MONTH, } from "./constants.js";
5
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,YAAY,EACZ,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,sBAAsB,EACtB,WAAW,EACX,yBAAyB,EACzB,cAAc,EACd,aAAa,GACd,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACV,mBAAmB,EACnB,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACX,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,WAAW,EACX,WAAW,EACX,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,UAAU,EACV,aAAa,EACb,aAAa,EACb,UAAU,EACV,WAAW,EACX,aAAa,GACd,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,YAAY,EACZ,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,sBAAsB,EACtB,WAAW,EACX,yBAAyB,EACzB,cAAc,EACd,aAAa,GACd,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEhF,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAElG,YAAY,EACV,4BAA4B,EAC5B,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACV,6BAA6B,EAC7B,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE7F,OAAO,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACX,WAAW,EACX,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,UAAU,EACV,aAAa,EACb,cAAc,EACd,aAAa,EACb,YAAY,EACZ,aAAa,EACb,UAAU,EACV,WAAW,EACX,aAAa,EAEb,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,GACb,MAAM,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -1,2 +1,4 @@
1
- export { AWP_VERSION, SMP_VERSION, REQUIRED_FILES, OPTIONAL_FILES, ALL_WORKSPACE_FILES, MANIFEST_PATH, MEMORY_DIR, ARTIFACTS_DIR, FILE_TYPE_MAP, SCHEMA_MAP, SCHEMAS_DIR, getSchemaPath, } from "./constants.js";
1
+ export { AWP_VERSION, SMP_VERSION, RDP_VERSION, CDP_VERSION, REQUIRED_FILES, OPTIONAL_FILES, ALL_WORKSPACE_FILES, MANIFEST_PATH, MEMORY_DIR, ARTIFACTS_DIR, REPUTATION_DIR, CONTRACTS_DIR, PROJECTS_DIR, FILE_TYPE_MAP, SCHEMA_MAP, SCHEMAS_DIR, getSchemaPath,
2
+ // Reputation constants
3
+ REPUTATION_EWMA_ALPHA, REPUTATION_DECAY_RATE, REPUTATION_BASELINE, MS_PER_MONTH, } from "./constants.js";
2
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgCA,OAAO,EACL,WAAW,EACX,WAAW,EACX,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,UAAU,EACV,aAAa,EACb,aAAa,EACb,UAAU,EACV,WAAW,EACX,aAAa,GACd,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAwCA,OAAO,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACX,WAAW,EACX,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,UAAU,EACV,aAAa,EACb,cAAc,EACd,aAAa,EACb,YAAY,EACZ,aAAa,EACb,UAAU,EACV,WAAW,EACX,aAAa;AACb,uBAAuB;AACvB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,GACb,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,49 @@
1
+ import type { BaseFrontmatter } from "./workspace.js";
2
+ /**
3
+ * Task definition within a delegation contract
4
+ */
5
+ export interface ContractTask {
6
+ description: string;
7
+ outputFormat?: string;
8
+ outputSlug?: string;
9
+ }
10
+ /**
11
+ * Scope constraints for a delegation contract
12
+ */
13
+ export interface ContractScope {
14
+ include?: string[];
15
+ exclude?: string[];
16
+ }
17
+ /**
18
+ * Behavioral constraints for a delegation contract
19
+ */
20
+ export interface ContractConstraints {
21
+ requireCitations?: boolean;
22
+ confidenceThreshold?: number;
23
+ }
24
+ /**
25
+ * Evaluation criteria and results
26
+ */
27
+ export interface ContractEvaluation {
28
+ criteria: Record<string, number>;
29
+ result: Record<string, number> | null;
30
+ }
31
+ /**
32
+ * Delegation contract frontmatter (contracts/<slug>.md)
33
+ */
34
+ export interface DelegationContractFrontmatter extends BaseFrontmatter {
35
+ type: "delegation-contract";
36
+ rdp: string;
37
+ id: string;
38
+ status: "draft" | "active" | "completed" | "evaluated";
39
+ delegator: string;
40
+ delegate: string;
41
+ delegateSlug: string;
42
+ created: string;
43
+ deadline?: string;
44
+ task: ContractTask;
45
+ scope?: ContractScope;
46
+ constraints?: ContractConstraints;
47
+ evaluation: ContractEvaluation;
48
+ }
49
+ //# sourceMappingURL=contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/types/contract.ts"],"names":[],"mappings":"AAAA,O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sourceRoot":"","sources":["../../src/types/contract.ts"],"names":[],"mappings":""}
@@ -0,0 +1,49 @@
1
+ import type { BaseFrontmatter } from "./workspace.js";
2
+ /**
3
+ * A project member with role and optional reputation gates
4
+ */
5
+ export interface ProjectMember {
6
+ did: string;
7
+ role: string;
8
+ slug: string;
9
+ minReputation?: Record<string, number>;
10
+ }
11
+ /**
12
+ * Project frontmatter (projects/<slug>.md)
13
+ */
14
+ export interface ProjectFrontmatter extends BaseFrontmatter {
15
+ type: "project";
16
+ cdp: string;
17
+ id: string;
18
+ title: string;
19
+ status: "draft" | "active" | "paused" | "completed" | "archived";
20
+ owner: string;
21
+ created: string;
22
+ deadline?: string;
23
+ members: ProjectMember[];
24
+ tags?: string[];
25
+ taskCount: number;
26
+ completedCount: number;
27
+ }
28
+ /**
29
+ * Task frontmatter (projects/<project-slug>/tasks/<task-slug>.md)
30
+ */
31
+ export interface TaskFrontmatter extends BaseFrontmatter {
32
+ type: "task";
33
+ cdp: string;
34
+ id: string;
35
+ projectId: string;
36
+ title: string;
37
+ status: "pending" | "in-progress" | "blocked" | "review" | "completed" | "cancelled";
38
+ assignee?: string;
39
+ assigneeSlug?: string;
40
+ priority: "low" | "medium" | "high" | "critical";
41
+ created: string;
42
+ deadline?: string;
43
+ blockedBy: string[];
44
+ blocks: string[];
45
+ outputArtifact?: string;
46
+ contractSlug?: string;
47
+ tags?: string[];
48
+ }
49
+ //# sourceMappingURL=project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/types/project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;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map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/types/project.ts"],"names":[],"mappings":""}
@@ -0,0 +1,60 @@
1
+ import type { BaseFrontmatter } from "./workspace.js";
2
+ /**
3
+ * A single reputation dimension score with confidence tracking.
4
+ * Scores are updated via EWMA (Exponentially Weighted Moving Average)
5
+ * and decay toward 0.5 (baseline) over time without new signals.
6
+ */
7
+ export interface ReputationDimension {
8
+ /** Current score (0.0 to 1.0, decays toward 0.5) */
9
+ score: number;
10
+ /** Confidence level based on sample size (0.0 to 1.0) */
11
+ confidence: number;
12
+ /** Number of signals received for this dimension */
13
+ sampleSize: number;
14
+ /** ISO 8601 timestamp of the last signal */
15
+ lastSignal: string;
16
+ }
17
+ /**
18
+ * An atomic reputation observation from one agent about another.
19
+ * Signals are the raw data that feed into reputation scores.
20
+ */
21
+ export interface ReputationSignal {
22
+ /** DID of the agent providing this signal */
23
+ source: string;
24
+ /** Dimension being evaluated (e.g., "reliability", "epistemic-hygiene") */
25
+ dimension: string;
26
+ /** Optional domain for domain-specific competence */
27
+ domain?: string;
28
+ /** Score for this observation (0.0 to 1.0) */
29
+ score: number;
30
+ /** ISO 8601 timestamp when signal was recorded */
31
+ timestamp: string;
32
+ /** Reference to evidence (e.g., artifact ID, contract ID) */
33
+ evidence?: string;
34
+ /** Human-readable explanation */
35
+ message?: string;
36
+ }
37
+ /**
38
+ * Reputation profile frontmatter (reputation/<slug>.md).
39
+ * Tracks multi-dimensional reputation for an agent using RDP (Reputation & Delegation Protocol).
40
+ */
41
+ export interface ReputationProfileFrontmatter extends BaseFrontmatter {
42
+ type: "reputation-profile";
43
+ /** RDP protocol version */
44
+ rdp: string;
45
+ /** Profile identifier (format: "reputation:<slug>") */
46
+ id: string;
47
+ /** DID of the agent this profile tracks */
48
+ agentDid: string;
49
+ /** Display name of the tracked agent */
50
+ agentName: string;
51
+ /** ISO 8601 timestamp of last update */
52
+ lastUpdated: string;
53
+ /** Standard reputation dimensions (reliability, epistemic-hygiene, coordination) */
54
+ dimensions?: Record<string, ReputationDimension>;
55
+ /** Domain-specific competence scores */
56
+ domainCompetence?: Record<string, ReputationDimension>;
57
+ /** Full history of reputation signals */
58
+ signals: ReputationSignal[];
59
+ }
60
+ //# sourceMappingURL=reputation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reputation.d.ts","sourceRoot":"","sources":["../../src/types/reputation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,SAAS,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,SAAS,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,4BAA6B,SAAQ,eAAe;IACnE,IAAI,EAAE,oBAAoB,CAAC;IAC3B,2BAA2B;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,uDAAuD;IACvD,EAAE,EAAE,MAAM,CAAC;IACX,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,oFAAoF;IACpF,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IACjD,wCAAwC;IACxC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IACvD,yCAAyC;IACzC,OAAO,EAAE,gBAAgB,EAAE,CAAC;CAC7B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=reputation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reputation.js","sourceRoot":"","sources":["../../src/types/reputation.ts"],"names":[],"mappings":""}
@@ -1,65 +1,106 @@
1
1
  /**
2
- * AWP Workspace manifest (.awp/workspace.json)
2
+ * AWP Workspace manifest stored at .awp/workspace.json
3
+ * Contains workspace-level metadata and agent configuration.
3
4
  */
4
5
  export interface WorkspaceManifest {
6
+ /** AWP specification version (e.g., "0.4.0") */
5
7
  awp: string;
8
+ /** Unique workspace identifier (URN format) */
6
9
  id: string;
10
+ /** Human-readable workspace name */
7
11
  name: string;
12
+ /** ISO 8601 timestamp when workspace was created */
8
13
  created: string;
14
+ /** Agent configuration */
9
15
  agent: {
16
+ /** Agent's decentralized identifier (did:key format) */
10
17
  did?: string;
18
+ /** Path to identity file (default: "IDENTITY.md") */
11
19
  identityFile: string;
12
20
  };
21
+ /** List of agent capabilities (e.g., ["coding", "research"]) */
13
22
  capabilities?: string[];
23
+ /** Protocol support flags */
14
24
  protocols?: {
25
+ /** Agent-to-Agent protocol support */
15
26
  a2a?: boolean;
27
+ /** Model Context Protocol support */
16
28
  mcp?: boolean;
17
29
  };
18
30
  }
19
31
  /**
20
- * Common frontmatter fields shared by all workspace files
32
+ * Common YAML frontmatter fields shared by all AWP workspace files.
33
+ * Every workspace file (*.md) includes these base fields.
21
34
  */
22
35
  export interface BaseFrontmatter {
36
+ /** AWP specification version */
23
37
  awp: string;
38
+ /** File type identifier (e.g., "identity", "soul", "memory-daily") */
24
39
  type: string;
40
+ /** ISO 8601 timestamp of last modification */
25
41
  lastModified?: string;
42
+ /** DID or identifier of last modifier */
26
43
  modifiedBy?: string;
27
44
  }
28
45
  /**
29
- * IDENTITY.md frontmatter
46
+ * IDENTITY.md frontmatter - defines the agent's public identity.
47
+ * Contains factual information about what the agent is and can do.
30
48
  */
31
49
  export interface IdentityFrontmatter extends BaseFrontmatter {
32
50
  type: "identity";
51
+ /** Decentralized identifier (did:key format) */
33
52
  did?: string;
53
+ /** Agent's display name */
34
54
  name: string;
55
+ /** What kind of entity this is (e.g., "digital assistant", "coding agent") */
35
56
  creature?: string;
57
+ /** Representative emoji */
36
58
  emoji?: string;
59
+ /** URL to avatar image */
37
60
  avatar?: string;
61
+ /** List of capabilities this agent has */
38
62
  capabilities?: string[];
63
+ /** ISO 8601 timestamp when identity was created */
39
64
  created: string;
40
65
  }
41
66
  /**
42
- * SOUL.md frontmatter
67
+ * SOUL.md frontmatter - defines the agent's personality, values, and behavioral constraints.
68
+ * This is who the agent IS, not just what it can do.
43
69
  */
44
70
  export interface SoulFrontmatter extends BaseFrontmatter {
45
71
  type: "soul";
72
+ /** Brief personality description */
46
73
  vibe?: string;
74
+ /** Core values that guide behavior */
47
75
  values?: SoulValue[];
76
+ /** Behavioral boundaries and constraints */
48
77
  boundaries?: SoulBoundary[];
78
+ /** Governance rules for human oversight */
49
79
  governance?: SoulGovernance;
50
80
  }
81
+ /** A core value that guides agent behavior */
51
82
  export interface SoulValue {
83
+ /** Unique identifier for this value */
52
84
  id: string;
85
+ /** Priority ranking (1 = highest) */
53
86
  priority?: number;
87
+ /** Description of what this value means in practice */
54
88
  description: string;
55
89
  }
90
+ /** A behavioral boundary or constraint */
56
91
  export interface SoulBoundary {
92
+ /** Unique identifier for this boundary */
57
93
  id: string;
94
+ /** The rule or constraint */
58
95
  rule: string;
96
+ /** Severity level: "hard" = never violate, "soft" = prefer to follow */
59
97
  severity: "hard" | "soft";
60
98
  }
99
+ /** Governance rules defining what requires human approval */
61
100
  export interface SoulGovernance {
101
+ /** Actions that always require human approval */
62
102
  humanApprovalRequired?: string[];
103
+ /** Actions the agent can take autonomously */
63
104
  autonomouslyAllowed?: string[];
64
105
  }
65
106
  /**
@@ -90,17 +131,25 @@ export interface OperationsFrontmatter extends BaseFrontmatter {
90
131
  };
91
132
  }
92
133
  /**
93
- * Daily memory log frontmatter
134
+ * Daily memory log frontmatter (memory/YYYY-MM-DD.md).
135
+ * Contains structured entries from a single day.
94
136
  */
95
137
  export interface MemoryDailyFrontmatter extends BaseFrontmatter {
96
138
  type: "memory-daily";
139
+ /** Date in YYYY-MM-DD format */
97
140
  date: string;
141
+ /** Structured memory entries for this day */
98
142
  entries?: MemoryEntry[];
99
143
  }
144
+ /** A single memory entry in a daily log */
100
145
  export interface MemoryEntry {
146
+ /** Time of entry in HH:MM format */
101
147
  time?: string;
148
+ /** The memory content */
102
149
  content: string;
150
+ /** Tags for categorization and search */
103
151
  tags?: string[];
152
+ /** Whether this entry should be preserved during compaction */
104
153
  pinned?: boolean;
105
154
  }
106
155
  /**
@@ -132,16 +181,28 @@ export interface HeartbeatTask {
132
181
  enabled?: boolean;
133
182
  }
134
183
  import type { ArtifactFrontmatter } from "./artifact.js";
184
+ import type { ReputationProfileFrontmatter } from "./reputation.js";
185
+ import type { DelegationContractFrontmatter } from "./contract.js";
186
+ import type { ProjectFrontmatter, TaskFrontmatter } from "./project.js";
135
187
  /**
136
188
  * Union of all frontmatter types
137
189
  */
138
- export type AnyFrontmatter = IdentityFrontmatter | SoulFrontmatter | UserFrontmatter | OperationsFrontmatter | ToolsFrontmatter | HeartbeatFrontmatter | MemoryDailyFrontmatter | MemoryLongtermFrontmatter | ArtifactFrontmatter;
190
+ export type AnyFrontmatter = IdentityFrontmatter | SoulFrontmatter | UserFrontmatter | OperationsFrontmatter | ToolsFrontmatter | HeartbeatFrontmatter | MemoryDailyFrontmatter | MemoryLongtermFrontmatter | ArtifactFrontmatter | ReputationProfileFrontmatter | DelegationContractFrontmatter | ProjectFrontmatter | TaskFrontmatter;
139
191
  /**
140
- * A parsed workspace file frontmatter + markdown body
192
+ * A parsed AWP workspace file containing YAML frontmatter and markdown body.
193
+ * Generic type T allows type-safe access to specific frontmatter types.
194
+ *
195
+ * @template T - The frontmatter type (extends BaseFrontmatter)
196
+ * @example
197
+ * const identity = await parseWorkspaceFile<IdentityFrontmatter>("IDENTITY.md");
198
+ * console.log(identity.frontmatter.name); // Type-safe access
141
199
  */
142
200
  export interface WorkspaceFile<T extends BaseFrontmatter = BaseFrontmatter> {
201
+ /** Parsed YAML frontmatter */
143
202
  frontmatter: T;
203
+ /** Markdown body content (without frontmatter) */
144
204
  body: string;
205
+ /** Absolute path to the file */
145
206
  filePath: string;
146
207
  }
147
208
  //# sourceMappingURL=workspace.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/types/workspace.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE;QACL,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,SAAS,CAAC,EAAE;QACV,GAAG,CAAC,EAAE,OAAO,CAAC;QACd,GAAG,CAAC,EAAE,OAAO,CAAC;KACf,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,eAAe;IAC1D,IAAI,EAAE,UAAU,CAAC;IACjB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EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,cAAc,GACtB,mBAAmB,GACnB,eAAe,GACf,eAAe,GACf,qBAAqB,GACrB,gBAAgB,GAChB,oBAAoB,GACpB,sBAAsB,GACtB,yBAAyB,GACzB,mBAAmB,CAAC;AAExB;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe;IACxE,WAAW,EAAE,CAAC,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB"}
1
+ {"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/types/workspace.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,+CAA+C;IAC/C,EAAE,EAAE,MAAM,CAAC;IACX,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,0BAA0B;IAC1B,KAAK,EAAE;QACL,wDAAwD;QACxD,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,qDAAqD;QACrD,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,gEAAgE;IAChE,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,6BAA6B;IAC7B,SAAS,CAAC,EAAE;QACV,sCAAsC;QACtC,GAAG,CAAC,EAAE,OAAO,CAAC;QACd,qCAAqC;QACrC,GAAG,CAAC,EAAE,OAAO,CAAC;KACf,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,gCAAgC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,UAAU,CAAC,EAAE,MAAM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+1,6 @@
1
1
  {
2
2
  "name": "@agent-workspace/core",
3
- "version": "0.2.1",
3
+ "version": "0.4.0",
4
4
  "description": "Core types, constants, and schemas for the Agent Workspace Protocol",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -39,8 +39,13 @@
39
39
  "node": ">=18"
40
40
  },
41
41
  "scripts": {
42
+ "copy-schemas": "cp -r ../../spec/schemas/* ./schemas/",
43
+ "prebuild": "npm run copy-schemas",
42
44
  "build": "tsc",
43
45
  "dev": "tsc --watch",
46
+ "lint": "eslint src/",
47
+ "test": "vitest run",
48
+ "test:watch": "vitest",
44
49
  "typecheck": "tsc --noEmit",
45
50
  "prepublishOnly": "npm run build"
46
51
  },
@@ -0,0 +1,139 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://awp.dev/schemas/delegation-contract.schema.json",
4
+ "title": "AWP Delegation Contract",
5
+ "description": "Schema for AWP delegation contract frontmatter (RDP v1.0)",
6
+ "type": "object",
7
+ "required": ["awp", "rdp", "type", "id", "status", "delegator", "delegate", "delegateSlug", "created", "task", "evaluation"],
8
+ "properties": {
9
+ "awp": {
10
+ "type": "string",
11
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
12
+ "description": "AWP specification version"
13
+ },
14
+ "rdp": {
15
+ "type": "string",
16
+ "description": "RDP specification version"
17
+ },
18
+ "type": {
19
+ "type": "string",
20
+ "const": "delegation-contract"
21
+ },
22
+ "id": {
23
+ "type": "string",
24
+ "pattern": "^contract:[a-z0-9][a-z0-9-]*$",
25
+ "description": "Unique identifier (contract:<slug>)"
26
+ },
27
+ "status": {
28
+ "type": "string",
29
+ "enum": ["draft", "active", "completed", "evaluated"],
30
+ "description": "Contract lifecycle state"
31
+ },
32
+ "delegator": {
33
+ "type": "string",
34
+ "description": "DID of the agent delegating work"
35
+ },
36
+ "delegate": {
37
+ "type": "string",
38
+ "description": "DID of the agent receiving work"
39
+ },
40
+ "delegateSlug": {
41
+ "type": "string",
42
+ "pattern": "^[a-z0-9][a-z0-9-]*$",
43
+ "description": "Slug of delegate's reputation profile"
44
+ },
45
+ "created": {
46
+ "type": "string",
47
+ "format": "date-time",
48
+ "description": "Contract creation timestamp"
49
+ },
50
+ "deadline": {
51
+ "type": "string",
52
+ "format": "date-time",
53
+ "description": "Optional deadline"
54
+ },
55
+ "task": {
56
+ "type": "object",
57
+ "required": ["description"],
58
+ "properties": {
59
+ "description": {
60
+ "type": "string",
61
+ "description": "What needs to be done"
62
+ },
63
+ "outputFormat": {
64
+ "type": "string",
65
+ "description": "Expected output type (e.g., 'knowledge-artifact')"
66
+ },
67
+ "outputSlug": {
68
+ "type": "string",
69
+ "description": "Expected output artifact slug"
70
+ }
71
+ },
72
+ "additionalProperties": true
73
+ },
74
+ "scope": {
75
+ "type": "object",
76
+ "properties": {
77
+ "include": {
78
+ "type": "array",
79
+ "items": { "type": "string" },
80
+ "description": "What's in scope"
81
+ },
82
+ "exclude": {
83
+ "type": "array",
84
+ "items": { "type": "string" },
85
+ "description": "What's out of scope"
86
+ }
87
+ },
88
+ "additionalProperties": true
89
+ },
90
+ "constraints": {
91
+ "type": "object",
92
+ "properties": {
93
+ "requireCitations": {
94
+ "type": "boolean",
95
+ "description": "Must cite sources"
96
+ },
97
+ "confidenceThreshold": {
98
+ "type": "number",
99
+ "minimum": 0,
100
+ "maximum": 1,
101
+ "description": "Minimum confidence for claims"
102
+ }
103
+ },
104
+ "additionalProperties": true
105
+ },
106
+ "evaluation": {
107
+ "type": "object",
108
+ "required": ["criteria"],
109
+ "properties": {
110
+ "criteria": {
111
+ "type": "object",
112
+ "description": "Map of criterion name to weight (should sum to 1.0)",
113
+ "additionalProperties": {
114
+ "type": "number",
115
+ "minimum": 0,
116
+ "maximum": 1
117
+ }
118
+ },
119
+ "result": {
120
+ "oneOf": [
121
+ { "type": "null" },
122
+ {
123
+ "type": "object",
124
+ "description": "Map of criterion name to score (0.0-1.0)",
125
+ "additionalProperties": {
126
+ "type": "number",
127
+ "minimum": 0,
128
+ "maximum": 1
129
+ }
130
+ }
131
+ ],
132
+ "description": "Evaluation results, null until evaluated"
133
+ }
134
+ },
135
+ "additionalProperties": true
136
+ }
137
+ },
138
+ "additionalProperties": true
139
+ }
@@ -0,0 +1,106 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://awp.dev/schemas/project.schema.json",
4
+ "title": "AWP Project",
5
+ "description": "Schema for AWP project frontmatter (CDP v1.0)",
6
+ "type": "object",
7
+ "required": ["awp", "cdp", "type", "id", "title", "status", "owner", "created", "members", "taskCount", "completedCount"],
8
+ "properties": {
9
+ "awp": {
10
+ "type": "string",
11
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
12
+ "description": "AWP specification version"
13
+ },
14
+ "cdp": {
15
+ "type": "string",
16
+ "description": "CDP specification version"
17
+ },
18
+ "type": {
19
+ "type": "string",
20
+ "const": "project"
21
+ },
22
+ "id": {
23
+ "type": "string",
24
+ "pattern": "^project:[a-z0-9][a-z0-9-]*$",
25
+ "description": "Unique identifier (project:<slug>)"
26
+ },
27
+ "title": {
28
+ "type": "string",
29
+ "description": "Human-readable project title"
30
+ },
31
+ "status": {
32
+ "type": "string",
33
+ "enum": ["draft", "active", "paused", "completed", "archived"],
34
+ "description": "Project lifecycle state"
35
+ },
36
+ "owner": {
37
+ "type": "string",
38
+ "description": "DID of the project owner"
39
+ },
40
+ "created": {
41
+ "type": "string",
42
+ "format": "date-time",
43
+ "description": "Project creation timestamp"
44
+ },
45
+ "deadline": {
46
+ "type": "string",
47
+ "format": "date-time",
48
+ "description": "Optional deadline"
49
+ },
50
+ "members": {
51
+ "type": "array",
52
+ "description": "Project members with roles and optional reputation gates",
53
+ "items": {
54
+ "$ref": "#/$defs/projectMember"
55
+ },
56
+ "minItems": 1
57
+ },
58
+ "tags": {
59
+ "type": "array",
60
+ "items": { "type": "string" },
61
+ "description": "Classification tags"
62
+ },
63
+ "taskCount": {
64
+ "type": "integer",
65
+ "minimum": 0,
66
+ "description": "Total number of tasks"
67
+ },
68
+ "completedCount": {
69
+ "type": "integer",
70
+ "minimum": 0,
71
+ "description": "Number of completed tasks"
72
+ }
73
+ },
74
+ "additionalProperties": true,
75
+ "$defs": {
76
+ "projectMember": {
77
+ "type": "object",
78
+ "required": ["did", "role", "slug"],
79
+ "properties": {
80
+ "did": {
81
+ "type": "string",
82
+ "description": "W3C DID of the member agent"
83
+ },
84
+ "role": {
85
+ "type": "string",
86
+ "description": "Role name (e.g., 'lead', 'researcher', 'writer')"
87
+ },
88
+ "slug": {
89
+ "type": "string",
90
+ "pattern": "^[a-z0-9][a-z0-9-]*$",
91
+ "description": "Reputation profile slug"
92
+ },
93
+ "minReputation": {
94
+ "type": "object",
95
+ "description": "Map of dimension/domain to minimum score threshold",
96
+ "additionalProperties": {
97
+ "type": "number",
98
+ "minimum": 0,
99
+ "maximum": 1
100
+ }
101
+ }
102
+ },
103
+ "additionalProperties": true
104
+ }
105
+ }
106
+ }
@@ -0,0 +1,132 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://awp.dev/schemas/reputation-profile.schema.json",
4
+ "title": "AWP Reputation Profile",
5
+ "description": "Schema for AWP reputation profile frontmatter (RDP v1.0)",
6
+ "type": "object",
7
+ "required": ["awp", "rdp", "type", "id", "agentDid", "agentName", "lastUpdated", "signals"],
8
+ "properties": {
9
+ "awp": {
10
+ "type": "string",
11
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
12
+ "description": "AWP specification version"
13
+ },
14
+ "rdp": {
15
+ "type": "string",
16
+ "description": "RDP specification version"
17
+ },
18
+ "type": {
19
+ "type": "string",
20
+ "const": "reputation-profile"
21
+ },
22
+ "id": {
23
+ "type": "string",
24
+ "pattern": "^reputation:[a-z0-9][a-z0-9-]*$",
25
+ "description": "Unique identifier (reputation:<slug>)"
26
+ },
27
+ "agentDid": {
28
+ "type": "string",
29
+ "description": "W3C DID of the tracked agent"
30
+ },
31
+ "agentName": {
32
+ "type": "string",
33
+ "description": "Human-readable agent name"
34
+ },
35
+ "lastUpdated": {
36
+ "type": "string",
37
+ "format": "date-time",
38
+ "description": "Timestamp of last signal"
39
+ },
40
+ "dimensions": {
41
+ "type": "object",
42
+ "description": "Map of dimension name to score object",
43
+ "additionalProperties": {
44
+ "$ref": "#/$defs/dimensionScore"
45
+ }
46
+ },
47
+ "domainCompetence": {
48
+ "type": "object",
49
+ "description": "Map of domain name to score object",
50
+ "additionalProperties": {
51
+ "$ref": "#/$defs/dimensionScore"
52
+ }
53
+ },
54
+ "signals": {
55
+ "type": "array",
56
+ "description": "Append-only log of reputation signals",
57
+ "items": {
58
+ "$ref": "#/$defs/reputationSignal"
59
+ }
60
+ }
61
+ },
62
+ "additionalProperties": true,
63
+ "$defs": {
64
+ "dimensionScore": {
65
+ "type": "object",
66
+ "required": ["score", "confidence", "sampleSize", "lastSignal"],
67
+ "properties": {
68
+ "score": {
69
+ "type": "number",
70
+ "minimum": 0,
71
+ "maximum": 1,
72
+ "description": "Raw score (before decay)"
73
+ },
74
+ "confidence": {
75
+ "type": "number",
76
+ "minimum": 0,
77
+ "maximum": 1,
78
+ "description": "Data confidence level"
79
+ },
80
+ "sampleSize": {
81
+ "type": "integer",
82
+ "minimum": 0,
83
+ "description": "Number of signals received"
84
+ },
85
+ "lastSignal": {
86
+ "type": "string",
87
+ "format": "date-time",
88
+ "description": "Timestamp of most recent signal"
89
+ }
90
+ },
91
+ "additionalProperties": true
92
+ },
93
+ "reputationSignal": {
94
+ "type": "object",
95
+ "required": ["source", "dimension", "score", "timestamp"],
96
+ "properties": {
97
+ "source": {
98
+ "type": "string",
99
+ "description": "DID of the observer"
100
+ },
101
+ "dimension": {
102
+ "type": "string",
103
+ "description": "Which dimension (e.g., 'reliability', 'domain-competence')"
104
+ },
105
+ "domain": {
106
+ "type": "string",
107
+ "description": "Domain name (required when dimension is 'domain-competence')"
108
+ },
109
+ "score": {
110
+ "type": "number",
111
+ "minimum": 0,
112
+ "maximum": 1,
113
+ "description": "Observed performance score"
114
+ },
115
+ "timestamp": {
116
+ "type": "string",
117
+ "format": "date-time",
118
+ "description": "When the observation was made"
119
+ },
120
+ "evidence": {
121
+ "type": "string",
122
+ "description": "Reference to supporting evidence (e.g., 'contract:q3-research')"
123
+ },
124
+ "message": {
125
+ "type": "string",
126
+ "description": "Human-readable note"
127
+ }
128
+ },
129
+ "additionalProperties": true
130
+ }
131
+ }
132
+ }
@@ -0,0 +1,90 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://awp.dev/schemas/task.schema.json",
4
+ "title": "AWP Task",
5
+ "description": "Schema for AWP task frontmatter (CDP v1.0)",
6
+ "type": "object",
7
+ "required": ["awp", "cdp", "type", "id", "projectId", "title", "status", "priority", "created", "blockedBy", "blocks"],
8
+ "properties": {
9
+ "awp": {
10
+ "type": "string",
11
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
12
+ "description": "AWP specification version"
13
+ },
14
+ "cdp": {
15
+ "type": "string",
16
+ "description": "CDP specification version"
17
+ },
18
+ "type": {
19
+ "type": "string",
20
+ "const": "task"
21
+ },
22
+ "id": {
23
+ "type": "string",
24
+ "pattern": "^task:[a-z0-9][a-z0-9-]*/[a-z0-9][a-z0-9-]*$",
25
+ "description": "Unique identifier (task:<project-slug>/<task-slug>)"
26
+ },
27
+ "projectId": {
28
+ "type": "string",
29
+ "pattern": "^project:[a-z0-9][a-z0-9-]*$",
30
+ "description": "Parent project ID"
31
+ },
32
+ "title": {
33
+ "type": "string",
34
+ "description": "Human-readable task title"
35
+ },
36
+ "status": {
37
+ "type": "string",
38
+ "enum": ["pending", "in-progress", "blocked", "review", "completed", "cancelled"],
39
+ "description": "Task lifecycle state"
40
+ },
41
+ "assignee": {
42
+ "type": "string",
43
+ "description": "DID of the assigned agent"
44
+ },
45
+ "assigneeSlug": {
46
+ "type": "string",
47
+ "pattern": "^[a-z0-9][a-z0-9-]*$",
48
+ "description": "Reputation profile slug of the assignee"
49
+ },
50
+ "priority": {
51
+ "type": "string",
52
+ "enum": ["low", "medium", "high", "critical"],
53
+ "description": "Task priority level"
54
+ },
55
+ "created": {
56
+ "type": "string",
57
+ "format": "date-time",
58
+ "description": "Task creation timestamp"
59
+ },
60
+ "deadline": {
61
+ "type": "string",
62
+ "format": "date-time",
63
+ "description": "Optional deadline"
64
+ },
65
+ "blockedBy": {
66
+ "type": "array",
67
+ "items": { "type": "string" },
68
+ "description": "Task IDs this task depends on"
69
+ },
70
+ "blocks": {
71
+ "type": "array",
72
+ "items": { "type": "string" },
73
+ "description": "Task IDs that depend on this task"
74
+ },
75
+ "outputArtifact": {
76
+ "type": "string",
77
+ "description": "Expected output artifact slug"
78
+ },
79
+ "contractSlug": {
80
+ "type": "string",
81
+ "description": "Linked delegation contract slug"
82
+ },
83
+ "tags": {
84
+ "type": "array",
85
+ "items": { "type": "string" },
86
+ "description": "Classification tags"
87
+ }
88
+ },
89
+ "additionalProperties": true
90
+ }