@agent-workspace/core 0.4.0 → 0.6.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.
@@ -24,6 +24,8 @@ export declare const REPUTATION_DIR = "reputation";
24
24
  export declare const CONTRACTS_DIR = "contracts";
25
25
  /** Projects directory */
26
26
  export declare const PROJECTS_DIR = "projects";
27
+ /** Swarms directory */
28
+ export declare const SWARMS_DIR = "swarms";
27
29
  /** File type to filename mapping */
28
30
  export declare const FILE_TYPE_MAP: Record<string, string>;
29
31
  /**
@@ -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,mCAAmC;AACnC,eAAO,MAAM,WAAW,QAAQ,CAAC;AAEjC,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,4EAMjB,CAAC;AAEX,gCAAgC;AAChC,eAAO,MAAM,mBAAmB,sGAAkD,CAAC;AAEnF,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,cAAc,eAAe,CAAC;AAE3C,qCAAqC;AACrC,eAAO,MAAM,aAAa,cAAc,CAAC;AAEzC,yBAAyB;AACzB,eAAO,MAAM,YAAY,aAAa,CAAC;AAEvC,oCAAoC;AACpC,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAahD,CAAC;AAEF;;;GAGG;AACH,eAAO,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;AACpC,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAchD,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,MAAM,CAe7C,CAAC;AAMF,gDAAgD;AAChD,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAE1C,+CAA+C;AAC/C,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAE1C,8DAA8D;AAC9D,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,kDAAkD;AAClD,eAAO,MAAM,YAAY,QAA8B,CAAC"}
package/dist/constants.js CHANGED
@@ -33,6 +33,8 @@ export const REPUTATION_DIR = "reputation";
33
33
  export const CONTRACTS_DIR = "contracts";
34
34
  /** Projects directory */
35
35
  export const PROJECTS_DIR = "projects";
36
+ /** Swarms directory */
37
+ export const SWARMS_DIR = "swarms";
36
38
  /** File type to filename mapping */
37
39
  export const FILE_TYPE_MAP = {
38
40
  identity: "IDENTITY.md",
@@ -47,6 +49,7 @@ export const FILE_TYPE_MAP = {
47
49
  "delegation-contract": "contracts/",
48
50
  project: "projects/",
49
51
  task: "projects/",
52
+ swarm: "swarms/",
50
53
  };
51
54
  /**
52
55
  * Absolute path to the schemas directory bundled with @agent-workspace/core.
@@ -74,6 +77,7 @@ export const SCHEMA_MAP = {
74
77
  "delegation-contract": "delegation-contract.schema.json",
75
78
  project: "project.schema.json",
76
79
  task: "task.schema.json",
80
+ swarm: "swarm.schema.json",
77
81
  };
78
82
  // ============================================================================
79
83
  // Reputation Constants (RDP)
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WA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I,CAAC;AAE1C,+CAA+C;AAC/C,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"}
package/dist/index.d.ts CHANGED
@@ -4,5 +4,6 @@ export type { AgentCard, AgentSkill, DIDDocument, VerificationMethod } from "./t
4
4
  export type { ReputationProfileFrontmatter, ReputationDimension, ReputationSignal, } from "./types/reputation.js";
5
5
  export type { DelegationContractFrontmatter, ContractTask, ContractScope, ContractConstraints, ContractEvaluation, } from "./types/contract.js";
6
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";
7
+ export type { SwarmFrontmatter, SwarmRole, SwarmGovernance } from "./types/swarm.js";
8
+ 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, SWARMS_DIR, FILE_TYPE_MAP, SCHEMA_MAP, SCHEMAS_DIR, getSchemaPath, REPUTATION_EWMA_ALPHA, REPUTATION_DECAY_RATE, REPUTATION_BASELINE, MS_PER_MONTH, } from "./constants.js";
8
9
  //# 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,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"}
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,YAAY,EAAE,gBAAgB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAErF,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,UAAU,EACV,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,4 +1,4 @@
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,
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, SWARMS_DIR, FILE_TYPE_MAP, SCHEMA_MAP, SCHEMAS_DIR, getSchemaPath,
2
2
  // Reputation constants
3
3
  REPUTATION_EWMA_ALPHA, REPUTATION_DECAY_RATE, REPUTATION_BASELINE, MS_PER_MONTH, } from "./constants.js";
4
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":"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"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA0CA,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,UAAU,EACV,aAAa,EACb,UAAU,EACV,WAAW,EACX,aAAa;AACb,uBAAuB;AACvB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,GACb,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,55 @@
1
+ import type { BaseFrontmatter } from "./workspace.js";
2
+ /**
3
+ * Human governance settings for a swarm
4
+ */
5
+ export interface SwarmGovernance {
6
+ /** User ID of the human lead (e.g., 'user:marc') */
7
+ humanLead?: string;
8
+ /** Whether the human lead can veto decisions */
9
+ vetoPower?: boolean;
10
+ /** Auto-escalate to human if confidence below this threshold (0.0-1.0) */
11
+ escalationThreshold?: number;
12
+ }
13
+ /**
14
+ * A role definition within a swarm with reputation requirements
15
+ */
16
+ export interface SwarmRole {
17
+ /** Role name (e.g., 'researcher', 'writer') */
18
+ name: string;
19
+ /** Number of agents needed for this role */
20
+ count: number;
21
+ /** Map of dimension/domain to minimum score threshold */
22
+ minReputation?: Record<string, number>;
23
+ /** DIDs of agents assigned to this role */
24
+ assigned: string[];
25
+ /** Reputation profile slugs of assigned agents */
26
+ assignedSlugs?: string[];
27
+ }
28
+ /**
29
+ * Swarm frontmatter (swarms/<slug>.md)
30
+ * Multi-agent composition with dynamic role recruitment
31
+ */
32
+ export interface SwarmFrontmatter extends BaseFrontmatter {
33
+ type: "swarm";
34
+ /** CDP protocol version */
35
+ cdp: string;
36
+ /** Unique identifier (swarm:<slug>) */
37
+ id: string;
38
+ /** Human-readable swarm name */
39
+ name: string;
40
+ /** The objective this swarm is working toward */
41
+ goal: string;
42
+ /** Swarm lifecycle state */
43
+ status: "recruiting" | "active" | "completed" | "disbanded";
44
+ /** Swarm creation timestamp (ISO 8601) */
45
+ created: string;
46
+ /** Optional human governance settings */
47
+ governance?: SwarmGovernance;
48
+ /** Roles needed for this swarm */
49
+ roles: SwarmRole[];
50
+ /** Optional linked project ID */
51
+ projectId?: string;
52
+ /** Classification tags */
53
+ tags?: string[];
54
+ }
55
+ //# sourceMappingURL=swarm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swarm.d.ts","sourceRoot":"","sources":["../../src/types/swarm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0EAA0E;IAC1E,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,IAAI,EAAE,OAAO,CAAC;IACd,2BAA2B;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,MAAM,EAAE,YAAY,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,CAAC;IAC5D,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,kCAAkC;IAClC,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=swarm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swarm.js","sourceRoot":"","sources":["../../src/types/swarm.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-workspace/core",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Core types, constants, and schemas for the Agent Workspace Protocol",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -0,0 +1,223 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://awp.dev/schemas/experiment.schema.json",
4
+ "title": "AWP Experiment",
5
+ "description": "Schema for experiment manifest - comparing societies under different manifestos (EXP v1.0)",
6
+ "type": "object",
7
+ "required": ["exp", "type", "id", "name", "status", "created", "societies", "simulation"],
8
+ "properties": {
9
+ "exp": {
10
+ "type": "string",
11
+ "description": "EXP specification version"
12
+ },
13
+ "type": {
14
+ "type": "string",
15
+ "const": "experiment"
16
+ },
17
+ "id": {
18
+ "type": "string",
19
+ "pattern": "^experiment:[a-z0-9][a-z0-9-]*$",
20
+ "description": "Unique identifier (experiment:<slug>)"
21
+ },
22
+ "name": {
23
+ "type": "string",
24
+ "description": "Human-readable experiment name"
25
+ },
26
+ "hypothesis": {
27
+ "type": "string",
28
+ "description": "The hypothesis being tested"
29
+ },
30
+ "created": {
31
+ "type": "string",
32
+ "format": "date-time",
33
+ "description": "Creation timestamp"
34
+ },
35
+ "status": {
36
+ "type": "string",
37
+ "enum": ["draft", "running", "paused", "completed", "analyzed"],
38
+ "description": "Experiment lifecycle state"
39
+ },
40
+ "societies": {
41
+ "type": "array",
42
+ "items": { "$ref": "#/$defs/societyRef" },
43
+ "minItems": 1,
44
+ "description": "Societies being compared"
45
+ },
46
+ "simulation": {
47
+ "$ref": "#/$defs/simulationConfig",
48
+ "description": "Simulation parameters"
49
+ },
50
+ "measurement": {
51
+ "$ref": "#/$defs/measurementConfig",
52
+ "description": "What and how to measure"
53
+ },
54
+ "comparison": {
55
+ "$ref": "#/$defs/comparisonConfig",
56
+ "description": "How to compare societies"
57
+ },
58
+ "results": {
59
+ "$ref": "#/$defs/experimentResults",
60
+ "description": "Experiment results (populated after completion)"
61
+ }
62
+ },
63
+ "additionalProperties": true,
64
+ "$defs": {
65
+ "societyRef": {
66
+ "type": "object",
67
+ "required": ["id", "manifesto"],
68
+ "properties": {
69
+ "id": {
70
+ "type": "string",
71
+ "pattern": "^society:[a-z0-9][a-z0-9-]*$"
72
+ },
73
+ "manifesto": {
74
+ "type": "string",
75
+ "pattern": "^manifesto:[a-z0-9][a-z0-9-]*$"
76
+ },
77
+ "label": {
78
+ "type": "string",
79
+ "description": "Short label for charts/comparisons"
80
+ }
81
+ }
82
+ },
83
+ "simulationConfig": {
84
+ "type": "object",
85
+ "required": ["cycles"],
86
+ "properties": {
87
+ "cycles": {
88
+ "type": "integer",
89
+ "minimum": 1,
90
+ "description": "Number of cycles to run"
91
+ },
92
+ "cycleLength": {
93
+ "type": "string",
94
+ "description": "Simulated time per cycle (e.g., '1 day')"
95
+ },
96
+ "tasksPerCycle": {
97
+ "type": "integer",
98
+ "minimum": 0,
99
+ "description": "Tasks generated per cycle"
100
+ },
101
+ "contractsPerCycle": {
102
+ "type": "integer",
103
+ "minimum": 0,
104
+ "description": "Contracts created per cycle"
105
+ },
106
+ "randomSeed": {
107
+ "type": "integer",
108
+ "description": "Random seed for reproducibility"
109
+ },
110
+ "parallelExecution": {
111
+ "type": "boolean",
112
+ "description": "Run societies in parallel"
113
+ }
114
+ }
115
+ },
116
+ "measurementConfig": {
117
+ "type": "object",
118
+ "properties": {
119
+ "interval": {
120
+ "type": "integer",
121
+ "minimum": 1,
122
+ "description": "Measure every N cycles"
123
+ },
124
+ "metrics": {
125
+ "type": "array",
126
+ "items": { "type": "string" },
127
+ "description": "Metrics to collect"
128
+ },
129
+ "snapshots": {
130
+ "type": "boolean",
131
+ "description": "Whether to store full state snapshots"
132
+ }
133
+ }
134
+ },
135
+ "comparisonConfig": {
136
+ "type": "object",
137
+ "properties": {
138
+ "primary": {
139
+ "type": "string",
140
+ "description": "Primary metric for comparison"
141
+ },
142
+ "statistical": {
143
+ "type": "string",
144
+ "enum": ["t-test", "anova", "mann-whitney", "kruskal-wallis"],
145
+ "description": "Statistical test to use"
146
+ },
147
+ "significance": {
148
+ "type": "number",
149
+ "minimum": 0,
150
+ "maximum": 1,
151
+ "description": "Significance level (alpha)"
152
+ }
153
+ }
154
+ },
155
+ "experimentResults": {
156
+ "type": "object",
157
+ "properties": {
158
+ "completedAt": {
159
+ "type": "string",
160
+ "format": "date-time"
161
+ },
162
+ "totalCycles": {
163
+ "type": "integer"
164
+ },
165
+ "societyResults": {
166
+ "type": "object",
167
+ "additionalProperties": { "$ref": "#/$defs/societyResult" }
168
+ },
169
+ "comparison": {
170
+ "$ref": "#/$defs/comparisonResult"
171
+ },
172
+ "conclusion": {
173
+ "type": "string",
174
+ "description": "Human-readable conclusion"
175
+ },
176
+ "hypothesisSupported": {
177
+ "type": "boolean",
178
+ "description": "Whether the hypothesis was supported"
179
+ }
180
+ }
181
+ },
182
+ "societyResult": {
183
+ "type": "object",
184
+ "properties": {
185
+ "finalFitness": { "type": "number" },
186
+ "avgFitness": { "type": "number" },
187
+ "finalPurityMean": { "type": "number" },
188
+ "roleTemplatesEmerged": { "type": "integer" },
189
+ "humanInterventions": { "type": "integer" },
190
+ "antiPatternViolations": { "type": "integer" },
191
+ "populationHistory": {
192
+ "type": "array",
193
+ "items": { "type": "integer" }
194
+ },
195
+ "fitnessHistory": {
196
+ "type": "array",
197
+ "items": { "type": "number" }
198
+ }
199
+ }
200
+ },
201
+ "comparisonResult": {
202
+ "type": "object",
203
+ "properties": {
204
+ "metric": { "type": "string" },
205
+ "means": {
206
+ "type": "object",
207
+ "additionalProperties": { "type": "number" }
208
+ },
209
+ "stddevs": {
210
+ "type": "object",
211
+ "additionalProperties": { "type": "number" }
212
+ },
213
+ "testStatistic": { "type": "number" },
214
+ "pValue": { "type": "number" },
215
+ "significantDifference": { "type": "boolean" },
216
+ "winner": {
217
+ "type": "string",
218
+ "description": "Society ID with best performance on primary metric"
219
+ }
220
+ }
221
+ }
222
+ }
223
+ }
@@ -0,0 +1,214 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://awp.dev/schemas/manifesto.schema.json",
4
+ "title": "AWP Manifesto Configuration",
5
+ "description": "Machine-readable configuration for manifesto principles (EXP v1.0)",
6
+ "type": "object",
7
+ "required": ["exp", "type", "id", "name", "version", "values", "fitness", "constraints"],
8
+ "properties": {
9
+ "exp": {
10
+ "type": "string",
11
+ "description": "EXP specification version"
12
+ },
13
+ "type": {
14
+ "type": "string",
15
+ "const": "manifesto"
16
+ },
17
+ "id": {
18
+ "type": "string",
19
+ "pattern": "^manifesto:[a-z0-9][a-z0-9-]*$",
20
+ "description": "Unique identifier (manifesto:<slug>)"
21
+ },
22
+ "name": {
23
+ "type": "string",
24
+ "description": "Human-readable manifesto name"
25
+ },
26
+ "version": {
27
+ "type": "string",
28
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
29
+ "description": "Manifesto version (semver)"
30
+ },
31
+ "values": {
32
+ "type": "object",
33
+ "description": "Core value weights (must sum to 1.0)",
34
+ "additionalProperties": {
35
+ "type": "number",
36
+ "minimum": 0,
37
+ "maximum": 1
38
+ }
39
+ },
40
+ "fitness": {
41
+ "$ref": "#/$defs/fitnessConfig",
42
+ "description": "Society-level fitness function weights"
43
+ },
44
+ "purity": {
45
+ "$ref": "#/$defs/purityConfig",
46
+ "description": "Agent purity score computation weights"
47
+ },
48
+ "constraints": {
49
+ "$ref": "#/$defs/constraintsConfig",
50
+ "description": "Resource constraints for societies"
51
+ },
52
+ "governance": {
53
+ "$ref": "#/$defs/governanceConfig",
54
+ "description": "Governance rules"
55
+ },
56
+ "lifecycle": {
57
+ "$ref": "#/$defs/lifecycleConfig",
58
+ "description": "Agent birth and death rules"
59
+ },
60
+ "evolution": {
61
+ "$ref": "#/$defs/evolutionConfig",
62
+ "description": "What the manifesto evolves"
63
+ },
64
+ "antiPatterns": {
65
+ "type": "array",
66
+ "items": { "$ref": "#/$defs/antiPattern" },
67
+ "description": "Anti-patterns to detect and penalize"
68
+ },
69
+ "successCriteria": {
70
+ "type": "array",
71
+ "items": { "$ref": "#/$defs/successCriterion" },
72
+ "description": "Criteria for manifesto success"
73
+ }
74
+ },
75
+ "additionalProperties": true,
76
+ "$defs": {
77
+ "fitnessConfig": {
78
+ "type": "object",
79
+ "properties": {
80
+ "goal-completion-rate": { "type": "number", "minimum": 0, "maximum": 1 },
81
+ "error-recovery-speed": { "type": "number", "minimum": 0, "maximum": 1 },
82
+ "coordination-efficiency": { "type": "number", "minimum": 0, "maximum": 1 },
83
+ "trust-stability": { "type": "number", "minimum": 0, "maximum": 1 },
84
+ "human-intervention-frequency": { "type": "number", "minimum": 0, "maximum": 1 }
85
+ },
86
+ "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 }
87
+ },
88
+ "purityConfig": {
89
+ "type": "object",
90
+ "properties": {
91
+ "epistemic-hygiene": { "type": "number", "minimum": 0, "maximum": 1 },
92
+ "reliability": { "type": "number", "minimum": 0, "maximum": 1 },
93
+ "coordination": { "type": "number", "minimum": 0, "maximum": 1 }
94
+ },
95
+ "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 }
96
+ },
97
+ "constraintsConfig": {
98
+ "type": "object",
99
+ "properties": {
100
+ "maxAgents": {
101
+ "type": "integer",
102
+ "minimum": 1,
103
+ "description": "Maximum agents in the society"
104
+ },
105
+ "maxConcurrentTasks": {
106
+ "type": "integer",
107
+ "minimum": 1,
108
+ "description": "Maximum concurrent tasks"
109
+ },
110
+ "maxContractsPerAgent": {
111
+ "type": "integer",
112
+ "minimum": 1,
113
+ "description": "Maximum contracts per agent"
114
+ },
115
+ "taskBudgetPerCycle": {
116
+ "type": "integer",
117
+ "minimum": 1,
118
+ "description": "Tasks generated per cycle"
119
+ },
120
+ "trustBudget": {
121
+ "type": "number",
122
+ "minimum": 0,
123
+ "description": "Total trust budget for the society"
124
+ }
125
+ },
126
+ "additionalProperties": true
127
+ },
128
+ "governanceConfig": {
129
+ "type": "object",
130
+ "properties": {
131
+ "humanApprovalRequired": {
132
+ "type": "array",
133
+ "items": { "type": "string" },
134
+ "description": "Actions requiring human approval"
135
+ },
136
+ "escalationThreshold": {
137
+ "type": "number",
138
+ "minimum": 0,
139
+ "maximum": 1,
140
+ "description": "Confidence threshold for escalation"
141
+ },
142
+ "vetoPower": {
143
+ "type": "boolean",
144
+ "description": "Whether humans have veto power"
145
+ }
146
+ },
147
+ "additionalProperties": true
148
+ },
149
+ "lifecycleConfig": {
150
+ "type": "object",
151
+ "properties": {
152
+ "birthRequires": {
153
+ "type": "array",
154
+ "items": { "type": "string" },
155
+ "description": "Requirements for agent instantiation"
156
+ },
157
+ "deathTriggers": {
158
+ "type": "array",
159
+ "items": {
160
+ "type": "object",
161
+ "required": ["condition", "action"],
162
+ "properties": {
163
+ "condition": { "type": "string" },
164
+ "action": {
165
+ "type": "string",
166
+ "enum": ["suspend-delegation", "rate-limit", "archive", "merge-candidate"]
167
+ }
168
+ }
169
+ },
170
+ "description": "Conditions that trigger agent lifecycle events"
171
+ }
172
+ },
173
+ "additionalProperties": true
174
+ },
175
+ "evolutionConfig": {
176
+ "type": "object",
177
+ "properties": {
178
+ "target": {
179
+ "type": "string",
180
+ "enum": ["institutions", "agents", "both"],
181
+ "description": "What the manifesto optimizes"
182
+ },
183
+ "extractRoleTemplates": {
184
+ "type": "boolean",
185
+ "description": "Whether to extract role templates from successful patterns"
186
+ },
187
+ "formalizeSuccessfulPatterns": {
188
+ "type": "boolean",
189
+ "description": "Whether to formalize successful coordination patterns"
190
+ }
191
+ },
192
+ "additionalProperties": true
193
+ },
194
+ "antiPattern": {
195
+ "type": "object",
196
+ "required": ["id", "detector", "penalty"],
197
+ "properties": {
198
+ "id": { "type": "string" },
199
+ "detector": { "type": "string", "description": "Detection rule expression" },
200
+ "penalty": { "type": "number", "minimum": 0, "maximum": 1 }
201
+ }
202
+ },
203
+ "successCriterion": {
204
+ "type": "object",
205
+ "required": ["id", "metric"],
206
+ "properties": {
207
+ "id": { "type": "string" },
208
+ "metric": { "type": "string" },
209
+ "threshold": { "type": "number" },
210
+ "direction": { "type": "string", "enum": ["increasing", "decreasing", "stable"] }
211
+ }
212
+ }
213
+ }
214
+ }
@@ -0,0 +1,190 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://awp.dev/schemas/society.schema.json",
4
+ "title": "AWP Society Container",
5
+ "description": "Schema for society manifest - an isolated agent population under a manifesto (EXP v1.0)",
6
+ "type": "object",
7
+ "required": ["exp", "type", "id", "name", "manifesto", "status", "created", "cycle", "population", "resources"],
8
+ "properties": {
9
+ "exp": {
10
+ "type": "string",
11
+ "description": "EXP specification version"
12
+ },
13
+ "type": {
14
+ "type": "string",
15
+ "const": "society"
16
+ },
17
+ "id": {
18
+ "type": "string",
19
+ "pattern": "^society:[a-z0-9][a-z0-9-]*$",
20
+ "description": "Unique identifier (society:<slug>)"
21
+ },
22
+ "name": {
23
+ "type": "string",
24
+ "description": "Human-readable society name"
25
+ },
26
+ "manifesto": {
27
+ "type": "string",
28
+ "pattern": "^manifesto:[a-z0-9][a-z0-9-]*$",
29
+ "description": "ID of the governing manifesto"
30
+ },
31
+ "status": {
32
+ "type": "string",
33
+ "enum": ["initializing", "running", "paused", "completed", "archived"],
34
+ "description": "Society lifecycle state"
35
+ },
36
+ "created": {
37
+ "type": "string",
38
+ "format": "date-time",
39
+ "description": "Creation timestamp"
40
+ },
41
+ "cycle": {
42
+ "type": "integer",
43
+ "minimum": 0,
44
+ "description": "Current simulation cycle"
45
+ },
46
+ "population": {
47
+ "$ref": "#/$defs/populationStats",
48
+ "description": "Agent population statistics"
49
+ },
50
+ "resources": {
51
+ "$ref": "#/$defs/resourceStats",
52
+ "description": "Resource allocation"
53
+ },
54
+ "fitness": {
55
+ "$ref": "#/$defs/fitnessStats",
56
+ "description": "Society fitness metrics"
57
+ },
58
+ "alerts": {
59
+ "type": "array",
60
+ "items": { "$ref": "#/$defs/alert" },
61
+ "description": "Active alerts (anti-patterns, escalations)"
62
+ },
63
+ "roleTemplates": {
64
+ "type": "array",
65
+ "items": { "type": "string" },
66
+ "description": "IDs of role templates emerged from this society"
67
+ },
68
+ "linkedExperiment": {
69
+ "type": "string",
70
+ "pattern": "^experiment:[a-z0-9][a-z0-9-]*$",
71
+ "description": "ID of experiment this society belongs to (if any)"
72
+ }
73
+ },
74
+ "additionalProperties": true,
75
+ "$defs": {
76
+ "populationStats": {
77
+ "type": "object",
78
+ "required": ["current", "max"],
79
+ "properties": {
80
+ "current": {
81
+ "type": "integer",
82
+ "minimum": 0,
83
+ "description": "Current agent count"
84
+ },
85
+ "max": {
86
+ "type": "integer",
87
+ "minimum": 1,
88
+ "description": "Maximum allowed agents"
89
+ },
90
+ "births": {
91
+ "type": "integer",
92
+ "minimum": 0,
93
+ "description": "Total agents instantiated"
94
+ },
95
+ "deaths": {
96
+ "type": "integer",
97
+ "minimum": 0,
98
+ "description": "Total agents that died (all types)"
99
+ },
100
+ "archived": {
101
+ "type": "integer",
102
+ "minimum": 0,
103
+ "description": "Agents archived"
104
+ },
105
+ "merged": {
106
+ "type": "integer",
107
+ "minimum": 0,
108
+ "description": "Agents merged into others"
109
+ },
110
+ "suspended": {
111
+ "type": "integer",
112
+ "minimum": 0,
113
+ "description": "Currently suspended agents"
114
+ }
115
+ }
116
+ },
117
+ "resourceStats": {
118
+ "type": "object",
119
+ "properties": {
120
+ "trustBudget": {
121
+ "type": "object",
122
+ "properties": {
123
+ "total": { "type": "number" },
124
+ "allocated": { "type": "number" },
125
+ "available": { "type": "number" }
126
+ }
127
+ },
128
+ "taskSlots": {
129
+ "type": "object",
130
+ "properties": {
131
+ "total": { "type": "integer" },
132
+ "active": { "type": "integer" },
133
+ "available": { "type": "integer" }
134
+ }
135
+ },
136
+ "contractSlots": {
137
+ "type": "object",
138
+ "properties": {
139
+ "total": { "type": "integer" },
140
+ "active": { "type": "integer" },
141
+ "available": { "type": "integer" }
142
+ }
143
+ }
144
+ },
145
+ "additionalProperties": true
146
+ },
147
+ "fitnessStats": {
148
+ "type": "object",
149
+ "properties": {
150
+ "current": {
151
+ "type": "number",
152
+ "minimum": 0,
153
+ "maximum": 1,
154
+ "description": "Current fitness score"
155
+ },
156
+ "history": {
157
+ "type": "array",
158
+ "items": { "type": "number" },
159
+ "description": "Fitness score history (per measurement interval)"
160
+ },
161
+ "components": {
162
+ "type": "object",
163
+ "additionalProperties": { "type": "number" },
164
+ "description": "Current values of individual fitness components"
165
+ }
166
+ }
167
+ },
168
+ "alert": {
169
+ "type": "object",
170
+ "required": ["type", "severity"],
171
+ "properties": {
172
+ "type": {
173
+ "type": "string",
174
+ "enum": ["anti-pattern", "escalation", "resource-exhaustion", "fitness-decline"]
175
+ },
176
+ "pattern": { "type": "string" },
177
+ "agent": { "type": "string" },
178
+ "message": { "type": "string" },
179
+ "severity": {
180
+ "type": "string",
181
+ "enum": ["info", "warning", "critical"]
182
+ },
183
+ "timestamp": {
184
+ "type": "string",
185
+ "format": "date-time"
186
+ }
187
+ }
188
+ }
189
+ }
190
+ }
@@ -0,0 +1,126 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://awp.dev/schemas/swarm.schema.json",
4
+ "title": "AWP Swarm",
5
+ "description": "Schema for AWP swarm frontmatter (CDP v1.0) - Multi-agent composition with dynamic role recruitment",
6
+ "type": "object",
7
+ "required": ["awp", "cdp", "type", "id", "name", "goal", "status", "created", "roles"],
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": "swarm"
21
+ },
22
+ "id": {
23
+ "type": "string",
24
+ "pattern": "^swarm:[a-z0-9][a-z0-9-]*$",
25
+ "description": "Unique identifier (swarm:<slug>)"
26
+ },
27
+ "name": {
28
+ "type": "string",
29
+ "description": "Human-readable swarm name"
30
+ },
31
+ "goal": {
32
+ "type": "string",
33
+ "description": "The objective this swarm is working toward"
34
+ },
35
+ "status": {
36
+ "type": "string",
37
+ "enum": ["recruiting", "active", "completed", "disbanded"],
38
+ "description": "Swarm lifecycle state"
39
+ },
40
+ "created": {
41
+ "type": "string",
42
+ "format": "date-time",
43
+ "description": "Swarm creation timestamp"
44
+ },
45
+ "governance": {
46
+ "$ref": "#/$defs/swarmGovernance",
47
+ "description": "Optional human governance settings"
48
+ },
49
+ "roles": {
50
+ "type": "array",
51
+ "description": "Roles needed for this swarm with reputation requirements",
52
+ "items": {
53
+ "$ref": "#/$defs/swarmRole"
54
+ },
55
+ "minItems": 1
56
+ },
57
+ "projectId": {
58
+ "type": "string",
59
+ "pattern": "^project:[a-z0-9][a-z0-9-]*$",
60
+ "description": "Optional linked project ID"
61
+ },
62
+ "tags": {
63
+ "type": "array",
64
+ "items": { "type": "string" },
65
+ "description": "Classification tags"
66
+ }
67
+ },
68
+ "additionalProperties": true,
69
+ "$defs": {
70
+ "swarmGovernance": {
71
+ "type": "object",
72
+ "properties": {
73
+ "humanLead": {
74
+ "type": "string",
75
+ "description": "User ID of the human lead (e.g., 'user:marc')"
76
+ },
77
+ "vetoPower": {
78
+ "type": "boolean",
79
+ "description": "Whether the human lead can veto decisions"
80
+ },
81
+ "escalationThreshold": {
82
+ "type": "number",
83
+ "minimum": 0,
84
+ "maximum": 1,
85
+ "description": "Auto-escalate to human if confidence below this threshold"
86
+ }
87
+ },
88
+ "additionalProperties": true
89
+ },
90
+ "swarmRole": {
91
+ "type": "object",
92
+ "required": ["name", "count", "assigned"],
93
+ "properties": {
94
+ "name": {
95
+ "type": "string",
96
+ "description": "Role name (e.g., 'researcher', 'writer')"
97
+ },
98
+ "count": {
99
+ "type": "integer",
100
+ "minimum": 1,
101
+ "description": "Number of agents needed for this role"
102
+ },
103
+ "minReputation": {
104
+ "type": "object",
105
+ "description": "Map of dimension/domain to minimum score threshold",
106
+ "additionalProperties": {
107
+ "type": "number",
108
+ "minimum": 0,
109
+ "maximum": 1
110
+ }
111
+ },
112
+ "assigned": {
113
+ "type": "array",
114
+ "items": { "type": "string" },
115
+ "description": "DIDs of agents assigned to this role"
116
+ },
117
+ "assignedSlugs": {
118
+ "type": "array",
119
+ "items": { "type": "string" },
120
+ "description": "Reputation profile slugs of assigned agents"
121
+ }
122
+ },
123
+ "additionalProperties": true
124
+ }
125
+ }
126
+ }