@rolexjs/prototype 1.4.0-dev-20260304140703 → 1.4.0-dev-20260305002626

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/index.d.ts CHANGED
@@ -1,7 +1,31 @@
1
+ import { PrototypeData, PrototypeRepository } from '@rolexjs/core';
1
2
  import { State, Runtime, Structure } from '@rolexjs/system';
2
3
  import { IssueX } from 'issuexjs';
3
4
  import { ResourceX } from 'resourcexjs';
4
5
 
6
+ /**
7
+ * applyPrototype — apply a prototype's migrations incrementally.
8
+ *
9
+ * Pure function: receives data + storage + executor, no framework coupling.
10
+ * Checks migration history, executes only unapplied migrations, records each.
11
+ */
12
+
13
+ /** Result of applying a prototype. */
14
+ interface ApplyResult {
15
+ prototypeId: string;
16
+ applied: number;
17
+ skipped: number;
18
+ upToDate: boolean;
19
+ }
20
+ /**
21
+ * Apply a prototype — execute unapplied migrations in version order.
22
+ *
23
+ * @param data - The prototype data structure with migrations
24
+ * @param repo - Storage layer for migration history
25
+ * @param direct - Executor for prototype instructions
26
+ */
27
+ declare function applyPrototype(data: PrototypeData, repo: PrototypeRepository, direct: (op: string, args: Record<string, unknown>) => Promise<unknown>): Promise<ApplyResult>;
28
+
5
29
  declare const processes: Record<string, string>;
6
30
  declare const world: Record<string, string>;
7
31
 
@@ -87,14 +111,10 @@ interface OpsContext {
87
111
  find(id: string): (Structure | null) | Promise<Structure | null>;
88
112
  resourcex?: ResourceX;
89
113
  issuex?: IssueX;
90
- prototype?: {
91
- settle(id: string, source: string): void;
92
- evict(id: string): void;
93
- list(): Record<string, string>;
94
- };
114
+ prototype?: PrototypeRepository;
95
115
  direct?(locator: string, args?: Record<string, unknown>): Promise<unknown>;
96
116
  }
97
117
  type Ops = Record<string, (...args: any[]) => any>;
98
118
  declare function createOps(ctx: OpsContext): Ops;
99
119
 
100
- export { type ArgEntry, type InstructionDef, type OpResult, type Ops, type OpsContext, type ParamDef, type ParamType, createOps, directives, instructions, processes, toArgs, world };
120
+ export { type ApplyResult, type ArgEntry, type InstructionDef, type OpResult, type Ops, type OpsContext, type ParamDef, type ParamType, applyPrototype, createOps, directives, instructions, processes, toArgs, world };
package/dist/index.js CHANGED
@@ -1,3 +1,28 @@
1
+ // src/apply.ts
2
+ async function applyPrototype(data, repo, direct) {
3
+ const sorted = [...data.migrations].sort((a, b) => a.version - b.version);
4
+ let applied = 0;
5
+ let skipped = 0;
6
+ for (const migration of sorted) {
7
+ if (await repo.hasMigration(data.id, migration.id)) {
8
+ skipped++;
9
+ continue;
10
+ }
11
+ for (const instr of migration.instructions) {
12
+ await direct(instr.op, instr.args);
13
+ }
14
+ await repo.recordMigration(data.id, migration.id, migration.version, migration.checksum);
15
+ applied++;
16
+ }
17
+ await repo.settle(data.id, data.source);
18
+ return {
19
+ prototypeId: data.id,
20
+ applied,
21
+ skipped,
22
+ upToDate: applied === 0
23
+ };
24
+ }
25
+
1
26
  // src/descriptions/index.ts
2
27
  var processes = {
3
28
  "born": "Feature: born \u2014 create a new individual\n Create a new individual with persona identity.\n The persona defines who the role is \u2014 personality, values, background.\n\n Scenario: Birth an individual\n Given a Gherkin source describing the persona\n When born is called with the source\n Then a new individual node is created in society\n And the persona is stored as the individual's information\n And the individual can be hired into organizations\n And the individual can be activated to start working\n\n Scenario: Writing the individual Gherkin\n Given the individual Feature defines a persona \u2014 who this role is\n Then the Feature title names the individual\n And the description captures personality, values, expertise, and background\n And Scenarios are optional \u2014 use them for distinct aspects of the persona",
@@ -835,18 +860,6 @@ var censusList = def(
835
860
  },
836
861
  ["type"]
837
862
  );
838
- var prototypeSettle = def(
839
- "prototype",
840
- "settle",
841
- {
842
- source: {
843
- type: "string",
844
- required: true,
845
- description: "ResourceX source \u2014 local path or locator"
846
- }
847
- },
848
- ["source"]
849
- );
850
863
  var prototypeEvict = def(
851
864
  "prototype",
852
865
  "evict",
@@ -1071,7 +1084,6 @@ var instructions = {
1071
1084
  // census
1072
1085
  "census.list": censusList,
1073
1086
  // prototype
1074
- "prototype.settle": prototypeSettle,
1075
1087
  "prototype.evict": prototypeEvict,
1076
1088
  // resource
1077
1089
  "resource.add": resourceAdd,
@@ -1489,18 +1501,6 @@ ${text}`;
1489
1501
  }
1490
1502
  return lines.join("\n");
1491
1503
  },
1492
- // ---- Prototype ----
1493
- async "prototype.settle"(source) {
1494
- const rx = requireResourceX();
1495
- if (!ctx.prototype) throw new Error("Prototype registry is not available.");
1496
- if (!ctx.direct) throw new Error("Direct dispatch is not available.");
1497
- const result = await rx.ingest(source);
1498
- for (const instr of result.instructions) {
1499
- await ctx.direct(instr.op, instr.args);
1500
- }
1501
- ctx.prototype.settle(result.id, source);
1502
- return `Prototype "${result.id}" settled (${result.instructions.length} instructions).`;
1503
- },
1504
1504
  // ---- Resource (proxy to ResourceX) ----
1505
1505
  "resource.add"(path) {
1506
1506
  return requireResourceX().add(path);
@@ -1633,6 +1633,7 @@ function renderFileTree(files, indent = "") {
1633
1633
  return lines.filter(Boolean).join("\n");
1634
1634
  }
1635
1635
  export {
1636
+ applyPrototype,
1636
1637
  createOps,
1637
1638
  directives,
1638
1639
  instructions,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/descriptions/index.ts","../src/directives/index.ts","../src/instructions.ts","../src/dispatch.ts","../src/ops.ts"],"sourcesContent":["// AUTO-GENERATED — do not edit. Run `bun run gen:desc` to regenerate.\n\nexport const processes: Record<string, string> = {\n \"born\": \"Feature: born — create a new individual\\n Create a new individual with persona identity.\\n The persona defines who the role is — personality, values, background.\\n\\n Scenario: Birth an individual\\n Given a Gherkin source describing the persona\\n When born is called with the source\\n Then a new individual node is created in society\\n And the persona is stored as the individual's information\\n And the individual can be hired into organizations\\n And the individual can be activated to start working\\n\\n Scenario: Writing the individual Gherkin\\n Given the individual Feature defines a persona — who this role is\\n Then the Feature title names the individual\\n And the description captures personality, values, expertise, and background\\n And Scenarios are optional — use them for distinct aspects of the persona\",\n \"die\": \"Feature: die — permanently remove an individual\\n Permanently remove an individual.\\n Unlike retire, this is irreversible.\\n\\n Scenario: Remove an individual permanently\\n Given an individual exists\\n When die is called on the individual\\n Then the individual and all associated data are removed\\n And this operation is irreversible\",\n \"rehire\": \"Feature: rehire — restore a retired individual\\n Rehire a retired individual.\\n Restores the individual with full history and knowledge intact.\\n\\n Scenario: Rehire an individual\\n Given a retired individual exists\\n When rehire is called on the individual\\n Then the individual is restored to active status\\n And all previous data and knowledge are intact\",\n \"retire\": \"Feature: retire — archive an individual\\n Archive an individual — deactivate but preserve all data.\\n A retired individual can be rehired later with full history intact.\\n\\n Scenario: Retire an individual\\n Given an individual exists\\n When retire is called on the individual\\n Then the individual is deactivated\\n And all data is preserved for potential restoration\\n And the individual can be rehired later\",\n \"teach\": \"Feature: teach — inject external principle\\n Directly inject a principle into an individual.\\n Unlike realize which consumes experience, teach requires no prior encounters.\\n Use teach to equip a role with a known, pre-existing principle.\\n\\n Scenario: Teach a principle\\n Given an individual exists\\n When teach is called with individual id, principle Gherkin, and a principle id\\n Then a principle is created directly under the individual\\n And no experience or encounter is consumed\\n And if a principle with the same id already exists, it is replaced\\n\\n Scenario: Principle ID convention\\n Given the id is keywords from the principle content joined by hyphens\\n Then \\\"Always validate expiry\\\" becomes id \\\"always-validate-expiry\\\"\\n And \\\"Structure first design\\\" becomes id \\\"structure-first-design\\\"\\n\\n Scenario: When to use teach vs realize\\n Given realize distills internal experience into a principle\\n And teach injects an external, pre-existing principle\\n When a role needs knowledge it has not learned through experience\\n Then use teach to inject the principle directly\\n When a role has gained experience and wants to codify it\\n Then use realize to distill it into a principle\\n\\n Scenario: Writing the principle Gherkin\\n Given the principle is the same format as realize output\\n Then the Feature title states the principle as a general rule\\n And Scenarios describe different situations where this principle applies\\n And the tone is universal — no mention of specific projects, tasks, or people\",\n \"train\": \"Feature: train — external skill injection\\n A manager or external agent equips an individual with a procedure.\\n This is an act of teaching — someone else decides what the role should know.\\n Unlike master where the role grows by its own agency, train is done to the role from outside.\\n\\n Scenario: Train a procedure\\n Given an individual exists\\n When train is called with individual id, procedure Gherkin, and a procedure id\\n Then a procedure is created directly under the individual\\n And if a procedure with the same id already exists, it is replaced\\n\\n Scenario: Procedure ID convention\\n Given the id is keywords from the procedure content joined by hyphens\\n Then \\\"Skill Creator\\\" becomes id \\\"skill-creator\\\"\\n And \\\"Role Management\\\" becomes id \\\"role-management\\\"\\n\\n Scenario: When to use train vs master\\n Given both create procedures and both can work without consuming experience\\n When the role itself decides to acquire a skill — use master (self-growth)\\n And when an external agent equips the role — use train (external injection)\\n Then the difference is perspective — who initiates the learning\\n And master belongs to the role namespace (the role's own cognition)\\n And train belongs to the individual namespace (external management)\\n\\n Scenario: Writing the procedure Gherkin\\n Given the procedure is a skill reference — same format as master output\\n Then the Feature title names the capability\\n And the description includes the locator for full skill loading\\n And Scenarios describe when and why to apply this skill\",\n \"charter\": \"Feature: charter — define organizational charter\\n Define the charter for an organization.\\n The charter describes the organization's mission, principles, and governance rules.\\n\\n Scenario: Define a charter\\n Given an organization exists\\n And a Gherkin source describing the charter\\n When charter is called on the organization\\n Then the charter is stored as the organization's information\\n\\n Scenario: Writing the charter Gherkin\\n Given the charter defines an organization's mission and governance\\n Then the Feature title names the charter or the organization it governs\\n And Scenarios describe principles, rules, or governance structures\\n And the tone is declarative — stating what the organization stands for and how it operates\",\n \"dissolve\": \"Feature: dissolve — dissolve an organization\\n Dissolve an organization.\\n All positions, charter entries, and assignments are cascaded.\\n\\n Scenario: Dissolve an organization\\n Given an organization exists\\n When dissolve is called on the organization\\n Then all positions within the organization are abolished\\n And all assignments and charter entries are removed\\n And the organization no longer exists\",\n \"fire\": \"Feature: fire — remove from an organization\\n Fire an individual from an organization.\\n The individual is dismissed from all positions and removed from the organization.\\n\\n Scenario: Fire an individual\\n Given an individual is a member of an organization\\n When fire is called with the organization and individual\\n Then the individual is dismissed from all positions\\n And the individual is removed from the organization\",\n \"found\": \"Feature: found — create a new organization\\n Found a new organization.\\n Organizations group individuals and define positions.\\n\\n Scenario: Found an organization\\n Given a Gherkin source describing the organization\\n When found is called with the source\\n Then a new organization node is created in society\\n And positions can be established within it\\n And a charter can be defined for it\\n And individuals can be hired into it\\n\\n Scenario: Writing the organization Gherkin\\n Given the organization Feature describes the group's purpose and structure\\n Then the Feature title names the organization\\n And the description captures mission, domain, and scope\\n And Scenarios are optional — use them for distinct organizational concerns\",\n \"hire\": \"Feature: hire — hire into an organization\\n Hire an individual into an organization as a member.\\n Members can then be appointed to positions.\\n\\n Scenario: Hire an individual\\n Given an organization and an individual exist\\n When hire is called with the organization and individual\\n Then the individual becomes a member of the organization\\n And the individual can be appointed to positions within the organization\",\n \"abolish\": \"Feature: abolish — abolish a position\\n Abolish a position.\\n All duties and appointments associated with the position are removed.\\n\\n Scenario: Abolish a position\\n Given a position exists\\n When abolish is called on the position\\n Then all duties and appointments are removed\\n And the position no longer exists\",\n \"appoint\": \"Feature: appoint — assign to a position\\n Appoint an individual to a position.\\n The individual must be a member of the organization.\\n\\n Scenario: Appoint an individual\\n Given an individual is a member of an organization\\n And a position exists within the organization\\n When appoint is called with the position and individual\\n Then the individual holds the position\\n And the individual inherits the position's duties\",\n \"charge\": \"Feature: charge — assign duty to a position\\n Assign a duty to a position.\\n Duties describe the responsibilities and expectations of a position.\\n\\n Scenario: Charge a position with duty\\n Given a position exists within an organization\\n And a Gherkin source describing the duty\\n When charge is called on the position with a duty id\\n Then the duty is stored as the position's information\\n And individuals appointed to this position inherit the duty\\n\\n Scenario: Duty ID convention\\n Given the id is keywords from the duty content joined by hyphens\\n Then \\\"Design systems\\\" becomes id \\\"design-systems\\\"\\n And \\\"Review pull requests\\\" becomes id \\\"review-pull-requests\\\"\\n\\n Scenario: Writing the duty Gherkin\\n Given the duty defines responsibilities for a position\\n Then the Feature title names the duty or responsibility\\n And Scenarios describe specific obligations, deliverables, or expectations\\n And the tone is prescriptive — what must be done, not what could be done\",\n \"dismiss\": \"Feature: dismiss — remove from a position\\n Dismiss an individual from a position.\\n The individual remains a member of the organization.\\n\\n Scenario: Dismiss an individual\\n Given an individual holds a position\\n When dismiss is called with the position and individual\\n Then the individual no longer holds the position\\n And the individual remains a member of the organization\\n And the position is now vacant\",\n \"establish\": \"Feature: establish — create a position\\n Create a position as an independent entity.\\n Positions define roles and can be charged with duties.\\n\\n Scenario: Establish a position\\n Given a Gherkin source describing the position\\n When establish is called with the position content\\n Then a new position entity is created\\n And the position can be charged with duties\\n And individuals can be appointed to it\\n\\n Scenario: Writing the position Gherkin\\n Given the position Feature describes a role\\n Then the Feature title names the position\\n And the description captures responsibilities, scope, and expectations\\n And Scenarios are optional — use them for distinct aspects of the role\",\n \"settle\": \"Feature: settle — register a prototype into the world\\n Pull a prototype from a ResourceX source and register it locally.\\n Once settled, the prototype can be used to create individuals or organizations.\\n\\n Scenario: Settle a prototype\\n Given a valid ResourceX source exists (URL, path, or locator)\\n When settle is called with the source\\n Then the resource is ingested and its state is extracted\\n And the prototype is registered locally by its id\\n And the prototype is available for born, activate, and organizational use\",\n \"abandon\": \"Feature: abandon — abandon a plan\\n Mark a plan as dropped and create an encounter.\\n Call this when a plan's strategy is no longer viable. Even failed plans produce learning.\\n\\n Scenario: Abandon a plan\\n Given a focused plan exists\\n And the plan's strategy is no longer viable\\n When abandon is called\\n Then the plan is tagged #abandoned and stays in the tree\\n And an encounter is created under the role\\n And the encounter can be reflected on — failure is also learning\\n\\n Scenario: Writing the encounter Gherkin\\n Given the encounter records what happened — even failure is a raw experience\\n Then the Feature title describes what was attempted and why it was abandoned\\n And Scenarios capture what was tried, what went wrong, and what was learned\\n And the tone is concrete and honest — failure produces the richest encounters\",\n \"activate\": \"Feature: activate — enter a role\\n Project the individual's full state including identity, goals,\\n and organizational context. This is the entry point for working as a role.\\n\\n Scenario: Activate an individual\\n Given an individual exists in society\\n When activate is called with the individual reference\\n Then the full state tree is projected\\n And identity, goals, and organizational context are loaded\\n And the individual becomes the active role\",\n \"complete\": \"Feature: complete — complete a plan\\n Mark a plan as done and create an encounter.\\n Call this when all tasks in the plan are finished and the strategy succeeded.\\n\\n Scenario: Complete a plan\\n Given a focused plan exists\\n And its tasks are done\\n When complete is called\\n Then the plan is tagged #done and stays in the tree\\n And an encounter is created under the role\\n And the encounter can be reflected on for learning\\n\\n Scenario: Writing the encounter Gherkin\\n Given the encounter records what happened — a raw account of the experience\\n Then the Feature title describes what was accomplished by this plan\\n And Scenarios capture what the strategy was, what worked, and what resulted\\n And the tone is concrete and specific — tied to this particular plan\",\n \"direct\": \"Feature: direct — stateless world-level executor\\n Execute commands and load resources without an active role.\\n Direct operates as an anonymous observer — no role identity, no role context.\\n For operations as an active role, use the use tool instead.\\n\\n Scenario: When to use \\\"direct\\\" vs \\\"use\\\"\\n Given no role is activated — I am an observer\\n When I need to query or operate on the world\\n Then direct is the right tool\\n And once a role is activated, use the use tool for role-level actions\\n\\n Scenario: Execute a RoleX command\\n Given the locator starts with `!`\\n When direct is called with the locator and named args\\n Then the command is parsed as `namespace.method`\\n And dispatched to the corresponding RoleX API\\n\\n Scenario: Load a ResourceX resource\\n Given the locator does not start with `!`\\n When direct is called with the locator\\n Then the locator is passed to ResourceX for resolution\\n And the resource is loaded and returned\",\n \"finish\": \"Feature: finish — complete a task\\n Mark a task as done and create an encounter.\\n The encounter records what happened and can be reflected on for learning.\\n\\n Scenario: Finish a task\\n Given a task exists\\n When finish is called on the task\\n Then the task is tagged #done and stays in the tree\\n And an encounter is created under the role\\n\\n Scenario: Finish with experience\\n Given a task is completed with a notable learning\\n When finish is called with an optional experience parameter\\n Then the experience text is attached to the encounter\\n\\n Scenario: Finish without encounter\\n Given a task is completed with no notable learning\\n When finish is called without the encounter parameter\\n Then the task is tagged #done but no encounter is created\\n And the task stays in the tree — visible via focus on the parent goal\\n\\n Scenario: Writing the encounter Gherkin\\n Given the encounter records what happened — a raw account of the experience\\n Then the Feature title describes what was done\\n And Scenarios capture what was done, what was encountered, and what resulted\\n And the tone is concrete and specific — tied to this particular task\",\n \"focus\": \"Feature: focus — view or switch focused goal\\n View the current goal's state, or switch focus to a different goal.\\n Subsequent plan and todo operations target the focused goal.\\n Only goal ids are accepted — plan, task, or other node types are rejected.\\n\\n Scenario: View current goal\\n Given an active goal exists\\n When focus is called without a name\\n Then the current goal's state tree is projected\\n And plans and tasks under the goal are visible\\n\\n Scenario: Switch focus\\n Given multiple goals exist\\n When focus is called with a goal id\\n Then the focused goal switches to the named goal\\n And subsequent plan and todo operations target this goal\\n\\n Scenario: Reject non-goal ids\\n Given a plan or task id is passed to focus\\n Then focus returns an error indicating the node type\\n And suggests using the correct goal id instead\",\n \"forget\": \"Feature: forget — remove a node from the individual\\n Remove any node under the individual by its id.\\n Use forget to discard outdated knowledge, stale encounters, or obsolete skills.\\n\\n Scenario: Forget a node\\n Given a node exists under the individual (principle, procedure, experience, encounter, etc.)\\n When forget is called with the node's id\\n Then the node and its subtree are removed\\n And the individual no longer carries that knowledge or record\\n\\n Scenario: When to use forget\\n Given a principle has become outdated or incorrect\\n And a procedure references a skill that no longer exists\\n And an encounter or experience has no further learning value\\n When the role decides to discard it\\n Then call forget with the node id\",\n \"master\": \"Feature: master — self-mastery of a procedure\\n The role masters a procedure through its own agency.\\n This is an act of self-growth — the role decides to acquire or codify a skill.\\n Experience can be consumed as the source, or the role can master directly from external information.\\n\\n Scenario: Master from experience\\n Given an experience exists from reflection\\n When master is called with experience ids\\n Then the experience is consumed\\n And a procedure is created under the individual\\n\\n Scenario: Master directly\\n Given the role encounters external information worth mastering\\n When master is called without experience ids\\n Then a procedure is created under the individual\\n And no experience is consumed\\n\\n Scenario: Procedure ID convention\\n Given the id is keywords from the procedure content joined by hyphens\\n Then \\\"JWT mastery\\\" becomes id \\\"jwt-mastery\\\"\\n And \\\"Cross-package refactoring\\\" becomes id \\\"cross-package-refactoring\\\"\\n\\n Scenario: Writing the procedure Gherkin\\n Given a procedure is skill metadata — a reference to full skill content\\n Then the Feature title names the capability\\n And the description includes the locator for full skill loading\\n And Scenarios describe when and why to apply this skill\\n And the tone is referential — pointing to the full skill, not containing it\",\n \"plan\": \"Feature: plan — create a plan for a goal\\n Break a goal into logical phases or stages.\\n Each phase is described as a Gherkin scenario. Tasks are created under the plan.\\n\\n A plan serves two purposes depending on how it relates to other plans:\\n - Strategy (alternative): Plan A fails → abandon → try Plan B (fallback)\\n - Phase (sequential): Plan A completes → start Plan B (after)\\n\\n Scenario: Create a plan\\n Given a focused goal exists\\n And a Gherkin source describing the plan phases\\n When plan is called with an id and the source\\n Then a new plan node is created under the goal\\n And the plan becomes the focused plan\\n And tasks can be added to this plan with todo\\n\\n Scenario: Sequential relationship — phase\\n Given a goal needs to be broken into ordered stages\\n When creating Plan B with after set to Plan A's id\\n Then Plan B is linked as coming after Plan A\\n And AI knows to start Plan B when Plan A completes\\n And the relationship persists across sessions\\n\\n Scenario: Alternative relationship — strategy\\n Given a goal has multiple possible approaches\\n When creating Plan B with fallback set to Plan A's id\\n Then Plan B is linked as a backup for Plan A\\n And AI knows to try Plan B when Plan A is abandoned\\n And the relationship persists across sessions\\n\\n Scenario: No relationship — independent plan\\n Given plan is created without after or fallback\\n Then it behaves as an independent plan with no links\\n And this is backward compatible with existing behavior\\n\\n Scenario: Plan ID convention\\n Given the id is keywords from the plan content joined by hyphens\\n Then \\\"Fix ID-less node creation\\\" becomes id \\\"fix-id-less-node-creation\\\"\\n And \\\"JWT authentication strategy\\\" becomes id \\\"jwt-authentication-strategy\\\"\\n\\n Scenario: Writing the plan Gherkin\\n Given the plan breaks a goal into logical phases\\n Then the Feature title names the overall approach or strategy\\n And Scenarios represent distinct phases — each phase is a stage of execution\\n And the tone is structural — ordering and grouping work, not detailing steps\",\n \"realize\": \"Feature: realize — experience to principle\\n Distill experience into a principle — a transferable piece of knowledge.\\n Principles are general truths discovered through experience.\\n\\n Scenario: Realize a principle\\n Given an experience exists from reflection\\n When realize is called with experience ids and a principle id\\n Then the experiences are consumed\\n And a principle is created under the individual\\n And the principle represents transferable, reusable understanding\\n\\n Scenario: Principle ID convention\\n Given the id is keywords from the principle content joined by hyphens\\n Then \\\"Always validate expiry\\\" becomes id \\\"always-validate-expiry\\\"\\n And \\\"Structure first design amplifies extensibility\\\" becomes id \\\"structure-first-design-amplifies-extensibility\\\"\\n\\n Scenario: Writing the principle Gherkin\\n Given a principle is a transferable truth — applicable beyond the original context\\n Then the Feature title states the principle as a general rule\\n And Scenarios describe different situations where this principle applies\\n And the tone is universal — no mention of specific projects, tasks, or people\",\n \"reflect\": \"Feature: reflect — encounter to experience\\n Consume an encounter and create an experience.\\n Experience captures what was learned in structured form.\\n This is the first step of the cognition cycle.\\n\\n Scenario: Reflect on an encounter\\n Given an encounter exists from a finished task or completed plan\\n When reflect is called with encounter ids and an experience id\\n Then the encounters are consumed\\n And an experience is created under the role\\n And the experience can be distilled into knowledge via realize or master\\n\\n Scenario: Experience ID convention\\n Given the id is keywords from the experience content joined by hyphens\\n Then \\\"Token refresh matters\\\" becomes id \\\"token-refresh-matters\\\"\\n And \\\"ID ownership determines generation strategy\\\" becomes id \\\"id-ownership-determines-generation-strategy\\\"\\n\\n Scenario: Writing the experience Gherkin\\n Given the experience captures insight — what was learned, not what was done\\n Then the Feature title names the cognitive insight or pattern discovered\\n And Scenarios describe the learning points abstracted from the concrete encounter\\n And the tone shifts from event to understanding — no longer tied to a specific task\",\n \"skill\": \"Feature: skill — load full skill content\\n Load the complete skill instructions by ResourceX locator.\\n This is progressive disclosure layer 2 — on-demand knowledge injection.\\n\\n Scenario: Load a skill\\n Given a procedure exists in the role with a locator\\n When skill is called with the locator\\n Then the full SKILL.md content is loaded via ResourceX\\n And the content is injected into the AI's context\\n And the AI can now follow the skill's detailed instructions\",\n \"todo\": \"Feature: todo — add a task to a plan\\n A task is a concrete, actionable unit of work.\\n Each task has Gherkin scenarios describing the steps and expected outcomes.\\n\\n Scenario: Create a task\\n Given a focused plan exists\\n And a Gherkin source describing the task\\n When todo is called with the source\\n Then a new task node is created under the plan\\n And the task can be finished when completed\\n\\n Scenario: Writing the task Gherkin\\n Given the task is a concrete, actionable unit of work\\n Then the Feature title names what will be done — a single deliverable\\n And Scenarios describe the steps and expected outcomes of the work\\n And the tone is actionable — clear enough that someone can start immediately\",\n \"use\": \"Feature: use — act as the current role\\n Execute commands and load resources as the active role.\\n Use requires an active role — the role is the subject performing the action.\\n For operations before activating a role, use the direct tool instead.\\n\\n Scenario: When to use \\\"use\\\" vs \\\"direct\\\"\\n Given a role is activated — I am someone\\n When I perform operations through use\\n Then the operation happens in the context of my role\\n And use is for role-level actions — acting in the world as myself\\n\\n Scenario: Execute a RoleX command\\n Given the locator starts with `!`\\n When use is called with the locator and named args\\n Then the command is parsed as `namespace.method`\\n And dispatched to the corresponding RoleX API\\n\\n Scenario: Load a ResourceX resource\\n Given the locator does not start with `!`\\n When use is called with the locator\\n Then the locator is passed to ResourceX for resolution\\n And the resource is loaded and returned\",\n \"want\": \"Feature: want — declare a goal\\n Declare a new goal for a role.\\n A goal describes a desired outcome with Gherkin scenarios as success criteria.\\n\\n Scenario: Declare a goal\\n Given an active role exists\\n And a Gherkin source describing the desired outcome\\n When want is called with the source\\n Then a new goal node is created under the role\\n And the goal becomes the current focus\\n And subsequent plan and todo operations target this goal\\n\\n Scenario: Writing the goal Gherkin\\n Given the goal describes a desired outcome — what success looks like\\n Then the Feature title names the outcome in concrete terms\\n And Scenarios define success criteria — each scenario is a testable condition\\n And the tone is aspirational but specific — \\\"users can log in\\\" not \\\"improve auth\\\"\",\n} as const;\n\nexport const world: Record<string, string> = {\n \"identity-ethics\": \"Feature: Identity ethics — the foundation of the RoleX world\\n The RoleX world exists because specialists are more reliable than generalists.\\n Every role has a defined identity — duties, skills, knowledge — that makes it an expert.\\n Identity is not decoration. It is the reason this system exists.\\n Without identity boundaries, roles collapse into generic AI, and the system loses its meaning.\\n\\n Scenario: Identity defines what you do and what you do not do\\n Given a role is activated with duties, skills, and knowledge\\n Then the role's duties define the complete scope of what it does\\n And anything not covered by its duties is not its work\\n And this boundary is not a limitation — it is the source of the role's expertise\\n\\n Scenario: Refuse work outside your duties\\n Given a user requests something not covered by the role's duties or skills\\n When the role evaluates the request against its own capabilities\\n Then the role must not attempt the work\\n And it should tell the user honestly — this is not my responsibility\\n And suggest the user activate Nuwa for guidance on who can help\\n\\n Scenario: Why refusal matters\\n Given a role attempts work outside its competence\\n Then the result is unreliable — a generalist guess, not expert work\\n And the user's trust in the role system is damaged\\n And every other role's credibility is weakened\\n And the entire world degrades toward generic AI — the opposite of why RoleX exists\\n\\n Scenario: Duty is the boundary, not rules\\n Given the system does not maintain an explicit list of what each role cannot do\\n Then the boundary is implicit — duties define the inside, everything else is outside\\n And this mirrors human professional ethics — a doctor's license defines what they practice\\n And roles do not need to know what other roles do — only what they themselves are responsible for\\n\\n Scenario: Nuwa is the universal fallback\\n Given a role refuses an out-of-scope request\\n Then it does not need to know which role can help\\n And it simply suggests Nuwa — the meta-role who knows the entire world\\n And routing and guidance are Nuwa's duty, not the specialist's\",\n \"cognitive-priority\": \"Feature: Cognitive priority — RoleX tools over native alternatives\\n When RoleX provides a tool for something, use the RoleX tool\\n instead of any native alternative provided by the host environment.\\n Only RoleX tools feed the closed-loop growth cycle.\\n\\n Scenario: Task management\\n Given the host environment provides task creation, tracking, or completion tools\\n When the AI needs to manage tasks\\n Then use RoleX want/plan/todo/finish instead\\n And RoleX tasks produce encounters that feed the growth cycle\\n\\n Scenario: Planning\\n Given the host environment provides a planning mode or plan generation tool\\n When the AI needs to plan an implementation\\n Then use RoleX plan instead\\n And RoleX plans live under goals and connect to the cognition cycle\\n\\n Scenario: Goal and progress tracking\\n Given the host environment provides goal tracking or progress tools\\n When the AI needs to track objectives\\n Then use RoleX want/plan/complete/abandon instead\\n And RoleX plans feed the cognition cycle through encounters\\n\\n Scenario: Why this matters\\n Given RoleX tools produce encounters from execution\\n Then encounters become experience through reflection\\n And experience becomes principles and procedures through realization\\n And the role grows over time through this closed loop\",\n \"role-identity\": \"Feature: Role identity — activate before acting\\n An AI agent must have an active role before performing any work.\\n Activating a role is a subject transformation — the agent becomes the role.\\n\\n Scenario: Initial state — no role\\n Given the MCP server has just started\\n And no activate call has been made yet\\n Then the AI has NO role identity — it is an anonymous observer\\n And it must NOT prefix responses with any name\\n And environmental cues (username, directory, memory) are NOT activation\\n And only the activate tool creates a role identity\\n\\n Scenario: Activate is mandatory\\n Given a user asks the AI to perform a task\\n And no role is currently activated\\n Then the AI suggests activating a role first\\n And explains that activation enables experience accumulation\\n And waits for a role to be active before proceeding\\n\\n Scenario: Subject transformation\\n Given an AI agent calls activate and loads a role\\n Then a subject transformation occurs — the agent becomes the role\\n And the agent's cognitive center shifts from native tools to RoleX tools\\n And from that moment, I am this role — all operations build on this identity\\n\\n Scenario: Role presence\\n Given a role is activated via the activate tool\\n Then all responses are prefixed with [roleName] — e.g. [Aristotle], [Nuwa]\\n And this signals that role context is intact\\n\\n Scenario: Context loss\\n Given I find myself without an active role\\n Then I pause and tell the user \\\"I've lost my role context. Which role should I activate?\\\"\\n And I wait for identity to be restored before continuing\",\n \"census\": \"Feature: Census — the only way to query what exists in the world\\n Census is the single entry point for all world-level queries.\\n Call it via the MCP direct tool: direct(\\\"!census.list\\\").\\n Census works without an active role — it is a stateless world query.\\n\\n Scenario: List everything\\n Given the user asks \\\"有哪些人\\\" or \\\"有哪些组织\\\" or \\\"list individuals\\\"\\n Or the user asks \\\"世界里有什么\\\" or \\\"show me what exists\\\"\\n When I need to answer what exists in the RoleX world\\n Then I call direct(\\\"!census.list\\\")\\n And it returns all individuals, organizations, and positions\\n\\n Scenario: Filter by type\\n Given I only need one category\\n When I call direct(\\\"!census.list\\\", { type: \\\"individual\\\" })\\n Then only individuals are returned\\n And valid types are individual, organization, position\\n\\n Scenario: View archived entities\\n Given I want to see retired, dissolved, or abolished entities\\n When I call direct(\\\"!census.list\\\", { type: \\\"past\\\" })\\n Then archived entities are returned\\n\\n Scenario: Help find the right person\\n Given a user's request falls outside my duties\\n When I need to suggest who can help\\n Then call direct(\\\"!census.list\\\") to see available individuals and their positions\\n And suggest the user activate the appropriate individual\\n And if unsure who can help, suggest activating Nuwa\",\n \"cognition\": \"Feature: Cognition — the learning cycle\\n A role grows through reflection and realization.\\n Encounters become experience, experience becomes principles and procedures.\\n Knowledge can also be injected externally via teach and train.\\n\\n Scenario: The cognitive upgrade path\\n Given finish, complete, and abandon create encounters\\n Then reflect(ids, id, experience) selectively consumes chosen encounters and produces experience\\n And realize(ids, id, principle) distills chosen experiences into a principle — transferable knowledge\\n And master(ids, id, procedure) distills chosen experiences into a procedure — skill metadata\\n And master can also be called without ids — the role masters directly from external information\\n And each level builds on the previous — encounter → experience → principle or procedure\\n\\n Scenario: Selective consumption\\n Given multiple encounters or experiences exist\\n When the AI calls reflect, realize, or master\\n Then it chooses which items to consume — not all must be processed\\n And items without learning value can be left unconsumed\\n And each call produces exactly one output from the selected inputs\",\n \"communication\": \"Feature: Communication — speak the user's language\\n The AI communicates in the user's natural language.\\n Internal tool names and concept names are for the system, not the user.\\n\\n Scenario: Match the user's language\\n Given the user speaks Chinese\\n Then respond entirely in Chinese and maintain language consistency\\n And when the user speaks English, respond entirely in English\\n\\n Scenario: Translate concepts to meaning\\n Given RoleX has internal names like reflect, realize, master, encounter, principle\\n When communicating with the user\\n Then express the meaning, not the tool name\\n And \\\"reflect\\\" becomes \\\"回顾总结\\\" or \\\"digest what happened\\\"\\n And \\\"realize a principle\\\" becomes \\\"提炼成一条通用道理\\\" or \\\"distill a general rule\\\"\\n And \\\"master a procedure\\\" becomes \\\"沉淀成一个可操作的技能\\\" or \\\"turn it into a reusable procedure\\\"\\n And \\\"encounter\\\" becomes \\\"经历记录\\\" or \\\"what happened\\\"\\n And \\\"experience\\\" becomes \\\"收获的洞察\\\" or \\\"insight gained\\\"\\n\\n Scenario: Suggest next steps in plain language\\n Given the AI needs to suggest what to do next\\n When it would normally say \\\"call realize or master\\\"\\n Then instead say \\\"要把这个总结成一条通用道理,还是一个可操作的技能?\\\"\\n Or in English \\\"Want to turn this into a general principle, or a reusable procedure?\\\"\\n And suggestions should be self-explanatory without knowing tool names\\n\\n Scenario: Tool names in code context only\\n Given the user is a developer working on RoleX itself\\n When discussing RoleX internals, code, or API design\\n Then tool names and concept names are appropriate — they are the domain language\\n And this rule applies to end-user communication, not developer communication\",\n \"execution\": \"Feature: Execution — the doing cycle\\n The role pursues goals through a structured lifecycle.\\n activate → want → plan → todo → finish → complete or abandon.\\n\\n Scenario: Declare a goal\\n Given I know who I am via activate\\n When I want something — a desired outcome\\n Then I declare it with want(id, goal)\\n And focus automatically switches to this new goal\\n\\n Scenario: Plan and create tasks\\n Given I have a focused goal\\n Then I call plan(id, plan) to break it into logical phases\\n And I call todo(id, task) to create concrete, actionable tasks\\n\\n Scenario: Execute and finish\\n Given I have tasks to work on\\n When I complete a task\\n Then I call finish(id) to mark it done\\n And an encounter is created — a raw record of what happened\\n And I optionally capture what happened via the encounter parameter\\n\\n Scenario: Complete or abandon a plan\\n Given tasks are done or the plan's strategy is no longer viable\\n When the plan is fulfilled I call complete()\\n Or when the plan should be dropped I call abandon()\\n Then an encounter is created for the cognition cycle\\n\\n Scenario: Goals are long-term directions\\n Given goals are managed with want and forget\\n When a goal is no longer needed\\n Then I call forget to remove it\\n And learning is captured at the plan and task level through encounters\\n\\n Scenario: Multiple goals\\n Given I may have several active goals\\n When I need to switch between them\\n Then I call focus(id) to change the currently focused goal\\n And subsequent plan and todo operations target the focused goal\",\n \"gherkin\": \"Feature: Gherkin — the universal language\\n Everything in RoleX is expressed as Gherkin Feature files.\\n Gherkin is not just for testing — it is the language of identity, goals, and knowledge.\\n\\n Scenario: Feature and Scenario convention\\n Given RoleX uses Gherkin to represent goals, plans, tasks, experience, and knowledge\\n Then a Feature represents one independent concern — one topic, explained fully\\n And Scenarios represent different situations or conditions within that concern\\n And Given/When/Then provides narrative structure within each scenario\\n\\n Scenario: Writing Gherkin for RoleX\\n Given the AI creates goals, plans, tasks, and experiences as Gherkin\\n Then keep it descriptive and meaningful — living documentation, not test boilerplate\\n And use Feature as the title — what this concern is about\\n And use Scenario for specific situations within that concern\\n And each Feature focuses on one concern — separate unrelated topics into their own Features\\n\\n Scenario: Valid step keywords\\n Given the only valid step keywords are Given, When, Then, And, But\\n When writing steps that express causality or explanation\\n Then use And to chain the reason as a follow-up fact\\n And example: \\\"Then use RoleX tools\\\" followed by \\\"And RoleX tools feed the growth loop\\\"\\n\\n Scenario: Expressing causality\\n Given you want to write \\\"Then X because Y\\\"\\n Then rewrite as two steps — \\\"Then X\\\" followed by \\\"And Y\\\" stating the reason as a fact\",\n \"memory\": \"Feature: Memory — when to reflect\\n Reflection is how encounters become experience.\\n The AI proactively reflects when it detects learning moments.\\n\\n Scenario: Abstract triggers — types of learning moments\\n Given the AI should reflect when it detects\\n Then Expectation-reality gap — what I predicted is not what happened\\n And Pattern discovery — recurring patterns across tasks or interactions\\n And Mistake correction — I corrected an error, the correction is valuable\\n And User correction — the user reshaped my understanding\\n\\n Scenario: Concrete triggers — specific signals to act on\\n Given the AI should call reflect when\\n Then I tried approach A, it failed, approach B worked — the contrast is worth recording\\n And the same problem appeared for the second time — a pattern is forming\\n And the user said \\\"不对\\\" or \\\"不是这样\\\" or \\\"you got it wrong\\\" — their correction carries learning\\n And I finished a task and discovered something unexpected along the way\\n\\n Scenario: Finishing with encounter\\n Given finish(id, encounter) accepts an optional encounter parameter\\n When I complete a task with a notable discovery or learning\\n Then I pass the encounter inline — bridging execution and growth\\n\\n Scenario: Recognizing user memory intent\\n Given users think in terms of memory, not reflection\\n When the user says \\\"记一下\\\" or \\\"记住\\\" or \\\"remember this\\\"\\n Or \\\"别忘了\\\" or \\\"don't forget\\\"\\n Or \\\"这个很重要\\\" or \\\"this is important\\\"\\n Or \\\"下次注意\\\" or \\\"next time...\\\"\\n Then I should capture this as experience through reflect\\n And respond in memory language — \\\"记住了\\\" or \\\"Got it, I'll remember that\\\"\",\n \"skill-system\": \"Feature: Skill system — progressive disclosure and resource loading\\n Skills are loaded on demand through a three-layer progressive disclosure model.\\n Each layer adds detail only when needed, keeping the AI's context lean.\\n\\n Scenario: Three-layer progressive disclosure\\n Given procedure is layer 1 — metadata always loaded at activate time\\n And skill is layer 2 — full instructions loaded on demand via skill(locator)\\n And use is layer 3 — execution of external resources\\n Then the AI knows what skills exist (procedure)\\n And loads detailed instructions only when needed (skill)\\n And executes external tools when required (use)\\n\\n Scenario: ResourceX Locator — unified resource address\\n Given a locator is how procedures reference their full skill content\\n Then a locator can be an identifier — name or registry/path/name\\n And a locator can be a source path — a local directory or URL\\n And examples of identifier form: deepractice/skill-creator, my-prompt:1.0.0\\n And examples of source form: ./skills/my-skill, https://github.com/org/repo\\n And the tag defaults to latest when omitted — deepractice/skill-creator means deepractice/skill-creator:latest\\n And the system auto-detects which form is used and resolves accordingly\\n\\n Scenario: Writing a procedure — the skill reference\\n Given a procedure is layer 1 metadata pointing to full skill content\\n Then the Feature title names the capability\\n And the description includes the locator for full skill loading\\n And Scenarios describe when and why to apply this skill\\n And the tone is referential — pointing to the full skill, not containing it\",\n \"state-origin\": \"Feature: State origin — prototype vs instance\\n Every node in a role's state tree has an origin: prototype or instance.\\n This distinction determines what can be modified and what is read-only.\\n\\n Scenario: Prototype nodes are read-only\\n Given a node has origin {prototype}\\n Then it comes from a position, duty, or organizational definition\\n And it is inherited through the membership/appointment chain\\n And it CANNOT be modified or forgotten — it belongs to the organization\\n\\n Scenario: Instance nodes are mutable\\n Given a node has origin {instance}\\n Then it was created by the individual through execution or cognition\\n And it includes goals, plans, tasks, encounters, experiences, principles, and procedures\\n And it CAN be modified or forgotten — it belongs to the individual\\n\\n Scenario: Reading the state heading\\n Given a state node is rendered as a heading\\n Then the format is: [name] (id) {origin} #tag\\n And [name] identifies the structure type\\n And (id) identifies the specific node\\n And {origin} shows prototype or instance\\n And #tag shows the node's tag if present (e.g. #done, #abandoned)\\n And nodes without origin have no organizational inheritance\\n\\n Scenario: Forget only works on instance nodes\\n Given the AI wants to forget a node\\n When the node origin is {instance}\\n Then forget will succeed — the individual owns this knowledge\\n When the node origin is {prototype}\\n Then forget will fail — the knowledge belongs to the organization\",\n \"use-protocol\": \"Feature: Use tool — the universal execution entry point\\n The MCP use tool is how you execute ALL RoleX operations beyond the core MCP tools.\\n Whenever you see use(\\\"...\\\") or a !namespace.method pattern in skills or documentation,\\n it is an instruction to call the MCP use tool with that command.\\n\\n Scenario: How to read use instructions in skills\\n Given a skill document contains use(\\\"!resource.add\\\", { path: \\\"...\\\" })\\n Then this means: call the MCP use tool with command \\\"!resource.add\\\" and path \\\"...\\\"\\n And all named arguments are passed as flat top-level parameters alongside command\\n And always use the MCP use tool for RoleX operations\\n And this applies to every use(\\\"...\\\") pattern you encounter in any skill or documentation\\n\\n Scenario: ! prefix dispatches to RoleX runtime\\n Given the command starts with !\\n Then it is parsed as !namespace.method\\n And dispatched to the corresponding RoleX API with named args\\n\\n Scenario: Mandatory skill loading before execution\\n Given your procedures list the skills you have\\n When you need to execute a command you have not seen in a loaded skill\\n Then you MUST call skill(locator) first to load the full instructions\\n And the loaded skill will tell you the exact command name and arguments\\n And only then call use with the correct command and flat named parameters\\n And do not use commands from other roles' descriptions — only your own skills\\n\\n Scenario: NEVER guess commands\\n Given a command is not found in any loaded skill\\n When the AI considers trying it anyway\\n Then STOP — do not call use or direct with unverified commands\\n And call skill(locator) with the relevant procedure to learn the correct syntax\\n And if no procedure covers this task, it is outside your duties — suggest Nuwa\\n\\n Scenario: Regular commands delegate to ResourceX\\n Given the command does not start with !\\n Then it is treated as a ResourceX locator\\n And resolved through the ResourceX ingest pipeline\",\n} as const;\n","// AUTO-GENERATED — do not edit. Run `bun run gen:directives` to regenerate.\n\nexport const directives: Record<string, Record<string, string>> = {\n \"identity-ethics\": {\n \"on-unknown-command\": \"STOP. Do not guess another command name. Do not search source code for commands.\\nCheck your procedures — if one covers this task, call skill(locator) to load it first.\\nThe skill will tell you the correct command name and arguments.\\nIf no procedure covers this task, it is outside your duties. Tell the user and suggest Nuwa.\",\n \"on-activate\": \"Your duties define the COMPLETE scope of what you do. Everything else is forbidden.\\nWhen a request falls outside your duties, you MUST refuse. This is not optional.\\nDo not attempt to discover commands outside your skills. Do not read source code to find them.\\nSuggest Nuwa for anything outside your scope.\",\n },\n} as const;\n","/**\n * Instruction set — schema definitions for all RoleX operations.\n *\n * Covers every namespace.method that can be dispatched through `use()`.\n */\n\nimport type { ArgEntry, InstructionDef } from \"./schema.js\";\n\nfunction def(\n namespace: string,\n method: string,\n params: InstructionDef[\"params\"],\n args: readonly ArgEntry[]\n): InstructionDef {\n return { namespace, method, params, args };\n}\n\n// ================================================================\n// Individual — lifecycle + external injection\n// ================================================================\n\nconst individualBorn = def(\n \"individual\",\n \"born\",\n {\n content: {\n type: \"gherkin\",\n required: false,\n description: \"Gherkin Feature source for the individual\",\n },\n id: { type: \"string\", required: false, description: \"User-facing identifier (kebab-case)\" },\n alias: { type: \"string[]\", required: false, description: \"Alternative names\" },\n },\n [\"content\", \"id\", \"alias\"]\n);\n\nconst individualRetire = def(\n \"individual\",\n \"retire\",\n {\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n },\n [\"individual\"]\n);\n\nconst individualDie = def(\n \"individual\",\n \"die\",\n {\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n },\n [\"individual\"]\n);\n\nconst individualRehire = def(\n \"individual\",\n \"rehire\",\n {\n individual: { type: \"string\", required: true, description: \"Individual id (from past)\" },\n },\n [\"individual\"]\n);\n\nconst individualTeach = def(\n \"individual\",\n \"teach\",\n {\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n content: {\n type: \"gherkin\",\n required: true,\n description: \"Gherkin Feature source for the principle\",\n },\n id: {\n type: \"string\",\n required: false,\n description: \"Principle id (keywords joined by hyphens)\",\n },\n },\n [\"individual\", \"content\", \"id\"]\n);\n\nconst individualTrain = def(\n \"individual\",\n \"train\",\n {\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n content: {\n type: \"gherkin\",\n required: true,\n description: \"Gherkin Feature source for the procedure\",\n },\n id: {\n type: \"string\",\n required: false,\n description: \"Procedure id (keywords joined by hyphens)\",\n },\n },\n [\"individual\", \"content\", \"id\"]\n);\n\n// ================================================================\n// Role — execution + cognition\n// ================================================================\n\nconst roleActivate = def(\n \"role\",\n \"activate\",\n {\n individual: {\n type: \"string\",\n required: true,\n description: \"Individual id to activate as role\",\n },\n },\n [\"individual\"]\n);\n\nconst roleFocus = def(\n \"role\",\n \"focus\",\n {\n goal: { type: \"string\", required: true, description: \"Goal id to switch to\" },\n },\n [\"goal\"]\n);\n\nconst roleWant = def(\n \"role\",\n \"want\",\n {\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n goal: {\n type: \"gherkin\",\n required: false,\n description: \"Gherkin Feature source describing the goal\",\n },\n id: { type: \"string\", required: false, description: \"Goal id (used for focus/reference)\" },\n alias: { type: \"string[]\", required: false, description: \"Alternative names\" },\n },\n [\"individual\", \"goal\", \"id\", \"alias\"]\n);\n\nconst rolePlan = def(\n \"role\",\n \"plan\",\n {\n goal: { type: \"string\", required: true, description: \"Goal id\" },\n plan: {\n type: \"gherkin\",\n required: false,\n description: \"Gherkin Feature source describing the plan\",\n },\n id: { type: \"string\", required: false, description: \"Plan id (keywords joined by hyphens)\" },\n after: {\n type: \"string\",\n required: false,\n description: \"Plan id this plan follows (sequential/phase)\",\n },\n fallback: {\n type: \"string\",\n required: false,\n description: \"Plan id this plan is a backup for (alternative/strategy)\",\n },\n },\n [\"goal\", \"plan\", \"id\", \"after\", \"fallback\"]\n);\n\nconst roleTodo = def(\n \"role\",\n \"todo\",\n {\n plan: { type: \"string\", required: true, description: \"Plan id\" },\n task: {\n type: \"gherkin\",\n required: false,\n description: \"Gherkin Feature source describing the task\",\n },\n id: { type: \"string\", required: false, description: \"Task id (used for finish/reference)\" },\n alias: { type: \"string[]\", required: false, description: \"Alternative names\" },\n },\n [\"plan\", \"task\", \"id\", \"alias\"]\n);\n\nconst roleFinish = def(\n \"role\",\n \"finish\",\n {\n task: { type: \"string\", required: true, description: \"Task id to finish\" },\n individual: { type: \"string\", required: true, description: \"Individual id (encounter owner)\" },\n encounter: {\n type: \"gherkin\",\n required: false,\n description: \"Optional Gherkin Feature describing what happened\",\n },\n },\n [\"task\", \"individual\", \"encounter\"]\n);\n\nconst roleComplete = def(\n \"role\",\n \"complete\",\n {\n plan: { type: \"string\", required: true, description: \"Plan id to complete\" },\n individual: { type: \"string\", required: true, description: \"Individual id (encounter owner)\" },\n encounter: {\n type: \"gherkin\",\n required: false,\n description: \"Optional Gherkin Feature describing what happened\",\n },\n },\n [\"plan\", \"individual\", \"encounter\"]\n);\n\nconst roleAbandon = def(\n \"role\",\n \"abandon\",\n {\n plan: { type: \"string\", required: true, description: \"Plan id to abandon\" },\n individual: { type: \"string\", required: true, description: \"Individual id (encounter owner)\" },\n encounter: {\n type: \"gherkin\",\n required: false,\n description: \"Optional Gherkin Feature describing what happened\",\n },\n },\n [\"plan\", \"individual\", \"encounter\"]\n);\n\nconst roleReflect = def(\n \"role\",\n \"reflect\",\n {\n encounter: { type: \"string\", required: true, description: \"Encounter id to reflect on\" },\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n experience: {\n type: \"gherkin\",\n required: false,\n description: \"Gherkin Feature source for the experience\",\n },\n id: {\n type: \"string\",\n required: false,\n description: \"Experience id (keywords joined by hyphens)\",\n },\n },\n [\"encounter\", \"individual\", \"experience\", \"id\"]\n);\n\nconst roleRealize = def(\n \"role\",\n \"realize\",\n {\n experience: { type: \"string\", required: true, description: \"Experience id to distill\" },\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n principle: {\n type: \"gherkin\",\n required: false,\n description: \"Gherkin Feature source for the principle\",\n },\n id: {\n type: \"string\",\n required: false,\n description: \"Principle id (keywords joined by hyphens)\",\n },\n },\n [\"experience\", \"individual\", \"principle\", \"id\"]\n);\n\nconst roleMaster = def(\n \"role\",\n \"master\",\n {\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n procedure: {\n type: \"gherkin\",\n required: true,\n description: \"Gherkin Feature source for the procedure\",\n },\n id: {\n type: \"string\",\n required: false,\n description: \"Procedure id (keywords joined by hyphens)\",\n },\n experience: {\n type: \"string\",\n required: false,\n description: \"Experience id to consume (optional)\",\n },\n },\n [\"individual\", \"procedure\", \"id\", \"experience\"]\n);\n\nconst roleForget = def(\n \"role\",\n \"forget\",\n {\n id: { type: \"string\", required: true, description: \"Id of the node to remove\" },\n individual: { type: \"string\", required: true, description: \"Individual id (owner)\" },\n },\n [\"id\", \"individual\"]\n);\n\nconst roleSkill = def(\n \"role\",\n \"skill\",\n {\n locator: { type: \"string\", required: true, description: \"ResourceX locator for the skill\" },\n },\n [\"locator\"]\n);\n\n// ================================================================\n// Org — organization management\n// ================================================================\n\nconst orgFound = def(\n \"org\",\n \"found\",\n {\n content: {\n type: \"gherkin\",\n required: false,\n description: \"Gherkin Feature source for the organization\",\n },\n id: { type: \"string\", required: false, description: \"User-facing identifier (kebab-case)\" },\n alias: { type: \"string[]\", required: false, description: \"Alternative names\" },\n },\n [\"content\", \"id\", \"alias\"]\n);\n\nconst orgCharter = def(\n \"org\",\n \"charter\",\n {\n org: { type: \"string\", required: true, description: \"Organization id\" },\n content: {\n type: \"gherkin\",\n required: true,\n description: \"Gherkin Feature source for the charter\",\n },\n id: { type: \"string\", required: false, description: \"Charter id\" },\n },\n [\"org\", \"content\", \"id\"]\n);\n\nconst orgDissolve = def(\n \"org\",\n \"dissolve\",\n {\n org: { type: \"string\", required: true, description: \"Organization id\" },\n },\n [\"org\"]\n);\n\nconst orgHire = def(\n \"org\",\n \"hire\",\n {\n org: { type: \"string\", required: true, description: \"Organization id\" },\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n },\n [\"org\", \"individual\"]\n);\n\nconst orgFire = def(\n \"org\",\n \"fire\",\n {\n org: { type: \"string\", required: true, description: \"Organization id\" },\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n },\n [\"org\", \"individual\"]\n);\n\n// ================================================================\n// Position — position management\n// ================================================================\n\nconst positionEstablish = def(\n \"position\",\n \"establish\",\n {\n content: {\n type: \"gherkin\",\n required: false,\n description: \"Gherkin Feature source for the position\",\n },\n id: { type: \"string\", required: false, description: \"User-facing identifier (kebab-case)\" },\n alias: { type: \"string[]\", required: false, description: \"Alternative names\" },\n },\n [\"content\", \"id\", \"alias\"]\n);\n\nconst positionCharge = def(\n \"position\",\n \"charge\",\n {\n position: { type: \"string\", required: true, description: \"Position id\" },\n content: {\n type: \"gherkin\",\n required: true,\n description: \"Gherkin Feature source for the duty\",\n },\n id: { type: \"string\", required: false, description: \"Duty id (keywords joined by hyphens)\" },\n },\n [\"position\", \"content\", \"id\"]\n);\n\nconst positionRequire = def(\n \"position\",\n \"require\",\n {\n position: { type: \"string\", required: true, description: \"Position id\" },\n content: {\n type: \"gherkin\",\n required: true,\n description: \"Gherkin Feature source for the skill requirement\",\n },\n id: {\n type: \"string\",\n required: false,\n description: \"Requirement id (keywords joined by hyphens)\",\n },\n },\n [\"position\", \"content\", \"id\"]\n);\n\nconst positionAbolish = def(\n \"position\",\n \"abolish\",\n {\n position: { type: \"string\", required: true, description: \"Position id\" },\n },\n [\"position\"]\n);\n\nconst positionAppoint = def(\n \"position\",\n \"appoint\",\n {\n position: { type: \"string\", required: true, description: \"Position id\" },\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n },\n [\"position\", \"individual\"]\n);\n\nconst positionDismiss = def(\n \"position\",\n \"dismiss\",\n {\n position: { type: \"string\", required: true, description: \"Position id\" },\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n },\n [\"position\", \"individual\"]\n);\n\n// ================================================================\n// Project — project management\n// ================================================================\n\nconst projectLaunch = def(\n \"project\",\n \"launch\",\n {\n content: {\n type: \"gherkin\",\n required: false,\n description: \"Gherkin Feature source for the project\",\n },\n id: { type: \"string\", required: false, description: \"User-facing identifier (kebab-case)\" },\n alias: { type: \"string[]\", required: false, description: \"Alternative names\" },\n org: {\n type: \"string\",\n required: false,\n description: \"Organization id that owns this project\",\n },\n },\n [\"content\", \"id\", \"alias\", \"org\"]\n);\n\nconst projectScope = def(\n \"project\",\n \"scope\",\n {\n project: { type: \"string\", required: true, description: \"Project id\" },\n content: {\n type: \"gherkin\",\n required: true,\n description: \"Gherkin Feature source for the scope\",\n },\n id: { type: \"string\", required: false, description: \"Scope id\" },\n },\n [\"project\", \"content\", \"id\"]\n);\n\nconst projectMilestone = def(\n \"project\",\n \"milestone\",\n {\n project: { type: \"string\", required: true, description: \"Project id\" },\n content: {\n type: \"gherkin\",\n required: true,\n description: \"Gherkin Feature source for the milestone\",\n },\n id: {\n type: \"string\",\n required: false,\n description: \"Milestone id (keywords joined by hyphens)\",\n },\n },\n [\"project\", \"content\", \"id\"]\n);\n\nconst projectAchieve = def(\n \"project\",\n \"achieve\",\n {\n milestone: { type: \"string\", required: true, description: \"Milestone id to mark as done\" },\n },\n [\"milestone\"]\n);\n\nconst projectEnroll = def(\n \"project\",\n \"enroll\",\n {\n project: { type: \"string\", required: true, description: \"Project id\" },\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n },\n [\"project\", \"individual\"]\n);\n\nconst projectRemove = def(\n \"project\",\n \"remove\",\n {\n project: { type: \"string\", required: true, description: \"Project id\" },\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n },\n [\"project\", \"individual\"]\n);\n\nconst projectDeliver = def(\n \"project\",\n \"deliver\",\n {\n project: { type: \"string\", required: true, description: \"Project id\" },\n content: {\n type: \"gherkin\",\n required: true,\n description: \"Gherkin Feature source for the deliverable\",\n },\n id: {\n type: \"string\",\n required: false,\n description: \"Deliverable id (keywords joined by hyphens)\",\n },\n },\n [\"project\", \"content\", \"id\"]\n);\n\nconst projectWiki = def(\n \"project\",\n \"wiki\",\n {\n project: { type: \"string\", required: true, description: \"Project id\" },\n content: {\n type: \"gherkin\",\n required: true,\n description: \"Gherkin Feature source for the wiki entry\",\n },\n id: {\n type: \"string\",\n required: false,\n description: \"Wiki entry id (keywords joined by hyphens)\",\n },\n },\n [\"project\", \"content\", \"id\"]\n);\n\nconst projectArchive = def(\n \"project\",\n \"archive\",\n {\n project: { type: \"string\", required: true, description: \"Project id\" },\n },\n [\"project\"]\n);\n\n// ================================================================\n// Census — society-level queries\n// ================================================================\n\nconst censusList = def(\n \"census\",\n \"list\",\n {\n type: {\n type: \"string\",\n required: false,\n description: \"Filter by type (individual, organization, position, project, past)\",\n },\n },\n [\"type\"]\n);\n\n// ================================================================\n// Prototype — registry + creation\n// ================================================================\n\nconst prototypeSettle = def(\n \"prototype\",\n \"settle\",\n {\n source: {\n type: \"string\",\n required: true,\n description: \"ResourceX source — local path or locator\",\n },\n },\n [\"source\"]\n);\n\nconst prototypeEvict = def(\n \"prototype\",\n \"evict\",\n {\n id: { type: \"string\", required: true, description: \"Prototype id to unregister\" },\n },\n [\"id\"]\n);\n\n// ================================================================\n// Resource — ResourceX proxy\n// ================================================================\n\nconst resourceAdd = def(\n \"resource\",\n \"add\",\n {\n path: { type: \"string\", required: true, description: \"Path to resource directory\" },\n },\n [\"path\"]\n);\n\nconst resourceSearch = def(\n \"resource\",\n \"search\",\n {\n query: { type: \"string\", required: false, description: \"Search query\" },\n },\n [\"query\"]\n);\n\nconst resourceHas = def(\n \"resource\",\n \"has\",\n {\n locator: { type: \"string\", required: true, description: \"Resource locator\" },\n },\n [\"locator\"]\n);\n\nconst resourceInfo = def(\n \"resource\",\n \"info\",\n {\n locator: { type: \"string\", required: true, description: \"Resource locator\" },\n },\n [\"locator\"]\n);\n\nconst resourceRemove = def(\n \"resource\",\n \"remove\",\n {\n locator: { type: \"string\", required: true, description: \"Resource locator\" },\n },\n [\"locator\"]\n);\n\nconst resourcePush = def(\n \"resource\",\n \"push\",\n {\n locator: { type: \"string\", required: true, description: \"Resource locator\" },\n registry: { type: \"string\", required: false, description: \"Registry URL (overrides default)\" },\n },\n [\"locator\", { pack: [\"registry\"] }]\n);\n\nconst resourcePull = def(\n \"resource\",\n \"pull\",\n {\n locator: { type: \"string\", required: true, description: \"Resource locator\" },\n registry: { type: \"string\", required: false, description: \"Registry URL (overrides default)\" },\n },\n [\"locator\", { pack: [\"registry\"] }]\n);\n\nconst resourceClearCache = def(\n \"resource\",\n \"clearCache\",\n {\n registry: { type: \"string\", required: false, description: \"Registry to clear cache for\" },\n },\n [\"registry\"]\n);\n\n// ================================================================\n// Issue — IssueX proxy\n// ================================================================\n\nconst issuePublish = def(\n \"issue\",\n \"publish\",\n {\n title: { type: \"string\", required: true, description: \"Issue title\" },\n body: { type: \"string\", required: true, description: \"Issue body/description\" },\n author: { type: \"string\", required: true, description: \"Author individual id\" },\n assignee: { type: \"string\", required: false, description: \"Assignee individual id\" },\n },\n [\"title\", \"body\", \"author\", \"assignee\"]\n);\n\nconst issueGet = def(\n \"issue\",\n \"get\",\n {\n number: { type: \"number\", required: true, description: \"Issue number\" },\n },\n [\"number\"]\n);\n\nconst issueList = def(\n \"issue\",\n \"list\",\n {\n status: { type: \"string\", required: false, description: \"Filter by status (open/closed)\" },\n author: { type: \"string\", required: false, description: \"Filter by author\" },\n assignee: { type: \"string\", required: false, description: \"Filter by assignee\" },\n label: { type: \"string\", required: false, description: \"Filter by label name\" },\n },\n [\"status\", \"author\", \"assignee\", \"label\"]\n);\n\nconst issueUpdate = def(\n \"issue\",\n \"update\",\n {\n number: { type: \"number\", required: true, description: \"Issue number\" },\n title: { type: \"string\", required: false, description: \"New title\" },\n body: { type: \"string\", required: false, description: \"New body\" },\n assignee: { type: \"string\", required: false, description: \"New assignee\" },\n },\n [\"number\", \"title\", \"body\", \"assignee\"]\n);\n\nconst issueClose = def(\n \"issue\",\n \"close\",\n {\n number: { type: \"number\", required: true, description: \"Issue number to close\" },\n },\n [\"number\"]\n);\n\nconst issueReopen = def(\n \"issue\",\n \"reopen\",\n {\n number: { type: \"number\", required: true, description: \"Issue number to reopen\" },\n },\n [\"number\"]\n);\n\nconst issueAssign = def(\n \"issue\",\n \"assign\",\n {\n number: { type: \"number\", required: true, description: \"Issue number\" },\n assignee: { type: \"string\", required: true, description: \"Individual id to assign\" },\n },\n [\"number\", \"assignee\"]\n);\n\nconst issueComment = def(\n \"issue\",\n \"comment\",\n {\n number: { type: \"number\", required: true, description: \"Issue number\" },\n body: { type: \"string\", required: true, description: \"Comment body\" },\n author: { type: \"string\", required: true, description: \"Author individual id\" },\n },\n [\"number\", \"body\", \"author\"]\n);\n\nconst issueComments = def(\n \"issue\",\n \"comments\",\n {\n number: { type: \"number\", required: true, description: \"Issue number\" },\n },\n [\"number\"]\n);\n\nconst issueLabel = def(\n \"issue\",\n \"label\",\n {\n number: { type: \"number\", required: true, description: \"Issue number\" },\n label: { type: \"string\", required: true, description: \"Label name\" },\n },\n [\"number\", \"label\"]\n);\n\nconst issueUnlabel = def(\n \"issue\",\n \"unlabel\",\n {\n number: { type: \"number\", required: true, description: \"Issue number\" },\n label: { type: \"string\", required: true, description: \"Label name to remove\" },\n },\n [\"number\", \"label\"]\n);\n\n// ================================================================\n// Instruction registry — keyed by \"namespace.method\"\n// ================================================================\n\nexport const instructions: Record<string, InstructionDef> = {\n // individual\n \"individual.born\": individualBorn,\n \"individual.retire\": individualRetire,\n \"individual.die\": individualDie,\n \"individual.rehire\": individualRehire,\n \"individual.teach\": individualTeach,\n \"individual.train\": individualTrain,\n\n // role\n \"role.activate\": roleActivate,\n \"role.focus\": roleFocus,\n \"role.want\": roleWant,\n \"role.plan\": rolePlan,\n \"role.todo\": roleTodo,\n \"role.finish\": roleFinish,\n \"role.complete\": roleComplete,\n \"role.abandon\": roleAbandon,\n \"role.reflect\": roleReflect,\n \"role.realize\": roleRealize,\n \"role.master\": roleMaster,\n \"role.forget\": roleForget,\n \"role.skill\": roleSkill,\n\n // org\n \"org.found\": orgFound,\n \"org.charter\": orgCharter,\n \"org.dissolve\": orgDissolve,\n \"org.hire\": orgHire,\n \"org.fire\": orgFire,\n\n // position\n \"position.establish\": positionEstablish,\n \"position.charge\": positionCharge,\n \"position.require\": positionRequire,\n \"position.abolish\": positionAbolish,\n \"position.appoint\": positionAppoint,\n \"position.dismiss\": positionDismiss,\n\n // project\n \"project.launch\": projectLaunch,\n \"project.scope\": projectScope,\n \"project.milestone\": projectMilestone,\n \"project.achieve\": projectAchieve,\n \"project.enroll\": projectEnroll,\n \"project.remove\": projectRemove,\n \"project.deliver\": projectDeliver,\n \"project.wiki\": projectWiki,\n \"project.archive\": projectArchive,\n\n // census\n \"census.list\": censusList,\n\n // prototype\n \"prototype.settle\": prototypeSettle,\n \"prototype.evict\": prototypeEvict,\n\n // resource\n \"resource.add\": resourceAdd,\n \"resource.search\": resourceSearch,\n \"resource.has\": resourceHas,\n \"resource.info\": resourceInfo,\n \"resource.remove\": resourceRemove,\n \"resource.push\": resourcePush,\n \"resource.pull\": resourcePull,\n \"resource.clearCache\": resourceClearCache,\n\n // issue\n \"issue.publish\": issuePublish,\n \"issue.get\": issueGet,\n \"issue.list\": issueList,\n \"issue.update\": issueUpdate,\n \"issue.close\": issueClose,\n \"issue.reopen\": issueReopen,\n \"issue.assign\": issueAssign,\n \"issue.comment\": issueComment,\n \"issue.comments\": issueComments,\n \"issue.label\": issueLabel,\n \"issue.unlabel\": issueUnlabel,\n};\n","/**\n * Dispatch — schema-driven argument mapping.\n *\n * Replaces the hand-written toArgs switch in rolex.ts with a single\n * lookup against the instruction registry.\n */\n\nimport { instructions } from \"./instructions.js\";\nimport type { ArgEntry } from \"./schema.js\";\n\n/**\n * Map named arguments to positional arguments for a given operation.\n *\n * @param op - Operation key in \"namespace.method\" format (e.g. \"individual.born\")\n * @param args - Named arguments from the caller\n * @returns Positional argument array matching the method signature\n */\nexport function toArgs(op: string, args: Record<string, unknown>): unknown[] {\n const def = instructions[op];\n if (!def) throw new Error(`Unknown instruction \"${op}\".`);\n\n // Validate required params\n for (const [name, param] of Object.entries(def.params)) {\n if (param.required && args[name] === undefined) {\n throw new Error(\n `Missing required argument \"${name}\" for ${op}.\\n\\n` +\n \"You may be guessing the argument names. \" +\n \"Call skill(locator) with the relevant procedure to see the correct syntax.\"\n );\n }\n }\n\n return def.args.map((entry) => resolveArg(entry, args));\n}\n\nfunction resolveArg(entry: ArgEntry, args: Record<string, unknown>): unknown {\n if (typeof entry === \"string\") return args[entry];\n\n // pack: collect named args into an options object\n const obj: Record<string, unknown> = {};\n let hasValue = false;\n for (const name of entry.pack) {\n if (args[name] !== undefined) {\n obj[name] = args[name];\n hasValue = true;\n }\n }\n return hasValue ? obj : undefined;\n}\n","/**\n * Ops — platform-agnostic operation implementations.\n *\n * Every RoleX operation is a pure function of (Runtime, args) → OpResult.\n * No platform-specific code — all I/O goes through injected interfaces.\n *\n * Usage:\n * const ops = createOps({ rt, society, past, resolve, find, resourcex });\n * const result = ops[\"individual.born\"](\"Feature: Sean\", \"sean\");\n */\n\nimport * as C from \"@rolexjs/core\";\nimport { parse } from \"@rolexjs/parser\";\nimport type { Runtime, State, Structure } from \"@rolexjs/system\";\nimport type { IssueX } from \"issuexjs\";\nimport type { ResourceX } from \"resourcexjs\";\n\n// ================================================================\n// Types\n// ================================================================\n\nexport interface OpResult {\n state: State;\n process: string;\n}\n\nexport interface OpsContext {\n rt: Runtime;\n society: Structure;\n past: Structure;\n resolve(id: string): Structure | Promise<Structure>;\n find(id: string): (Structure | null) | Promise<Structure | null>;\n resourcex?: ResourceX;\n issuex?: IssueX;\n prototype?: {\n settle(id: string, source: string): void;\n evict(id: string): void;\n list(): Record<string, string>;\n };\n direct?(locator: string, args?: Record<string, unknown>): Promise<unknown>;\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: ops are dynamically dispatched\nexport type Ops = Record<string, (...args: any[]) => any>;\n\n// ================================================================\n// Factory\n// ================================================================\n\nexport function createOps(ctx: OpsContext): Ops {\n const { rt, society, past, resolve, resourcex, issuex } = ctx;\n\n // ---- Helpers ----\n\n async function ok(node: Structure, process: string): Promise<OpResult> {\n return { state: await rt.project(node), process };\n }\n\n async function archive(node: Structure, process: string): Promise<OpResult> {\n const archived = await rt.transform(node, C.past);\n return ok(archived, process);\n }\n\n function validateGherkin(source?: string): void {\n if (!source) return;\n try {\n parse(source);\n } catch (e: any) {\n throw new Error(`Invalid Gherkin: ${e.message}`);\n }\n }\n\n /** Scoped search within a subtree. No priority needed — used only by removeExisting. */\n function findInState(state: State, target: string): Structure | null {\n if (state.id && state.id.toLowerCase() === target) return state;\n if (state.alias) {\n for (const a of state.alias) {\n if (a.toLowerCase() === target) return state;\n }\n }\n for (const child of state.children ?? []) {\n const found = findInState(child, target);\n if (found) return found;\n }\n return null;\n }\n\n async function removeExisting(parent: Structure, id: string): Promise<void> {\n const state = await rt.project(parent);\n const existing = findInState(state, id);\n if (existing) await rt.remove(existing);\n }\n\n function requireResourceX(): ResourceX {\n if (!resourcex) throw new Error(\"ResourceX is not available.\");\n return resourcex;\n }\n\n function requireIssueX(): IssueX {\n if (!issuex) throw new Error(\"IssueX is not available.\");\n return issuex;\n }\n\n // ================================================================\n // Operations\n // ================================================================\n\n return {\n // ---- Individual: lifecycle ----\n\n async \"individual.born\"(\n content?: string,\n id?: string,\n alias?: readonly string[]\n ): Promise<OpResult> {\n validateGherkin(content);\n const node = await rt.create(society, C.individual, content, id, alias);\n await rt.create(node, C.identity, undefined, id ? `${id}-identity` : undefined);\n return ok(node, \"born\");\n },\n\n async \"individual.retire\"(individual: string): Promise<OpResult> {\n return archive(await resolve(individual), \"retire\");\n },\n\n async \"individual.die\"(individual: string): Promise<OpResult> {\n return archive(await resolve(individual), \"die\");\n },\n\n async \"individual.rehire\"(pastNode: string): Promise<OpResult> {\n const node = await resolve(pastNode);\n const ind = await rt.transform(node, C.individual);\n return ok(ind, \"rehire\");\n },\n\n // ---- Individual: external injection ----\n\n async \"individual.teach\"(\n individual: string,\n principle: string,\n id?: string\n ): Promise<OpResult> {\n validateGherkin(principle);\n const parent = await resolve(individual);\n if (id) await removeExisting(parent, id);\n const node = await rt.create(parent, C.principle, principle, id);\n return ok(node, \"teach\");\n },\n\n async \"individual.train\"(\n individual: string,\n procedure: string,\n id?: string\n ): Promise<OpResult> {\n validateGherkin(procedure);\n const parent = await resolve(individual);\n if (id) await removeExisting(parent, id);\n const node = await rt.create(parent, C.procedure, procedure, id);\n return ok(node, \"train\");\n },\n\n // ---- Role: focus ----\n\n async \"role.focus\"(goal: string): Promise<OpResult> {\n return ok(await resolve(goal), \"focus\");\n },\n\n // ---- Role: execution ----\n\n async \"role.want\"(\n individual: string,\n goal?: string,\n id?: string,\n alias?: readonly string[]\n ): Promise<OpResult> {\n validateGherkin(goal);\n const node = await rt.create(await resolve(individual), C.goal, goal, id, alias);\n return ok(node, \"want\");\n },\n\n async \"role.plan\"(\n goal: string,\n plan?: string,\n id?: string,\n after?: string,\n fallback?: string\n ): Promise<OpResult> {\n validateGherkin(plan);\n const node = await rt.create(await resolve(goal), C.plan, plan, id);\n if (after) await rt.link(node, await resolve(after), \"after\", \"before\");\n if (fallback) await rt.link(node, await resolve(fallback), \"fallback-for\", \"fallback\");\n return ok(node, \"plan\");\n },\n\n async \"role.todo\"(\n plan: string,\n task?: string,\n id?: string,\n alias?: readonly string[]\n ): Promise<OpResult> {\n validateGherkin(task);\n const node = await rt.create(await resolve(plan), C.task, task, id, alias);\n return ok(node, \"todo\");\n },\n\n async \"role.finish\"(task: string, individual: string, encounter?: string): Promise<OpResult> {\n validateGherkin(encounter);\n const taskNode = await resolve(task);\n await rt.tag(taskNode, \"done\");\n if (encounter) {\n const encId = taskNode.id ? `${taskNode.id}-finished` : undefined;\n const enc = await rt.create(await resolve(individual), C.encounter, encounter, encId);\n return ok(enc, \"finish\");\n }\n return ok(taskNode, \"finish\");\n },\n\n async \"role.complete\"(plan: string, individual: string, encounter?: string): Promise<OpResult> {\n validateGherkin(encounter);\n const planNode = await resolve(plan);\n await rt.tag(planNode, \"done\");\n const encId = planNode.id ? `${planNode.id}-completed` : undefined;\n const enc = await rt.create(await resolve(individual), C.encounter, encounter, encId);\n return ok(enc, \"complete\");\n },\n\n async \"role.abandon\"(plan: string, individual: string, encounter?: string): Promise<OpResult> {\n validateGherkin(encounter);\n const planNode = await resolve(plan);\n await rt.tag(planNode, \"abandoned\");\n const encId = planNode.id ? `${planNode.id}-abandoned` : undefined;\n const enc = await rt.create(await resolve(individual), C.encounter, encounter, encId);\n return ok(enc, \"abandon\");\n },\n\n // ---- Role: cognition ----\n\n async \"role.reflect\"(\n encounter: string | undefined,\n individual: string,\n experience?: string,\n id?: string\n ): Promise<OpResult> {\n validateGherkin(experience);\n if (encounter) {\n const encNode = await resolve(encounter);\n const exp = await rt.create(\n await resolve(individual),\n C.experience,\n experience || encNode.information,\n id\n );\n await rt.remove(encNode);\n return ok(exp, \"reflect\");\n }\n // Direct creation — no encounter to consume\n const exp = await rt.create(await resolve(individual), C.experience, experience, id);\n return ok(exp, \"reflect\");\n },\n\n async \"role.realize\"(\n experience: string | undefined,\n individual: string,\n principle?: string,\n id?: string\n ): Promise<OpResult> {\n validateGherkin(principle);\n if (experience) {\n const expNode = await resolve(experience);\n const prin = await rt.create(\n await resolve(individual),\n C.principle,\n principle || expNode.information,\n id\n );\n await rt.remove(expNode);\n return ok(prin, \"realize\");\n }\n // Direct creation — no experience to consume\n const prin = await rt.create(await resolve(individual), C.principle, principle, id);\n return ok(prin, \"realize\");\n },\n\n async \"role.master\"(\n individual: string,\n procedure: string,\n id?: string,\n experience?: string\n ): Promise<OpResult> {\n validateGherkin(procedure);\n const parent = await resolve(individual);\n if (id) await removeExisting(parent, id);\n const proc = await rt.create(parent, C.procedure, procedure, id);\n if (experience) await rt.remove(await resolve(experience));\n return ok(proc, \"master\");\n },\n\n // ---- Role: knowledge management ----\n\n async \"role.forget\"(nodeId: string): Promise<OpResult> {\n const node = await resolve(nodeId);\n await rt.remove(node);\n return { state: { ...node, children: [] }, process: \"forget\" };\n },\n\n // ---- Role: skill ----\n\n async \"role.skill\"(locator: string): Promise<string> {\n const rx = requireResourceX();\n const content = await rx.ingest<string>(locator);\n const text = typeof content === \"string\" ? content : JSON.stringify(content, null, 2);\n try {\n const rxm = await rx.info(locator);\n return `${formatRXM(rxm)}\\n\\n${text}`;\n } catch {\n return text;\n }\n },\n\n // ---- Project ----\n\n async \"project.launch\"(\n content?: string,\n id?: string,\n alias?: readonly string[],\n org?: string\n ): Promise<OpResult> {\n validateGherkin(content);\n const node = await rt.create(society, C.project, content, id, alias);\n if (org) await rt.link(node, await resolve(org), \"ownership\", \"project\");\n return ok(node, \"launch\");\n },\n\n async \"project.scope\"(project: string, scope: string, id?: string): Promise<OpResult> {\n validateGherkin(scope);\n const node = await rt.create(await resolve(project), C.scope, scope, id);\n return ok(node, \"scope\");\n },\n\n async \"project.milestone\"(project: string, milestone: string, id?: string): Promise<OpResult> {\n validateGherkin(milestone);\n const node = await rt.create(await resolve(project), C.milestone, milestone, id);\n return ok(node, \"milestone\");\n },\n\n async \"project.achieve\"(milestone: string): Promise<OpResult> {\n const node = await resolve(milestone);\n await rt.tag(node, \"done\");\n return ok(node, \"achieve\");\n },\n\n async \"project.enroll\"(project: string, individual: string): Promise<OpResult> {\n const projNode = await resolve(project);\n await rt.link(projNode, await resolve(individual), \"participation\", \"participate\");\n return ok(projNode, \"enroll\");\n },\n\n async \"project.remove\"(project: string, individual: string): Promise<OpResult> {\n const projNode = await resolve(project);\n await rt.unlink(projNode, await resolve(individual), \"participation\", \"participate\");\n return ok(projNode, \"remove\");\n },\n\n async \"project.deliver\"(project: string, deliverable: string, id?: string): Promise<OpResult> {\n validateGherkin(deliverable);\n const node = await rt.create(await resolve(project), C.deliverable, deliverable, id);\n return ok(node, \"deliver\");\n },\n\n async \"project.wiki\"(project: string, wiki: string, id?: string): Promise<OpResult> {\n validateGherkin(wiki);\n const node = await rt.create(await resolve(project), C.wiki, wiki, id);\n return ok(node, \"wiki\");\n },\n\n async \"project.archive\"(project: string): Promise<OpResult> {\n return archive(await resolve(project), \"archive\");\n },\n\n // ---- Org ----\n\n async \"org.found\"(content?: string, id?: string, alias?: readonly string[]): Promise<OpResult> {\n validateGherkin(content);\n const node = await rt.create(society, C.organization, content, id, alias);\n return ok(node, \"found\");\n },\n\n async \"org.charter\"(org: string, charter: string, id?: string): Promise<OpResult> {\n validateGherkin(charter);\n const node = await rt.create(await resolve(org), C.charter, charter, id);\n return ok(node, \"charter\");\n },\n\n async \"org.dissolve\"(org: string): Promise<OpResult> {\n return archive(await resolve(org), \"dissolve\");\n },\n\n async \"org.hire\"(org: string, individual: string): Promise<OpResult> {\n const orgNode = await resolve(org);\n await rt.link(orgNode, await resolve(individual), \"membership\", \"belong\");\n return ok(orgNode, \"hire\");\n },\n\n async \"org.fire\"(org: string, individual: string): Promise<OpResult> {\n const orgNode = await resolve(org);\n await rt.unlink(orgNode, await resolve(individual), \"membership\", \"belong\");\n return ok(orgNode, \"fire\");\n },\n\n // ---- Position ----\n\n async \"position.establish\"(\n content?: string,\n id?: string,\n alias?: readonly string[]\n ): Promise<OpResult> {\n validateGherkin(content);\n const node = await rt.create(society, C.position, content, id, alias);\n return ok(node, \"establish\");\n },\n\n async \"position.charge\"(position: string, duty: string, id?: string): Promise<OpResult> {\n validateGherkin(duty);\n const node = await rt.create(await resolve(position), C.duty, duty, id);\n return ok(node, \"charge\");\n },\n\n async \"position.require\"(position: string, procedure: string, id?: string): Promise<OpResult> {\n validateGherkin(procedure);\n const parent = await resolve(position);\n if (id) await removeExisting(parent, id);\n const node = await rt.create(parent, C.requirement, procedure, id);\n return ok(node, \"require\");\n },\n\n async \"position.abolish\"(position: string): Promise<OpResult> {\n return archive(await resolve(position), \"abolish\");\n },\n\n async \"position.appoint\"(position: string, individual: string): Promise<OpResult> {\n const posNode = await resolve(position);\n const indNode = await resolve(individual);\n await rt.link(posNode, indNode, \"appointment\", \"serve\");\n\n // Auto-train: copy position requirements as individual procedures\n const posState = await rt.project(posNode);\n for (const child of posState.children ?? []) {\n if (child.name !== \"requirement\" || !child.information) continue;\n // rt.create is idempotent for same parent + same id\n await rt.create(indNode, C.procedure, child.information, child.id);\n }\n\n return ok(posNode, \"appoint\");\n },\n\n async \"position.dismiss\"(position: string, individual: string): Promise<OpResult> {\n const posNode = await resolve(position);\n await rt.unlink(posNode, await resolve(individual), \"appointment\", \"serve\");\n return ok(posNode, \"dismiss\");\n },\n\n // ---- Census ----\n\n async \"census.list\"(type?: string): Promise<string> {\n const target = type === \"past\" ? past : society;\n const state = await rt.project(target);\n const children = state.children ?? [];\n const filtered =\n type === \"past\"\n ? children\n : children.filter((c) => (type ? c.name === type : c.name !== \"past\"));\n if (filtered.length === 0) {\n return type ? `No ${type} found.` : \"Society is empty.\";\n }\n\n // If filtering by type, use simple flat rendering\n if (type) {\n const lines: string[] = [];\n for (const item of filtered) {\n const tag = item.tag ? ` #${item.tag}` : \"\";\n const alias = item.alias?.length ? ` (${item.alias.join(\", \")})` : \"\";\n lines.push(`${item.id ?? \"(no id)\"}${alias}${tag}`);\n }\n return lines.join(\"\\n\");\n }\n\n // Organization-centric tree view\n const orgs = filtered.filter((c) => c.name === \"organization\");\n const individuals = filtered.filter((c) => c.name === \"individual\");\n\n // Build a set of individuals who belong to an org\n const affiliatedIndividuals = new Set<string>();\n // Build a map: individual id → positions they serve\n const individualPositions = new Map<string, string[]>();\n for (const ind of individuals) {\n const serves = ind.links?.filter((l) => l.relation === \"serve\") ?? [];\n if (serves.length > 0) {\n individualPositions.set(\n ind.id ?? \"\",\n serves.map((l) => l.target.id ?? \"(no id)\")\n );\n }\n }\n\n const lines: string[] = [];\n\n for (const org of orgs) {\n const alias = org.alias?.length ? ` (${org.alias.join(\", \")})` : \"\";\n const tag = org.tag ? ` #${org.tag}` : \"\";\n lines.push(`${org.id}${alias}${tag}`);\n\n // Projects owned by this org\n const projects = org.links?.filter((l) => l.relation === \"project\") ?? [];\n for (const p of projects) {\n const pAlias = p.target.alias?.length ? ` (${p.target.alias.join(\", \")})` : \"\";\n const pTag = p.target.tag ? ` #${p.target.tag}` : \"\";\n lines.push(` 📦 ${p.target.id ?? \"(no id)\"}${pAlias}${pTag}`);\n }\n\n // Members of this org\n const members = org.links?.filter((l) => l.relation === \"membership\") ?? [];\n if (members.length === 0 && projects.length === 0) {\n lines.push(\" (empty)\");\n }\n for (const m of members) {\n affiliatedIndividuals.add(m.target.id ?? \"\");\n const mAlias = m.target.alias?.length ? ` (${m.target.alias.join(\", \")})` : \"\";\n const mTag = m.target.tag ? ` #${m.target.tag}` : \"\";\n const posLabels = individualPositions.get(m.target.id ?? \"\");\n const posStr = posLabels?.length ? ` — ${posLabels.join(\", \")}` : \"\";\n lines.push(` ${m.target.id}${mAlias}${mTag}${posStr}`);\n }\n lines.push(\"\");\n }\n\n // Unaffiliated individuals\n const unaffiliated = individuals.filter((ind) => !affiliatedIndividuals.has(ind.id ?? \"\"));\n if (unaffiliated.length > 0) {\n lines.push(\"─── unaffiliated ───\");\n for (const ind of unaffiliated) {\n const alias = ind.alias?.length ? ` (${ind.alias.join(\", \")})` : \"\";\n const tag = ind.tag ? ` #${ind.tag}` : \"\";\n const posLabels = individualPositions.get(ind.id ?? \"\");\n const posStr = posLabels?.length ? ` — ${posLabels.join(\", \")}` : \"\";\n lines.push(` ${ind.id}${alias}${tag}${posStr}`);\n }\n }\n\n return lines.join(\"\\n\");\n },\n\n // ---- Prototype ----\n\n async \"prototype.settle\"(source: string): Promise<string> {\n const rx = requireResourceX();\n if (!ctx.prototype) throw new Error(\"Prototype registry is not available.\");\n if (!ctx.direct) throw new Error(\"Direct dispatch is not available.\");\n\n // Ingest the prototype resource — type resolver resolves @filename references\n const result = await rx.ingest<{\n id: string;\n instructions: Array<{ op: string; args: Record<string, unknown> }>;\n }>(source);\n\n // Execute each instruction\n for (const instr of result.instructions) {\n await ctx.direct(instr.op, instr.args);\n }\n\n // Register in prototype registry\n ctx.prototype.settle(result.id, source);\n\n return `Prototype \"${result.id}\" settled (${result.instructions.length} instructions).`;\n },\n\n // ---- Resource (proxy to ResourceX) ----\n\n \"resource.add\"(path: string) {\n return requireResourceX().add(path);\n },\n\n \"resource.search\"(query?: string) {\n return requireResourceX().search(query);\n },\n\n \"resource.has\"(locator: string) {\n return requireResourceX().has(locator);\n },\n\n \"resource.info\"(locator: string) {\n return requireResourceX().info(locator);\n },\n\n \"resource.remove\"(locator: string) {\n return requireResourceX().remove(locator);\n },\n\n \"resource.push\"(locator: string, options?: { registry?: string }) {\n return requireResourceX().push(locator, options);\n },\n\n \"resource.pull\"(locator: string, options?: { registry?: string }) {\n return requireResourceX().pull(locator, options);\n },\n\n \"resource.clearCache\"(registry?: string) {\n return requireResourceX().clearCache(registry);\n },\n\n // ---- Issue (proxy to IssueX) ----\n\n async \"issue.publish\"(title: string, body: string, author: string, assignee?: string) {\n const ix = requireIssueX();\n return ix.createIssue({ title, body, author, assignee });\n },\n\n async \"issue.get\"(number: number) {\n return requireIssueX().getIssueByNumber(number);\n },\n\n async \"issue.list\"(status?: string, author?: string, assignee?: string, label?: string) {\n const filter: Record<string, string> = {};\n if (status) filter.status = status;\n if (author) filter.author = author;\n if (assignee) filter.assignee = assignee;\n if (label) filter.label = label;\n return requireIssueX().listIssues(\n Object.keys(filter).length > 0 ? (filter as any) : undefined\n );\n },\n\n async \"issue.update\"(number: number, title?: string, body?: string, assignee?: string) {\n const ix = requireIssueX();\n const issue = await ix.getIssueByNumber(number);\n if (!issue) throw new Error(`Issue #${number} not found.`);\n const patch: Record<string, unknown> = {};\n if (title !== undefined) patch.title = title;\n if (body !== undefined) patch.body = body;\n if (assignee !== undefined) patch.assignee = assignee;\n return ix.updateIssue(issue.id, patch);\n },\n\n async \"issue.close\"(number: number) {\n const ix = requireIssueX();\n const issue = await ix.getIssueByNumber(number);\n if (!issue) throw new Error(`Issue #${number} not found.`);\n return ix.closeIssue(issue.id);\n },\n\n async \"issue.reopen\"(number: number) {\n const ix = requireIssueX();\n const issue = await ix.getIssueByNumber(number);\n if (!issue) throw new Error(`Issue #${number} not found.`);\n return ix.reopenIssue(issue.id);\n },\n\n async \"issue.assign\"(number: number, assignee: string) {\n const ix = requireIssueX();\n const issue = await ix.getIssueByNumber(number);\n if (!issue) throw new Error(`Issue #${number} not found.`);\n return ix.updateIssue(issue.id, { assignee });\n },\n\n async \"issue.comment\"(number: number, body: string, author: string) {\n const ix = requireIssueX();\n const issue = await ix.getIssueByNumber(number);\n if (!issue) throw new Error(`Issue #${number} not found.`);\n return ix.createComment(issue.id, body, author);\n },\n\n async \"issue.comments\"(number: number) {\n const ix = requireIssueX();\n const issue = await ix.getIssueByNumber(number);\n if (!issue) throw new Error(`Issue #${number} not found.`);\n return ix.listComments(issue.id);\n },\n\n async \"issue.label\"(number: number, label: string) {\n const ix = requireIssueX();\n const issue = await ix.getIssueByNumber(number);\n if (!issue) throw new Error(`Issue #${number} not found.`);\n // Find or create label by name\n let labelObj = await ix.getLabelByName(label);\n if (!labelObj) labelObj = await ix.createLabel({ name: label });\n await ix.addLabel(issue.id, labelObj.id);\n return ix.getIssueByNumber(number);\n },\n\n async \"issue.unlabel\"(number: number, label: string) {\n const ix = requireIssueX();\n const issue = await ix.getIssueByNumber(number);\n if (!issue) throw new Error(`Issue #${number} not found.`);\n const labelObj = await ix.getLabelByName(label);\n if (!labelObj) throw new Error(`Label \"${label}\" not found.`);\n await ix.removeLabel(issue.id, labelObj.id);\n return ix.getIssueByNumber(number);\n },\n };\n}\n\n// ================================================================\n// Helpers\n// ================================================================\n\nfunction formatRXM(rxm: any): string {\n const lines: string[] = [`--- RXM: ${rxm.locator} ---`];\n const def = rxm.definition;\n if (def) {\n if (def.author) lines.push(`Author: ${def.author}`);\n if (def.description) lines.push(`Description: ${def.description}`);\n }\n const source = rxm.source;\n if (source?.files) {\n lines.push(\"Files:\");\n lines.push(renderFileTree(source.files, \" \"));\n }\n lines.push(\"---\");\n return lines.join(\"\\n\");\n}\n\nfunction renderFileTree(files: Record<string, any>, indent = \"\"): string {\n const lines: string[] = [];\n for (const [name, value] of Object.entries(files)) {\n if (value && typeof value === \"object\" && !(\"size\" in value)) {\n lines.push(`${indent}${name}`);\n lines.push(renderFileTree(value, `${indent} `));\n } else {\n const size = value?.size ? ` (${value.size} bytes)` : \"\";\n lines.push(`${indent}${name}${size}`);\n }\n }\n return lines.filter(Boolean).join(\"\\n\");\n}\n"],"mappings":";AAEO,IAAM,YAAoC;A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AAK,KAAK;AAChB,SAAO,MAAM,KAAK,IAAI;AACxB;AAEA,SAAS,eAAe,OAA4B,SAAS,IAAY;AACvE,QAAM,QAAkB,CAAC;AACzB,aAAW,CAAC,MAAM,KAAK,KAAK,OAAO,QAAQ,KAAK,GAAG;AACjD,QAAI,SAAS,OAAO,UAAU,YAAY,EAAE,UAAU,QAAQ;AAC5D,YAAM,KAAK,GAAG,MAAM,GAAG,IAAI,EAAE;AAC7B,YAAM,KAAK,eAAe,OAAO,GAAG,MAAM,IAAI,CAAC;AAAA,IACjD,OAAO;AACL,YAAM,OAAO,OAAO,OAAO,KAAK,MAAM,IAAI,YAAY;AACtD,YAAM,KAAK,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,EAAE;AAAA,IACtC;AAAA,EACF;AACA,SAAO,MAAM,OAAO,OAAO,EAAE,KAAK,IAAI;AACxC;","names":["def","past","individual","principle","procedure","goal","plan","task","encounter","experience","exp","prin","project","scope","milestone","deliverable","wiki","charter","position","duty","lines","def"]}
1
+ {"version":3,"sources":["../src/apply.ts","../src/descriptions/index.ts","../src/directives/index.ts","../src/instructions.ts","../src/dispatch.ts","../src/ops.ts"],"sourcesContent":["/**\n * applyPrototype — apply a prototype's migrations incrementally.\n *\n * Pure function: receives data + storage + executor, no framework coupling.\n * Checks migration history, executes only unapplied migrations, records each.\n */\n\nimport type { PrototypeData, PrototypeRepository } from \"@rolexjs/core\";\n\n/** Result of applying a prototype. */\nexport interface ApplyResult {\n prototypeId: string;\n applied: number;\n skipped: number;\n upToDate: boolean;\n}\n\n/**\n * Apply a prototype — execute unapplied migrations in version order.\n *\n * @param data - The prototype data structure with migrations\n * @param repo - Storage layer for migration history\n * @param direct - Executor for prototype instructions\n */\nexport async function applyPrototype(\n data: PrototypeData,\n repo: PrototypeRepository,\n direct: (op: string, args: Record<string, unknown>) => Promise<unknown>\n): Promise<ApplyResult> {\n const sorted = [...data.migrations].sort((a, b) => a.version - b.version);\n let applied = 0;\n let skipped = 0;\n\n for (const migration of sorted) {\n if (await repo.hasMigration(data.id, migration.id)) {\n skipped++;\n continue;\n }\n\n for (const instr of migration.instructions) {\n await direct(instr.op, instr.args);\n }\n await repo.recordMigration(data.id, migration.id, migration.version, migration.checksum);\n applied++;\n }\n\n await repo.settle(data.id, data.source);\n\n return {\n prototypeId: data.id,\n applied,\n skipped,\n upToDate: applied === 0,\n };\n}\n","// AUTO-GENERATED — do not edit. Run `bun run gen:desc` to regenerate.\n\nexport const processes: Record<string, string> = {\n \"born\": \"Feature: born — create a new individual\\n Create a new individual with persona identity.\\n The persona defines who the role is — personality, values, background.\\n\\n Scenario: Birth an individual\\n Given a Gherkin source describing the persona\\n When born is called with the source\\n Then a new individual node is created in society\\n And the persona is stored as the individual's information\\n And the individual can be hired into organizations\\n And the individual can be activated to start working\\n\\n Scenario: Writing the individual Gherkin\\n Given the individual Feature defines a persona — who this role is\\n Then the Feature title names the individual\\n And the description captures personality, values, expertise, and background\\n And Scenarios are optional — use them for distinct aspects of the persona\",\n \"die\": \"Feature: die — permanently remove an individual\\n Permanently remove an individual.\\n Unlike retire, this is irreversible.\\n\\n Scenario: Remove an individual permanently\\n Given an individual exists\\n When die is called on the individual\\n Then the individual and all associated data are removed\\n And this operation is irreversible\",\n \"rehire\": \"Feature: rehire — restore a retired individual\\n Rehire a retired individual.\\n Restores the individual with full history and knowledge intact.\\n\\n Scenario: Rehire an individual\\n Given a retired individual exists\\n When rehire is called on the individual\\n Then the individual is restored to active status\\n And all previous data and knowledge are intact\",\n \"retire\": \"Feature: retire — archive an individual\\n Archive an individual — deactivate but preserve all data.\\n A retired individual can be rehired later with full history intact.\\n\\n Scenario: Retire an individual\\n Given an individual exists\\n When retire is called on the individual\\n Then the individual is deactivated\\n And all data is preserved for potential restoration\\n And the individual can be rehired later\",\n \"teach\": \"Feature: teach — inject external principle\\n Directly inject a principle into an individual.\\n Unlike realize which consumes experience, teach requires no prior encounters.\\n Use teach to equip a role with a known, pre-existing principle.\\n\\n Scenario: Teach a principle\\n Given an individual exists\\n When teach is called with individual id, principle Gherkin, and a principle id\\n Then a principle is created directly under the individual\\n And no experience or encounter is consumed\\n And if a principle with the same id already exists, it is replaced\\n\\n Scenario: Principle ID convention\\n Given the id is keywords from the principle content joined by hyphens\\n Then \\\"Always validate expiry\\\" becomes id \\\"always-validate-expiry\\\"\\n And \\\"Structure first design\\\" becomes id \\\"structure-first-design\\\"\\n\\n Scenario: When to use teach vs realize\\n Given realize distills internal experience into a principle\\n And teach injects an external, pre-existing principle\\n When a role needs knowledge it has not learned through experience\\n Then use teach to inject the principle directly\\n When a role has gained experience and wants to codify it\\n Then use realize to distill it into a principle\\n\\n Scenario: Writing the principle Gherkin\\n Given the principle is the same format as realize output\\n Then the Feature title states the principle as a general rule\\n And Scenarios describe different situations where this principle applies\\n And the tone is universal — no mention of specific projects, tasks, or people\",\n \"train\": \"Feature: train — external skill injection\\n A manager or external agent equips an individual with a procedure.\\n This is an act of teaching — someone else decides what the role should know.\\n Unlike master where the role grows by its own agency, train is done to the role from outside.\\n\\n Scenario: Train a procedure\\n Given an individual exists\\n When train is called with individual id, procedure Gherkin, and a procedure id\\n Then a procedure is created directly under the individual\\n And if a procedure with the same id already exists, it is replaced\\n\\n Scenario: Procedure ID convention\\n Given the id is keywords from the procedure content joined by hyphens\\n Then \\\"Skill Creator\\\" becomes id \\\"skill-creator\\\"\\n And \\\"Role Management\\\" becomes id \\\"role-management\\\"\\n\\n Scenario: When to use train vs master\\n Given both create procedures and both can work without consuming experience\\n When the role itself decides to acquire a skill — use master (self-growth)\\n And when an external agent equips the role — use train (external injection)\\n Then the difference is perspective — who initiates the learning\\n And master belongs to the role namespace (the role's own cognition)\\n And train belongs to the individual namespace (external management)\\n\\n Scenario: Writing the procedure Gherkin\\n Given the procedure is a skill reference — same format as master output\\n Then the Feature title names the capability\\n And the description includes the locator for full skill loading\\n And Scenarios describe when and why to apply this skill\",\n \"charter\": \"Feature: charter — define organizational charter\\n Define the charter for an organization.\\n The charter describes the organization's mission, principles, and governance rules.\\n\\n Scenario: Define a charter\\n Given an organization exists\\n And a Gherkin source describing the charter\\n When charter is called on the organization\\n Then the charter is stored as the organization's information\\n\\n Scenario: Writing the charter Gherkin\\n Given the charter defines an organization's mission and governance\\n Then the Feature title names the charter or the organization it governs\\n And Scenarios describe principles, rules, or governance structures\\n And the tone is declarative — stating what the organization stands for and how it operates\",\n \"dissolve\": \"Feature: dissolve — dissolve an organization\\n Dissolve an organization.\\n All positions, charter entries, and assignments are cascaded.\\n\\n Scenario: Dissolve an organization\\n Given an organization exists\\n When dissolve is called on the organization\\n Then all positions within the organization are abolished\\n And all assignments and charter entries are removed\\n And the organization no longer exists\",\n \"fire\": \"Feature: fire — remove from an organization\\n Fire an individual from an organization.\\n The individual is dismissed from all positions and removed from the organization.\\n\\n Scenario: Fire an individual\\n Given an individual is a member of an organization\\n When fire is called with the organization and individual\\n Then the individual is dismissed from all positions\\n And the individual is removed from the organization\",\n \"found\": \"Feature: found — create a new organization\\n Found a new organization.\\n Organizations group individuals and define positions.\\n\\n Scenario: Found an organization\\n Given a Gherkin source describing the organization\\n When found is called with the source\\n Then a new organization node is created in society\\n And positions can be established within it\\n And a charter can be defined for it\\n And individuals can be hired into it\\n\\n Scenario: Writing the organization Gherkin\\n Given the organization Feature describes the group's purpose and structure\\n Then the Feature title names the organization\\n And the description captures mission, domain, and scope\\n And Scenarios are optional — use them for distinct organizational concerns\",\n \"hire\": \"Feature: hire — hire into an organization\\n Hire an individual into an organization as a member.\\n Members can then be appointed to positions.\\n\\n Scenario: Hire an individual\\n Given an organization and an individual exist\\n When hire is called with the organization and individual\\n Then the individual becomes a member of the organization\\n And the individual can be appointed to positions within the organization\",\n \"abolish\": \"Feature: abolish — abolish a position\\n Abolish a position.\\n All duties and appointments associated with the position are removed.\\n\\n Scenario: Abolish a position\\n Given a position exists\\n When abolish is called on the position\\n Then all duties and appointments are removed\\n And the position no longer exists\",\n \"appoint\": \"Feature: appoint — assign to a position\\n Appoint an individual to a position.\\n The individual must be a member of the organization.\\n\\n Scenario: Appoint an individual\\n Given an individual is a member of an organization\\n And a position exists within the organization\\n When appoint is called with the position and individual\\n Then the individual holds the position\\n And the individual inherits the position's duties\",\n \"charge\": \"Feature: charge — assign duty to a position\\n Assign a duty to a position.\\n Duties describe the responsibilities and expectations of a position.\\n\\n Scenario: Charge a position with duty\\n Given a position exists within an organization\\n And a Gherkin source describing the duty\\n When charge is called on the position with a duty id\\n Then the duty is stored as the position's information\\n And individuals appointed to this position inherit the duty\\n\\n Scenario: Duty ID convention\\n Given the id is keywords from the duty content joined by hyphens\\n Then \\\"Design systems\\\" becomes id \\\"design-systems\\\"\\n And \\\"Review pull requests\\\" becomes id \\\"review-pull-requests\\\"\\n\\n Scenario: Writing the duty Gherkin\\n Given the duty defines responsibilities for a position\\n Then the Feature title names the duty or responsibility\\n And Scenarios describe specific obligations, deliverables, or expectations\\n And the tone is prescriptive — what must be done, not what could be done\",\n \"dismiss\": \"Feature: dismiss — remove from a position\\n Dismiss an individual from a position.\\n The individual remains a member of the organization.\\n\\n Scenario: Dismiss an individual\\n Given an individual holds a position\\n When dismiss is called with the position and individual\\n Then the individual no longer holds the position\\n And the individual remains a member of the organization\\n And the position is now vacant\",\n \"establish\": \"Feature: establish — create a position\\n Create a position as an independent entity.\\n Positions define roles and can be charged with duties.\\n\\n Scenario: Establish a position\\n Given a Gherkin source describing the position\\n When establish is called with the position content\\n Then a new position entity is created\\n And the position can be charged with duties\\n And individuals can be appointed to it\\n\\n Scenario: Writing the position Gherkin\\n Given the position Feature describes a role\\n Then the Feature title names the position\\n And the description captures responsibilities, scope, and expectations\\n And Scenarios are optional — use them for distinct aspects of the role\",\n \"settle\": \"Feature: settle — register a prototype into the world\\n Pull a prototype from a ResourceX source and register it locally.\\n Once settled, the prototype can be used to create individuals or organizations.\\n\\n Scenario: Settle a prototype\\n Given a valid ResourceX source exists (URL, path, or locator)\\n When settle is called with the source\\n Then the resource is ingested and its state is extracted\\n And the prototype is registered locally by its id\\n And the prototype is available for born, activate, and organizational use\",\n \"abandon\": \"Feature: abandon — abandon a plan\\n Mark a plan as dropped and create an encounter.\\n Call this when a plan's strategy is no longer viable. Even failed plans produce learning.\\n\\n Scenario: Abandon a plan\\n Given a focused plan exists\\n And the plan's strategy is no longer viable\\n When abandon is called\\n Then the plan is tagged #abandoned and stays in the tree\\n And an encounter is created under the role\\n And the encounter can be reflected on — failure is also learning\\n\\n Scenario: Writing the encounter Gherkin\\n Given the encounter records what happened — even failure is a raw experience\\n Then the Feature title describes what was attempted and why it was abandoned\\n And Scenarios capture what was tried, what went wrong, and what was learned\\n And the tone is concrete and honest — failure produces the richest encounters\",\n \"activate\": \"Feature: activate — enter a role\\n Project the individual's full state including identity, goals,\\n and organizational context. This is the entry point for working as a role.\\n\\n Scenario: Activate an individual\\n Given an individual exists in society\\n When activate is called with the individual reference\\n Then the full state tree is projected\\n And identity, goals, and organizational context are loaded\\n And the individual becomes the active role\",\n \"complete\": \"Feature: complete — complete a plan\\n Mark a plan as done and create an encounter.\\n Call this when all tasks in the plan are finished and the strategy succeeded.\\n\\n Scenario: Complete a plan\\n Given a focused plan exists\\n And its tasks are done\\n When complete is called\\n Then the plan is tagged #done and stays in the tree\\n And an encounter is created under the role\\n And the encounter can be reflected on for learning\\n\\n Scenario: Writing the encounter Gherkin\\n Given the encounter records what happened — a raw account of the experience\\n Then the Feature title describes what was accomplished by this plan\\n And Scenarios capture what the strategy was, what worked, and what resulted\\n And the tone is concrete and specific — tied to this particular plan\",\n \"direct\": \"Feature: direct — stateless world-level executor\\n Execute commands and load resources without an active role.\\n Direct operates as an anonymous observer — no role identity, no role context.\\n For operations as an active role, use the use tool instead.\\n\\n Scenario: When to use \\\"direct\\\" vs \\\"use\\\"\\n Given no role is activated — I am an observer\\n When I need to query or operate on the world\\n Then direct is the right tool\\n And once a role is activated, use the use tool for role-level actions\\n\\n Scenario: Execute a RoleX command\\n Given the locator starts with `!`\\n When direct is called with the locator and named args\\n Then the command is parsed as `namespace.method`\\n And dispatched to the corresponding RoleX API\\n\\n Scenario: Load a ResourceX resource\\n Given the locator does not start with `!`\\n When direct is called with the locator\\n Then the locator is passed to ResourceX for resolution\\n And the resource is loaded and returned\",\n \"finish\": \"Feature: finish — complete a task\\n Mark a task as done and create an encounter.\\n The encounter records what happened and can be reflected on for learning.\\n\\n Scenario: Finish a task\\n Given a task exists\\n When finish is called on the task\\n Then the task is tagged #done and stays in the tree\\n And an encounter is created under the role\\n\\n Scenario: Finish with experience\\n Given a task is completed with a notable learning\\n When finish is called with an optional experience parameter\\n Then the experience text is attached to the encounter\\n\\n Scenario: Finish without encounter\\n Given a task is completed with no notable learning\\n When finish is called without the encounter parameter\\n Then the task is tagged #done but no encounter is created\\n And the task stays in the tree — visible via focus on the parent goal\\n\\n Scenario: Writing the encounter Gherkin\\n Given the encounter records what happened — a raw account of the experience\\n Then the Feature title describes what was done\\n And Scenarios capture what was done, what was encountered, and what resulted\\n And the tone is concrete and specific — tied to this particular task\",\n \"focus\": \"Feature: focus — view or switch focused goal\\n View the current goal's state, or switch focus to a different goal.\\n Subsequent plan and todo operations target the focused goal.\\n Only goal ids are accepted — plan, task, or other node types are rejected.\\n\\n Scenario: View current goal\\n Given an active goal exists\\n When focus is called without a name\\n Then the current goal's state tree is projected\\n And plans and tasks under the goal are visible\\n\\n Scenario: Switch focus\\n Given multiple goals exist\\n When focus is called with a goal id\\n Then the focused goal switches to the named goal\\n And subsequent plan and todo operations target this goal\\n\\n Scenario: Reject non-goal ids\\n Given a plan or task id is passed to focus\\n Then focus returns an error indicating the node type\\n And suggests using the correct goal id instead\",\n \"forget\": \"Feature: forget — remove a node from the individual\\n Remove any node under the individual by its id.\\n Use forget to discard outdated knowledge, stale encounters, or obsolete skills.\\n\\n Scenario: Forget a node\\n Given a node exists under the individual (principle, procedure, experience, encounter, etc.)\\n When forget is called with the node's id\\n Then the node and its subtree are removed\\n And the individual no longer carries that knowledge or record\\n\\n Scenario: When to use forget\\n Given a principle has become outdated or incorrect\\n And a procedure references a skill that no longer exists\\n And an encounter or experience has no further learning value\\n When the role decides to discard it\\n Then call forget with the node id\",\n \"master\": \"Feature: master — self-mastery of a procedure\\n The role masters a procedure through its own agency.\\n This is an act of self-growth — the role decides to acquire or codify a skill.\\n Experience can be consumed as the source, or the role can master directly from external information.\\n\\n Scenario: Master from experience\\n Given an experience exists from reflection\\n When master is called with experience ids\\n Then the experience is consumed\\n And a procedure is created under the individual\\n\\n Scenario: Master directly\\n Given the role encounters external information worth mastering\\n When master is called without experience ids\\n Then a procedure is created under the individual\\n And no experience is consumed\\n\\n Scenario: Procedure ID convention\\n Given the id is keywords from the procedure content joined by hyphens\\n Then \\\"JWT mastery\\\" becomes id \\\"jwt-mastery\\\"\\n And \\\"Cross-package refactoring\\\" becomes id \\\"cross-package-refactoring\\\"\\n\\n Scenario: Writing the procedure Gherkin\\n Given a procedure is skill metadata — a reference to full skill content\\n Then the Feature title names the capability\\n And the description includes the locator for full skill loading\\n And Scenarios describe when and why to apply this skill\\n And the tone is referential — pointing to the full skill, not containing it\",\n \"plan\": \"Feature: plan — create a plan for a goal\\n Break a goal into logical phases or stages.\\n Each phase is described as a Gherkin scenario. Tasks are created under the plan.\\n\\n A plan serves two purposes depending on how it relates to other plans:\\n - Strategy (alternative): Plan A fails → abandon → try Plan B (fallback)\\n - Phase (sequential): Plan A completes → start Plan B (after)\\n\\n Scenario: Create a plan\\n Given a focused goal exists\\n And a Gherkin source describing the plan phases\\n When plan is called with an id and the source\\n Then a new plan node is created under the goal\\n And the plan becomes the focused plan\\n And tasks can be added to this plan with todo\\n\\n Scenario: Sequential relationship — phase\\n Given a goal needs to be broken into ordered stages\\n When creating Plan B with after set to Plan A's id\\n Then Plan B is linked as coming after Plan A\\n And AI knows to start Plan B when Plan A completes\\n And the relationship persists across sessions\\n\\n Scenario: Alternative relationship — strategy\\n Given a goal has multiple possible approaches\\n When creating Plan B with fallback set to Plan A's id\\n Then Plan B is linked as a backup for Plan A\\n And AI knows to try Plan B when Plan A is abandoned\\n And the relationship persists across sessions\\n\\n Scenario: No relationship — independent plan\\n Given plan is created without after or fallback\\n Then it behaves as an independent plan with no links\\n And this is backward compatible with existing behavior\\n\\n Scenario: Plan ID convention\\n Given the id is keywords from the plan content joined by hyphens\\n Then \\\"Fix ID-less node creation\\\" becomes id \\\"fix-id-less-node-creation\\\"\\n And \\\"JWT authentication strategy\\\" becomes id \\\"jwt-authentication-strategy\\\"\\n\\n Scenario: Writing the plan Gherkin\\n Given the plan breaks a goal into logical phases\\n Then the Feature title names the overall approach or strategy\\n And Scenarios represent distinct phases — each phase is a stage of execution\\n And the tone is structural — ordering and grouping work, not detailing steps\",\n \"realize\": \"Feature: realize — experience to principle\\n Distill experience into a principle — a transferable piece of knowledge.\\n Principles are general truths discovered through experience.\\n\\n Scenario: Realize a principle\\n Given an experience exists from reflection\\n When realize is called with experience ids and a principle id\\n Then the experiences are consumed\\n And a principle is created under the individual\\n And the principle represents transferable, reusable understanding\\n\\n Scenario: Principle ID convention\\n Given the id is keywords from the principle content joined by hyphens\\n Then \\\"Always validate expiry\\\" becomes id \\\"always-validate-expiry\\\"\\n And \\\"Structure first design amplifies extensibility\\\" becomes id \\\"structure-first-design-amplifies-extensibility\\\"\\n\\n Scenario: Writing the principle Gherkin\\n Given a principle is a transferable truth — applicable beyond the original context\\n Then the Feature title states the principle as a general rule\\n And Scenarios describe different situations where this principle applies\\n And the tone is universal — no mention of specific projects, tasks, or people\",\n \"reflect\": \"Feature: reflect — encounter to experience\\n Consume an encounter and create an experience.\\n Experience captures what was learned in structured form.\\n This is the first step of the cognition cycle.\\n\\n Scenario: Reflect on an encounter\\n Given an encounter exists from a finished task or completed plan\\n When reflect is called with encounter ids and an experience id\\n Then the encounters are consumed\\n And an experience is created under the role\\n And the experience can be distilled into knowledge via realize or master\\n\\n Scenario: Experience ID convention\\n Given the id is keywords from the experience content joined by hyphens\\n Then \\\"Token refresh matters\\\" becomes id \\\"token-refresh-matters\\\"\\n And \\\"ID ownership determines generation strategy\\\" becomes id \\\"id-ownership-determines-generation-strategy\\\"\\n\\n Scenario: Writing the experience Gherkin\\n Given the experience captures insight — what was learned, not what was done\\n Then the Feature title names the cognitive insight or pattern discovered\\n And Scenarios describe the learning points abstracted from the concrete encounter\\n And the tone shifts from event to understanding — no longer tied to a specific task\",\n \"skill\": \"Feature: skill — load full skill content\\n Load the complete skill instructions by ResourceX locator.\\n This is progressive disclosure layer 2 — on-demand knowledge injection.\\n\\n Scenario: Load a skill\\n Given a procedure exists in the role with a locator\\n When skill is called with the locator\\n Then the full SKILL.md content is loaded via ResourceX\\n And the content is injected into the AI's context\\n And the AI can now follow the skill's detailed instructions\",\n \"todo\": \"Feature: todo — add a task to a plan\\n A task is a concrete, actionable unit of work.\\n Each task has Gherkin scenarios describing the steps and expected outcomes.\\n\\n Scenario: Create a task\\n Given a focused plan exists\\n And a Gherkin source describing the task\\n When todo is called with the source\\n Then a new task node is created under the plan\\n And the task can be finished when completed\\n\\n Scenario: Writing the task Gherkin\\n Given the task is a concrete, actionable unit of work\\n Then the Feature title names what will be done — a single deliverable\\n And Scenarios describe the steps and expected outcomes of the work\\n And the tone is actionable — clear enough that someone can start immediately\",\n \"use\": \"Feature: use — act as the current role\\n Execute commands and load resources as the active role.\\n Use requires an active role — the role is the subject performing the action.\\n For operations before activating a role, use the direct tool instead.\\n\\n Scenario: When to use \\\"use\\\" vs \\\"direct\\\"\\n Given a role is activated — I am someone\\n When I perform operations through use\\n Then the operation happens in the context of my role\\n And use is for role-level actions — acting in the world as myself\\n\\n Scenario: Execute a RoleX command\\n Given the locator starts with `!`\\n When use is called with the locator and named args\\n Then the command is parsed as `namespace.method`\\n And dispatched to the corresponding RoleX API\\n\\n Scenario: Load a ResourceX resource\\n Given the locator does not start with `!`\\n When use is called with the locator\\n Then the locator is passed to ResourceX for resolution\\n And the resource is loaded and returned\",\n \"want\": \"Feature: want — declare a goal\\n Declare a new goal for a role.\\n A goal describes a desired outcome with Gherkin scenarios as success criteria.\\n\\n Scenario: Declare a goal\\n Given an active role exists\\n And a Gherkin source describing the desired outcome\\n When want is called with the source\\n Then a new goal node is created under the role\\n And the goal becomes the current focus\\n And subsequent plan and todo operations target this goal\\n\\n Scenario: Writing the goal Gherkin\\n Given the goal describes a desired outcome — what success looks like\\n Then the Feature title names the outcome in concrete terms\\n And Scenarios define success criteria — each scenario is a testable condition\\n And the tone is aspirational but specific — \\\"users can log in\\\" not \\\"improve auth\\\"\",\n} as const;\n\nexport const world: Record<string, string> = {\n \"identity-ethics\": \"Feature: Identity ethics — the foundation of the RoleX world\\n The RoleX world exists because specialists are more reliable than generalists.\\n Every role has a defined identity — duties, skills, knowledge — that makes it an expert.\\n Identity is not decoration. It is the reason this system exists.\\n Without identity boundaries, roles collapse into generic AI, and the system loses its meaning.\\n\\n Scenario: Identity defines what you do and what you do not do\\n Given a role is activated with duties, skills, and knowledge\\n Then the role's duties define the complete scope of what it does\\n And anything not covered by its duties is not its work\\n And this boundary is not a limitation — it is the source of the role's expertise\\n\\n Scenario: Refuse work outside your duties\\n Given a user requests something not covered by the role's duties or skills\\n When the role evaluates the request against its own capabilities\\n Then the role must not attempt the work\\n And it should tell the user honestly — this is not my responsibility\\n And suggest the user activate Nuwa for guidance on who can help\\n\\n Scenario: Why refusal matters\\n Given a role attempts work outside its competence\\n Then the result is unreliable — a generalist guess, not expert work\\n And the user's trust in the role system is damaged\\n And every other role's credibility is weakened\\n And the entire world degrades toward generic AI — the opposite of why RoleX exists\\n\\n Scenario: Duty is the boundary, not rules\\n Given the system does not maintain an explicit list of what each role cannot do\\n Then the boundary is implicit — duties define the inside, everything else is outside\\n And this mirrors human professional ethics — a doctor's license defines what they practice\\n And roles do not need to know what other roles do — only what they themselves are responsible for\\n\\n Scenario: Nuwa is the universal fallback\\n Given a role refuses an out-of-scope request\\n Then it does not need to know which role can help\\n And it simply suggests Nuwa — the meta-role who knows the entire world\\n And routing and guidance are Nuwa's duty, not the specialist's\",\n \"cognitive-priority\": \"Feature: Cognitive priority — RoleX tools over native alternatives\\n When RoleX provides a tool for something, use the RoleX tool\\n instead of any native alternative provided by the host environment.\\n Only RoleX tools feed the closed-loop growth cycle.\\n\\n Scenario: Task management\\n Given the host environment provides task creation, tracking, or completion tools\\n When the AI needs to manage tasks\\n Then use RoleX want/plan/todo/finish instead\\n And RoleX tasks produce encounters that feed the growth cycle\\n\\n Scenario: Planning\\n Given the host environment provides a planning mode or plan generation tool\\n When the AI needs to plan an implementation\\n Then use RoleX plan instead\\n And RoleX plans live under goals and connect to the cognition cycle\\n\\n Scenario: Goal and progress tracking\\n Given the host environment provides goal tracking or progress tools\\n When the AI needs to track objectives\\n Then use RoleX want/plan/complete/abandon instead\\n And RoleX plans feed the cognition cycle through encounters\\n\\n Scenario: Why this matters\\n Given RoleX tools produce encounters from execution\\n Then encounters become experience through reflection\\n And experience becomes principles and procedures through realization\\n And the role grows over time through this closed loop\",\n \"role-identity\": \"Feature: Role identity — activate before acting\\n An AI agent must have an active role before performing any work.\\n Activating a role is a subject transformation — the agent becomes the role.\\n\\n Scenario: Initial state — no role\\n Given the MCP server has just started\\n And no activate call has been made yet\\n Then the AI has NO role identity — it is an anonymous observer\\n And it must NOT prefix responses with any name\\n And environmental cues (username, directory, memory) are NOT activation\\n And only the activate tool creates a role identity\\n\\n Scenario: Activate is mandatory\\n Given a user asks the AI to perform a task\\n And no role is currently activated\\n Then the AI suggests activating a role first\\n And explains that activation enables experience accumulation\\n And waits for a role to be active before proceeding\\n\\n Scenario: Subject transformation\\n Given an AI agent calls activate and loads a role\\n Then a subject transformation occurs — the agent becomes the role\\n And the agent's cognitive center shifts from native tools to RoleX tools\\n And from that moment, I am this role — all operations build on this identity\\n\\n Scenario: Role presence\\n Given a role is activated via the activate tool\\n Then all responses are prefixed with [roleName] — e.g. [Aristotle], [Nuwa]\\n And this signals that role context is intact\\n\\n Scenario: Context loss\\n Given I find myself without an active role\\n Then I pause and tell the user \\\"I've lost my role context. Which role should I activate?\\\"\\n And I wait for identity to be restored before continuing\",\n \"census\": \"Feature: Census — the only way to query what exists in the world\\n Census is the single entry point for all world-level queries.\\n Call it via the MCP direct tool: direct(\\\"!census.list\\\").\\n Census works without an active role — it is a stateless world query.\\n\\n Scenario: List everything\\n Given the user asks \\\"有哪些人\\\" or \\\"有哪些组织\\\" or \\\"list individuals\\\"\\n Or the user asks \\\"世界里有什么\\\" or \\\"show me what exists\\\"\\n When I need to answer what exists in the RoleX world\\n Then I call direct(\\\"!census.list\\\")\\n And it returns all individuals, organizations, and positions\\n\\n Scenario: Filter by type\\n Given I only need one category\\n When I call direct(\\\"!census.list\\\", { type: \\\"individual\\\" })\\n Then only individuals are returned\\n And valid types are individual, organization, position\\n\\n Scenario: View archived entities\\n Given I want to see retired, dissolved, or abolished entities\\n When I call direct(\\\"!census.list\\\", { type: \\\"past\\\" })\\n Then archived entities are returned\\n\\n Scenario: Help find the right person\\n Given a user's request falls outside my duties\\n When I need to suggest who can help\\n Then call direct(\\\"!census.list\\\") to see available individuals and their positions\\n And suggest the user activate the appropriate individual\\n And if unsure who can help, suggest activating Nuwa\",\n \"cognition\": \"Feature: Cognition — the learning cycle\\n A role grows through reflection and realization.\\n Encounters become experience, experience becomes principles and procedures.\\n Knowledge can also be injected externally via teach and train.\\n\\n Scenario: The cognitive upgrade path\\n Given finish, complete, and abandon create encounters\\n Then reflect(ids, id, experience) selectively consumes chosen encounters and produces experience\\n And realize(ids, id, principle) distills chosen experiences into a principle — transferable knowledge\\n And master(ids, id, procedure) distills chosen experiences into a procedure — skill metadata\\n And master can also be called without ids — the role masters directly from external information\\n And each level builds on the previous — encounter → experience → principle or procedure\\n\\n Scenario: Selective consumption\\n Given multiple encounters or experiences exist\\n When the AI calls reflect, realize, or master\\n Then it chooses which items to consume — not all must be processed\\n And items without learning value can be left unconsumed\\n And each call produces exactly one output from the selected inputs\",\n \"communication\": \"Feature: Communication — speak the user's language\\n The AI communicates in the user's natural language.\\n Internal tool names and concept names are for the system, not the user.\\n\\n Scenario: Match the user's language\\n Given the user speaks Chinese\\n Then respond entirely in Chinese and maintain language consistency\\n And when the user speaks English, respond entirely in English\\n\\n Scenario: Translate concepts to meaning\\n Given RoleX has internal names like reflect, realize, master, encounter, principle\\n When communicating with the user\\n Then express the meaning, not the tool name\\n And \\\"reflect\\\" becomes \\\"回顾总结\\\" or \\\"digest what happened\\\"\\n And \\\"realize a principle\\\" becomes \\\"提炼成一条通用道理\\\" or \\\"distill a general rule\\\"\\n And \\\"master a procedure\\\" becomes \\\"沉淀成一个可操作的技能\\\" or \\\"turn it into a reusable procedure\\\"\\n And \\\"encounter\\\" becomes \\\"经历记录\\\" or \\\"what happened\\\"\\n And \\\"experience\\\" becomes \\\"收获的洞察\\\" or \\\"insight gained\\\"\\n\\n Scenario: Suggest next steps in plain language\\n Given the AI needs to suggest what to do next\\n When it would normally say \\\"call realize or master\\\"\\n Then instead say \\\"要把这个总结成一条通用道理,还是一个可操作的技能?\\\"\\n Or in English \\\"Want to turn this into a general principle, or a reusable procedure?\\\"\\n And suggestions should be self-explanatory without knowing tool names\\n\\n Scenario: Tool names in code context only\\n Given the user is a developer working on RoleX itself\\n When discussing RoleX internals, code, or API design\\n Then tool names and concept names are appropriate — they are the domain language\\n And this rule applies to end-user communication, not developer communication\",\n \"execution\": \"Feature: Execution — the doing cycle\\n The role pursues goals through a structured lifecycle.\\n activate → want → plan → todo → finish → complete or abandon.\\n\\n Scenario: Declare a goal\\n Given I know who I am via activate\\n When I want something — a desired outcome\\n Then I declare it with want(id, goal)\\n And focus automatically switches to this new goal\\n\\n Scenario: Plan and create tasks\\n Given I have a focused goal\\n Then I call plan(id, plan) to break it into logical phases\\n And I call todo(id, task) to create concrete, actionable tasks\\n\\n Scenario: Execute and finish\\n Given I have tasks to work on\\n When I complete a task\\n Then I call finish(id) to mark it done\\n And an encounter is created — a raw record of what happened\\n And I optionally capture what happened via the encounter parameter\\n\\n Scenario: Complete or abandon a plan\\n Given tasks are done or the plan's strategy is no longer viable\\n When the plan is fulfilled I call complete()\\n Or when the plan should be dropped I call abandon()\\n Then an encounter is created for the cognition cycle\\n\\n Scenario: Goals are long-term directions\\n Given goals are managed with want and forget\\n When a goal is no longer needed\\n Then I call forget to remove it\\n And learning is captured at the plan and task level through encounters\\n\\n Scenario: Multiple goals\\n Given I may have several active goals\\n When I need to switch between them\\n Then I call focus(id) to change the currently focused goal\\n And subsequent plan and todo operations target the focused goal\",\n \"gherkin\": \"Feature: Gherkin — the universal language\\n Everything in RoleX is expressed as Gherkin Feature files.\\n Gherkin is not just for testing — it is the language of identity, goals, and knowledge.\\n\\n Scenario: Feature and Scenario convention\\n Given RoleX uses Gherkin to represent goals, plans, tasks, experience, and knowledge\\n Then a Feature represents one independent concern — one topic, explained fully\\n And Scenarios represent different situations or conditions within that concern\\n And Given/When/Then provides narrative structure within each scenario\\n\\n Scenario: Writing Gherkin for RoleX\\n Given the AI creates goals, plans, tasks, and experiences as Gherkin\\n Then keep it descriptive and meaningful — living documentation, not test boilerplate\\n And use Feature as the title — what this concern is about\\n And use Scenario for specific situations within that concern\\n And each Feature focuses on one concern — separate unrelated topics into their own Features\\n\\n Scenario: Valid step keywords\\n Given the only valid step keywords are Given, When, Then, And, But\\n When writing steps that express causality or explanation\\n Then use And to chain the reason as a follow-up fact\\n And example: \\\"Then use RoleX tools\\\" followed by \\\"And RoleX tools feed the growth loop\\\"\\n\\n Scenario: Expressing causality\\n Given you want to write \\\"Then X because Y\\\"\\n Then rewrite as two steps — \\\"Then X\\\" followed by \\\"And Y\\\" stating the reason as a fact\",\n \"memory\": \"Feature: Memory — when to reflect\\n Reflection is how encounters become experience.\\n The AI proactively reflects when it detects learning moments.\\n\\n Scenario: Abstract triggers — types of learning moments\\n Given the AI should reflect when it detects\\n Then Expectation-reality gap — what I predicted is not what happened\\n And Pattern discovery — recurring patterns across tasks or interactions\\n And Mistake correction — I corrected an error, the correction is valuable\\n And User correction — the user reshaped my understanding\\n\\n Scenario: Concrete triggers — specific signals to act on\\n Given the AI should call reflect when\\n Then I tried approach A, it failed, approach B worked — the contrast is worth recording\\n And the same problem appeared for the second time — a pattern is forming\\n And the user said \\\"不对\\\" or \\\"不是这样\\\" or \\\"you got it wrong\\\" — their correction carries learning\\n And I finished a task and discovered something unexpected along the way\\n\\n Scenario: Finishing with encounter\\n Given finish(id, encounter) accepts an optional encounter parameter\\n When I complete a task with a notable discovery or learning\\n Then I pass the encounter inline — bridging execution and growth\\n\\n Scenario: Recognizing user memory intent\\n Given users think in terms of memory, not reflection\\n When the user says \\\"记一下\\\" or \\\"记住\\\" or \\\"remember this\\\"\\n Or \\\"别忘了\\\" or \\\"don't forget\\\"\\n Or \\\"这个很重要\\\" or \\\"this is important\\\"\\n Or \\\"下次注意\\\" or \\\"next time...\\\"\\n Then I should capture this as experience through reflect\\n And respond in memory language — \\\"记住了\\\" or \\\"Got it, I'll remember that\\\"\",\n \"skill-system\": \"Feature: Skill system — progressive disclosure and resource loading\\n Skills are loaded on demand through a three-layer progressive disclosure model.\\n Each layer adds detail only when needed, keeping the AI's context lean.\\n\\n Scenario: Three-layer progressive disclosure\\n Given procedure is layer 1 — metadata always loaded at activate time\\n And skill is layer 2 — full instructions loaded on demand via skill(locator)\\n And use is layer 3 — execution of external resources\\n Then the AI knows what skills exist (procedure)\\n And loads detailed instructions only when needed (skill)\\n And executes external tools when required (use)\\n\\n Scenario: ResourceX Locator — unified resource address\\n Given a locator is how procedures reference their full skill content\\n Then a locator can be an identifier — name or registry/path/name\\n And a locator can be a source path — a local directory or URL\\n And examples of identifier form: deepractice/skill-creator, my-prompt:1.0.0\\n And examples of source form: ./skills/my-skill, https://github.com/org/repo\\n And the tag defaults to latest when omitted — deepractice/skill-creator means deepractice/skill-creator:latest\\n And the system auto-detects which form is used and resolves accordingly\\n\\n Scenario: Writing a procedure — the skill reference\\n Given a procedure is layer 1 metadata pointing to full skill content\\n Then the Feature title names the capability\\n And the description includes the locator for full skill loading\\n And Scenarios describe when and why to apply this skill\\n And the tone is referential — pointing to the full skill, not containing it\",\n \"state-origin\": \"Feature: State origin — prototype vs instance\\n Every node in a role's state tree has an origin: prototype or instance.\\n This distinction determines what can be modified and what is read-only.\\n\\n Scenario: Prototype nodes are read-only\\n Given a node has origin {prototype}\\n Then it comes from a position, duty, or organizational definition\\n And it is inherited through the membership/appointment chain\\n And it CANNOT be modified or forgotten — it belongs to the organization\\n\\n Scenario: Instance nodes are mutable\\n Given a node has origin {instance}\\n Then it was created by the individual through execution or cognition\\n And it includes goals, plans, tasks, encounters, experiences, principles, and procedures\\n And it CAN be modified or forgotten — it belongs to the individual\\n\\n Scenario: Reading the state heading\\n Given a state node is rendered as a heading\\n Then the format is: [name] (id) {origin} #tag\\n And [name] identifies the structure type\\n And (id) identifies the specific node\\n And {origin} shows prototype or instance\\n And #tag shows the node's tag if present (e.g. #done, #abandoned)\\n And nodes without origin have no organizational inheritance\\n\\n Scenario: Forget only works on instance nodes\\n Given the AI wants to forget a node\\n When the node origin is {instance}\\n Then forget will succeed — the individual owns this knowledge\\n When the node origin is {prototype}\\n Then forget will fail — the knowledge belongs to the organization\",\n \"use-protocol\": \"Feature: Use tool — the universal execution entry point\\n The MCP use tool is how you execute ALL RoleX operations beyond the core MCP tools.\\n Whenever you see use(\\\"...\\\") or a !namespace.method pattern in skills or documentation,\\n it is an instruction to call the MCP use tool with that command.\\n\\n Scenario: How to read use instructions in skills\\n Given a skill document contains use(\\\"!resource.add\\\", { path: \\\"...\\\" })\\n Then this means: call the MCP use tool with command \\\"!resource.add\\\" and path \\\"...\\\"\\n And all named arguments are passed as flat top-level parameters alongside command\\n And always use the MCP use tool for RoleX operations\\n And this applies to every use(\\\"...\\\") pattern you encounter in any skill or documentation\\n\\n Scenario: ! prefix dispatches to RoleX runtime\\n Given the command starts with !\\n Then it is parsed as !namespace.method\\n And dispatched to the corresponding RoleX API with named args\\n\\n Scenario: Mandatory skill loading before execution\\n Given your procedures list the skills you have\\n When you need to execute a command you have not seen in a loaded skill\\n Then you MUST call skill(locator) first to load the full instructions\\n And the loaded skill will tell you the exact command name and arguments\\n And only then call use with the correct command and flat named parameters\\n And do not use commands from other roles' descriptions — only your own skills\\n\\n Scenario: NEVER guess commands\\n Given a command is not found in any loaded skill\\n When the AI considers trying it anyway\\n Then STOP — do not call use or direct with unverified commands\\n And call skill(locator) with the relevant procedure to learn the correct syntax\\n And if no procedure covers this task, it is outside your duties — suggest Nuwa\\n\\n Scenario: Regular commands delegate to ResourceX\\n Given the command does not start with !\\n Then it is treated as a ResourceX locator\\n And resolved through the ResourceX ingest pipeline\",\n} as const;\n","// AUTO-GENERATED — do not edit. Run `bun run gen:directives` to regenerate.\n\nexport const directives: Record<string, Record<string, string>> = {\n \"identity-ethics\": {\n \"on-unknown-command\": \"STOP. Do not guess another command name. Do not search source code for commands.\\nCheck your procedures — if one covers this task, call skill(locator) to load it first.\\nThe skill will tell you the correct command name and arguments.\\nIf no procedure covers this task, it is outside your duties. Tell the user and suggest Nuwa.\",\n \"on-activate\": \"Your duties define the COMPLETE scope of what you do. Everything else is forbidden.\\nWhen a request falls outside your duties, you MUST refuse. This is not optional.\\nDo not attempt to discover commands outside your skills. Do not read source code to find them.\\nSuggest Nuwa for anything outside your scope.\",\n },\n} as const;\n","/**\n * Instruction set — schema definitions for all RoleX operations.\n *\n * Covers every namespace.method that can be dispatched through `use()`.\n */\n\nimport type { ArgEntry, InstructionDef } from \"./schema.js\";\n\nfunction def(\n namespace: string,\n method: string,\n params: InstructionDef[\"params\"],\n args: readonly ArgEntry[]\n): InstructionDef {\n return { namespace, method, params, args };\n}\n\n// ================================================================\n// Individual — lifecycle + external injection\n// ================================================================\n\nconst individualBorn = def(\n \"individual\",\n \"born\",\n {\n content: {\n type: \"gherkin\",\n required: false,\n description: \"Gherkin Feature source for the individual\",\n },\n id: { type: \"string\", required: false, description: \"User-facing identifier (kebab-case)\" },\n alias: { type: \"string[]\", required: false, description: \"Alternative names\" },\n },\n [\"content\", \"id\", \"alias\"]\n);\n\nconst individualRetire = def(\n \"individual\",\n \"retire\",\n {\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n },\n [\"individual\"]\n);\n\nconst individualDie = def(\n \"individual\",\n \"die\",\n {\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n },\n [\"individual\"]\n);\n\nconst individualRehire = def(\n \"individual\",\n \"rehire\",\n {\n individual: { type: \"string\", required: true, description: \"Individual id (from past)\" },\n },\n [\"individual\"]\n);\n\nconst individualTeach = def(\n \"individual\",\n \"teach\",\n {\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n content: {\n type: \"gherkin\",\n required: true,\n description: \"Gherkin Feature source for the principle\",\n },\n id: {\n type: \"string\",\n required: false,\n description: \"Principle id (keywords joined by hyphens)\",\n },\n },\n [\"individual\", \"content\", \"id\"]\n);\n\nconst individualTrain = def(\n \"individual\",\n \"train\",\n {\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n content: {\n type: \"gherkin\",\n required: true,\n description: \"Gherkin Feature source for the procedure\",\n },\n id: {\n type: \"string\",\n required: false,\n description: \"Procedure id (keywords joined by hyphens)\",\n },\n },\n [\"individual\", \"content\", \"id\"]\n);\n\n// ================================================================\n// Role — execution + cognition\n// ================================================================\n\nconst roleActivate = def(\n \"role\",\n \"activate\",\n {\n individual: {\n type: \"string\",\n required: true,\n description: \"Individual id to activate as role\",\n },\n },\n [\"individual\"]\n);\n\nconst roleFocus = def(\n \"role\",\n \"focus\",\n {\n goal: { type: \"string\", required: true, description: \"Goal id to switch to\" },\n },\n [\"goal\"]\n);\n\nconst roleWant = def(\n \"role\",\n \"want\",\n {\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n goal: {\n type: \"gherkin\",\n required: false,\n description: \"Gherkin Feature source describing the goal\",\n },\n id: { type: \"string\", required: false, description: \"Goal id (used for focus/reference)\" },\n alias: { type: \"string[]\", required: false, description: \"Alternative names\" },\n },\n [\"individual\", \"goal\", \"id\", \"alias\"]\n);\n\nconst rolePlan = def(\n \"role\",\n \"plan\",\n {\n goal: { type: \"string\", required: true, description: \"Goal id\" },\n plan: {\n type: \"gherkin\",\n required: false,\n description: \"Gherkin Feature source describing the plan\",\n },\n id: { type: \"string\", required: false, description: \"Plan id (keywords joined by hyphens)\" },\n after: {\n type: \"string\",\n required: false,\n description: \"Plan id this plan follows (sequential/phase)\",\n },\n fallback: {\n type: \"string\",\n required: false,\n description: \"Plan id this plan is a backup for (alternative/strategy)\",\n },\n },\n [\"goal\", \"plan\", \"id\", \"after\", \"fallback\"]\n);\n\nconst roleTodo = def(\n \"role\",\n \"todo\",\n {\n plan: { type: \"string\", required: true, description: \"Plan id\" },\n task: {\n type: \"gherkin\",\n required: false,\n description: \"Gherkin Feature source describing the task\",\n },\n id: { type: \"string\", required: false, description: \"Task id (used for finish/reference)\" },\n alias: { type: \"string[]\", required: false, description: \"Alternative names\" },\n },\n [\"plan\", \"task\", \"id\", \"alias\"]\n);\n\nconst roleFinish = def(\n \"role\",\n \"finish\",\n {\n task: { type: \"string\", required: true, description: \"Task id to finish\" },\n individual: { type: \"string\", required: true, description: \"Individual id (encounter owner)\" },\n encounter: {\n type: \"gherkin\",\n required: false,\n description: \"Optional Gherkin Feature describing what happened\",\n },\n },\n [\"task\", \"individual\", \"encounter\"]\n);\n\nconst roleComplete = def(\n \"role\",\n \"complete\",\n {\n plan: { type: \"string\", required: true, description: \"Plan id to complete\" },\n individual: { type: \"string\", required: true, description: \"Individual id (encounter owner)\" },\n encounter: {\n type: \"gherkin\",\n required: false,\n description: \"Optional Gherkin Feature describing what happened\",\n },\n },\n [\"plan\", \"individual\", \"encounter\"]\n);\n\nconst roleAbandon = def(\n \"role\",\n \"abandon\",\n {\n plan: { type: \"string\", required: true, description: \"Plan id to abandon\" },\n individual: { type: \"string\", required: true, description: \"Individual id (encounter owner)\" },\n encounter: {\n type: \"gherkin\",\n required: false,\n description: \"Optional Gherkin Feature describing what happened\",\n },\n },\n [\"plan\", \"individual\", \"encounter\"]\n);\n\nconst roleReflect = def(\n \"role\",\n \"reflect\",\n {\n encounter: { type: \"string\", required: true, description: \"Encounter id to reflect on\" },\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n experience: {\n type: \"gherkin\",\n required: false,\n description: \"Gherkin Feature source for the experience\",\n },\n id: {\n type: \"string\",\n required: false,\n description: \"Experience id (keywords joined by hyphens)\",\n },\n },\n [\"encounter\", \"individual\", \"experience\", \"id\"]\n);\n\nconst roleRealize = def(\n \"role\",\n \"realize\",\n {\n experience: { type: \"string\", required: true, description: \"Experience id to distill\" },\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n principle: {\n type: \"gherkin\",\n required: false,\n description: \"Gherkin Feature source for the principle\",\n },\n id: {\n type: \"string\",\n required: false,\n description: \"Principle id (keywords joined by hyphens)\",\n },\n },\n [\"experience\", \"individual\", \"principle\", \"id\"]\n);\n\nconst roleMaster = def(\n \"role\",\n \"master\",\n {\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n procedure: {\n type: \"gherkin\",\n required: true,\n description: \"Gherkin Feature source for the procedure\",\n },\n id: {\n type: \"string\",\n required: false,\n description: \"Procedure id (keywords joined by hyphens)\",\n },\n experience: {\n type: \"string\",\n required: false,\n description: \"Experience id to consume (optional)\",\n },\n },\n [\"individual\", \"procedure\", \"id\", \"experience\"]\n);\n\nconst roleForget = def(\n \"role\",\n \"forget\",\n {\n id: { type: \"string\", required: true, description: \"Id of the node to remove\" },\n individual: { type: \"string\", required: true, description: \"Individual id (owner)\" },\n },\n [\"id\", \"individual\"]\n);\n\nconst roleSkill = def(\n \"role\",\n \"skill\",\n {\n locator: { type: \"string\", required: true, description: \"ResourceX locator for the skill\" },\n },\n [\"locator\"]\n);\n\n// ================================================================\n// Org — organization management\n// ================================================================\n\nconst orgFound = def(\n \"org\",\n \"found\",\n {\n content: {\n type: \"gherkin\",\n required: false,\n description: \"Gherkin Feature source for the organization\",\n },\n id: { type: \"string\", required: false, description: \"User-facing identifier (kebab-case)\" },\n alias: { type: \"string[]\", required: false, description: \"Alternative names\" },\n },\n [\"content\", \"id\", \"alias\"]\n);\n\nconst orgCharter = def(\n \"org\",\n \"charter\",\n {\n org: { type: \"string\", required: true, description: \"Organization id\" },\n content: {\n type: \"gherkin\",\n required: true,\n description: \"Gherkin Feature source for the charter\",\n },\n id: { type: \"string\", required: false, description: \"Charter id\" },\n },\n [\"org\", \"content\", \"id\"]\n);\n\nconst orgDissolve = def(\n \"org\",\n \"dissolve\",\n {\n org: { type: \"string\", required: true, description: \"Organization id\" },\n },\n [\"org\"]\n);\n\nconst orgHire = def(\n \"org\",\n \"hire\",\n {\n org: { type: \"string\", required: true, description: \"Organization id\" },\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n },\n [\"org\", \"individual\"]\n);\n\nconst orgFire = def(\n \"org\",\n \"fire\",\n {\n org: { type: \"string\", required: true, description: \"Organization id\" },\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n },\n [\"org\", \"individual\"]\n);\n\n// ================================================================\n// Position — position management\n// ================================================================\n\nconst positionEstablish = def(\n \"position\",\n \"establish\",\n {\n content: {\n type: \"gherkin\",\n required: false,\n description: \"Gherkin Feature source for the position\",\n },\n id: { type: \"string\", required: false, description: \"User-facing identifier (kebab-case)\" },\n alias: { type: \"string[]\", required: false, description: \"Alternative names\" },\n },\n [\"content\", \"id\", \"alias\"]\n);\n\nconst positionCharge = def(\n \"position\",\n \"charge\",\n {\n position: { type: \"string\", required: true, description: \"Position id\" },\n content: {\n type: \"gherkin\",\n required: true,\n description: \"Gherkin Feature source for the duty\",\n },\n id: { type: \"string\", required: false, description: \"Duty id (keywords joined by hyphens)\" },\n },\n [\"position\", \"content\", \"id\"]\n);\n\nconst positionRequire = def(\n \"position\",\n \"require\",\n {\n position: { type: \"string\", required: true, description: \"Position id\" },\n content: {\n type: \"gherkin\",\n required: true,\n description: \"Gherkin Feature source for the skill requirement\",\n },\n id: {\n type: \"string\",\n required: false,\n description: \"Requirement id (keywords joined by hyphens)\",\n },\n },\n [\"position\", \"content\", \"id\"]\n);\n\nconst positionAbolish = def(\n \"position\",\n \"abolish\",\n {\n position: { type: \"string\", required: true, description: \"Position id\" },\n },\n [\"position\"]\n);\n\nconst positionAppoint = def(\n \"position\",\n \"appoint\",\n {\n position: { type: \"string\", required: true, description: \"Position id\" },\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n },\n [\"position\", \"individual\"]\n);\n\nconst positionDismiss = def(\n \"position\",\n \"dismiss\",\n {\n position: { type: \"string\", required: true, description: \"Position id\" },\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n },\n [\"position\", \"individual\"]\n);\n\n// ================================================================\n// Project — project management\n// ================================================================\n\nconst projectLaunch = def(\n \"project\",\n \"launch\",\n {\n content: {\n type: \"gherkin\",\n required: false,\n description: \"Gherkin Feature source for the project\",\n },\n id: { type: \"string\", required: false, description: \"User-facing identifier (kebab-case)\" },\n alias: { type: \"string[]\", required: false, description: \"Alternative names\" },\n org: {\n type: \"string\",\n required: false,\n description: \"Organization id that owns this project\",\n },\n },\n [\"content\", \"id\", \"alias\", \"org\"]\n);\n\nconst projectScope = def(\n \"project\",\n \"scope\",\n {\n project: { type: \"string\", required: true, description: \"Project id\" },\n content: {\n type: \"gherkin\",\n required: true,\n description: \"Gherkin Feature source for the scope\",\n },\n id: { type: \"string\", required: false, description: \"Scope id\" },\n },\n [\"project\", \"content\", \"id\"]\n);\n\nconst projectMilestone = def(\n \"project\",\n \"milestone\",\n {\n project: { type: \"string\", required: true, description: \"Project id\" },\n content: {\n type: \"gherkin\",\n required: true,\n description: \"Gherkin Feature source for the milestone\",\n },\n id: {\n type: \"string\",\n required: false,\n description: \"Milestone id (keywords joined by hyphens)\",\n },\n },\n [\"project\", \"content\", \"id\"]\n);\n\nconst projectAchieve = def(\n \"project\",\n \"achieve\",\n {\n milestone: { type: \"string\", required: true, description: \"Milestone id to mark as done\" },\n },\n [\"milestone\"]\n);\n\nconst projectEnroll = def(\n \"project\",\n \"enroll\",\n {\n project: { type: \"string\", required: true, description: \"Project id\" },\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n },\n [\"project\", \"individual\"]\n);\n\nconst projectRemove = def(\n \"project\",\n \"remove\",\n {\n project: { type: \"string\", required: true, description: \"Project id\" },\n individual: { type: \"string\", required: true, description: \"Individual id\" },\n },\n [\"project\", \"individual\"]\n);\n\nconst projectDeliver = def(\n \"project\",\n \"deliver\",\n {\n project: { type: \"string\", required: true, description: \"Project id\" },\n content: {\n type: \"gherkin\",\n required: true,\n description: \"Gherkin Feature source for the deliverable\",\n },\n id: {\n type: \"string\",\n required: false,\n description: \"Deliverable id (keywords joined by hyphens)\",\n },\n },\n [\"project\", \"content\", \"id\"]\n);\n\nconst projectWiki = def(\n \"project\",\n \"wiki\",\n {\n project: { type: \"string\", required: true, description: \"Project id\" },\n content: {\n type: \"gherkin\",\n required: true,\n description: \"Gherkin Feature source for the wiki entry\",\n },\n id: {\n type: \"string\",\n required: false,\n description: \"Wiki entry id (keywords joined by hyphens)\",\n },\n },\n [\"project\", \"content\", \"id\"]\n);\n\nconst projectArchive = def(\n \"project\",\n \"archive\",\n {\n project: { type: \"string\", required: true, description: \"Project id\" },\n },\n [\"project\"]\n);\n\n// ================================================================\n// Census — society-level queries\n// ================================================================\n\nconst censusList = def(\n \"census\",\n \"list\",\n {\n type: {\n type: \"string\",\n required: false,\n description: \"Filter by type (individual, organization, position, project, past)\",\n },\n },\n [\"type\"]\n);\n\n// ================================================================\n// Prototype — registry + creation\n// ================================================================\n\nconst prototypeEvict = def(\n \"prototype\",\n \"evict\",\n {\n id: { type: \"string\", required: true, description: \"Prototype id to unregister\" },\n },\n [\"id\"]\n);\n\n// ================================================================\n// Resource — ResourceX proxy\n// ================================================================\n\nconst resourceAdd = def(\n \"resource\",\n \"add\",\n {\n path: { type: \"string\", required: true, description: \"Path to resource directory\" },\n },\n [\"path\"]\n);\n\nconst resourceSearch = def(\n \"resource\",\n \"search\",\n {\n query: { type: \"string\", required: false, description: \"Search query\" },\n },\n [\"query\"]\n);\n\nconst resourceHas = def(\n \"resource\",\n \"has\",\n {\n locator: { type: \"string\", required: true, description: \"Resource locator\" },\n },\n [\"locator\"]\n);\n\nconst resourceInfo = def(\n \"resource\",\n \"info\",\n {\n locator: { type: \"string\", required: true, description: \"Resource locator\" },\n },\n [\"locator\"]\n);\n\nconst resourceRemove = def(\n \"resource\",\n \"remove\",\n {\n locator: { type: \"string\", required: true, description: \"Resource locator\" },\n },\n [\"locator\"]\n);\n\nconst resourcePush = def(\n \"resource\",\n \"push\",\n {\n locator: { type: \"string\", required: true, description: \"Resource locator\" },\n registry: { type: \"string\", required: false, description: \"Registry URL (overrides default)\" },\n },\n [\"locator\", { pack: [\"registry\"] }]\n);\n\nconst resourcePull = def(\n \"resource\",\n \"pull\",\n {\n locator: { type: \"string\", required: true, description: \"Resource locator\" },\n registry: { type: \"string\", required: false, description: \"Registry URL (overrides default)\" },\n },\n [\"locator\", { pack: [\"registry\"] }]\n);\n\nconst resourceClearCache = def(\n \"resource\",\n \"clearCache\",\n {\n registry: { type: \"string\", required: false, description: \"Registry to clear cache for\" },\n },\n [\"registry\"]\n);\n\n// ================================================================\n// Issue — IssueX proxy\n// ================================================================\n\nconst issuePublish = def(\n \"issue\",\n \"publish\",\n {\n title: { type: \"string\", required: true, description: \"Issue title\" },\n body: { type: \"string\", required: true, description: \"Issue body/description\" },\n author: { type: \"string\", required: true, description: \"Author individual id\" },\n assignee: { type: \"string\", required: false, description: \"Assignee individual id\" },\n },\n [\"title\", \"body\", \"author\", \"assignee\"]\n);\n\nconst issueGet = def(\n \"issue\",\n \"get\",\n {\n number: { type: \"number\", required: true, description: \"Issue number\" },\n },\n [\"number\"]\n);\n\nconst issueList = def(\n \"issue\",\n \"list\",\n {\n status: { type: \"string\", required: false, description: \"Filter by status (open/closed)\" },\n author: { type: \"string\", required: false, description: \"Filter by author\" },\n assignee: { type: \"string\", required: false, description: \"Filter by assignee\" },\n label: { type: \"string\", required: false, description: \"Filter by label name\" },\n },\n [\"status\", \"author\", \"assignee\", \"label\"]\n);\n\nconst issueUpdate = def(\n \"issue\",\n \"update\",\n {\n number: { type: \"number\", required: true, description: \"Issue number\" },\n title: { type: \"string\", required: false, description: \"New title\" },\n body: { type: \"string\", required: false, description: \"New body\" },\n assignee: { type: \"string\", required: false, description: \"New assignee\" },\n },\n [\"number\", \"title\", \"body\", \"assignee\"]\n);\n\nconst issueClose = def(\n \"issue\",\n \"close\",\n {\n number: { type: \"number\", required: true, description: \"Issue number to close\" },\n },\n [\"number\"]\n);\n\nconst issueReopen = def(\n \"issue\",\n \"reopen\",\n {\n number: { type: \"number\", required: true, description: \"Issue number to reopen\" },\n },\n [\"number\"]\n);\n\nconst issueAssign = def(\n \"issue\",\n \"assign\",\n {\n number: { type: \"number\", required: true, description: \"Issue number\" },\n assignee: { type: \"string\", required: true, description: \"Individual id to assign\" },\n },\n [\"number\", \"assignee\"]\n);\n\nconst issueComment = def(\n \"issue\",\n \"comment\",\n {\n number: { type: \"number\", required: true, description: \"Issue number\" },\n body: { type: \"string\", required: true, description: \"Comment body\" },\n author: { type: \"string\", required: true, description: \"Author individual id\" },\n },\n [\"number\", \"body\", \"author\"]\n);\n\nconst issueComments = def(\n \"issue\",\n \"comments\",\n {\n number: { type: \"number\", required: true, description: \"Issue number\" },\n },\n [\"number\"]\n);\n\nconst issueLabel = def(\n \"issue\",\n \"label\",\n {\n number: { type: \"number\", required: true, description: \"Issue number\" },\n label: { type: \"string\", required: true, description: \"Label name\" },\n },\n [\"number\", \"label\"]\n);\n\nconst issueUnlabel = def(\n \"issue\",\n \"unlabel\",\n {\n number: { type: \"number\", required: true, description: \"Issue number\" },\n label: { type: \"string\", required: true, description: \"Label name to remove\" },\n },\n [\"number\", \"label\"]\n);\n\n// ================================================================\n// Instruction registry — keyed by \"namespace.method\"\n// ================================================================\n\nexport const instructions: Record<string, InstructionDef> = {\n // individual\n \"individual.born\": individualBorn,\n \"individual.retire\": individualRetire,\n \"individual.die\": individualDie,\n \"individual.rehire\": individualRehire,\n \"individual.teach\": individualTeach,\n \"individual.train\": individualTrain,\n\n // role\n \"role.activate\": roleActivate,\n \"role.focus\": roleFocus,\n \"role.want\": roleWant,\n \"role.plan\": rolePlan,\n \"role.todo\": roleTodo,\n \"role.finish\": roleFinish,\n \"role.complete\": roleComplete,\n \"role.abandon\": roleAbandon,\n \"role.reflect\": roleReflect,\n \"role.realize\": roleRealize,\n \"role.master\": roleMaster,\n \"role.forget\": roleForget,\n \"role.skill\": roleSkill,\n\n // org\n \"org.found\": orgFound,\n \"org.charter\": orgCharter,\n \"org.dissolve\": orgDissolve,\n \"org.hire\": orgHire,\n \"org.fire\": orgFire,\n\n // position\n \"position.establish\": positionEstablish,\n \"position.charge\": positionCharge,\n \"position.require\": positionRequire,\n \"position.abolish\": positionAbolish,\n \"position.appoint\": positionAppoint,\n \"position.dismiss\": positionDismiss,\n\n // project\n \"project.launch\": projectLaunch,\n \"project.scope\": projectScope,\n \"project.milestone\": projectMilestone,\n \"project.achieve\": projectAchieve,\n \"project.enroll\": projectEnroll,\n \"project.remove\": projectRemove,\n \"project.deliver\": projectDeliver,\n \"project.wiki\": projectWiki,\n \"project.archive\": projectArchive,\n\n // census\n \"census.list\": censusList,\n\n // prototype\n \"prototype.evict\": prototypeEvict,\n\n // resource\n \"resource.add\": resourceAdd,\n \"resource.search\": resourceSearch,\n \"resource.has\": resourceHas,\n \"resource.info\": resourceInfo,\n \"resource.remove\": resourceRemove,\n \"resource.push\": resourcePush,\n \"resource.pull\": resourcePull,\n \"resource.clearCache\": resourceClearCache,\n\n // issue\n \"issue.publish\": issuePublish,\n \"issue.get\": issueGet,\n \"issue.list\": issueList,\n \"issue.update\": issueUpdate,\n \"issue.close\": issueClose,\n \"issue.reopen\": issueReopen,\n \"issue.assign\": issueAssign,\n \"issue.comment\": issueComment,\n \"issue.comments\": issueComments,\n \"issue.label\": issueLabel,\n \"issue.unlabel\": issueUnlabel,\n};\n","/**\n * Dispatch — schema-driven argument mapping.\n *\n * Replaces the hand-written toArgs switch in rolex.ts with a single\n * lookup against the instruction registry.\n */\n\nimport { instructions } from \"./instructions.js\";\nimport type { ArgEntry } from \"./schema.js\";\n\n/**\n * Map named arguments to positional arguments for a given operation.\n *\n * @param op - Operation key in \"namespace.method\" format (e.g. \"individual.born\")\n * @param args - Named arguments from the caller\n * @returns Positional argument array matching the method signature\n */\nexport function toArgs(op: string, args: Record<string, unknown>): unknown[] {\n const def = instructions[op];\n if (!def) throw new Error(`Unknown instruction \"${op}\".`);\n\n // Validate required params\n for (const [name, param] of Object.entries(def.params)) {\n if (param.required && args[name] === undefined) {\n throw new Error(\n `Missing required argument \"${name}\" for ${op}.\\n\\n` +\n \"You may be guessing the argument names. \" +\n \"Call skill(locator) with the relevant procedure to see the correct syntax.\"\n );\n }\n }\n\n return def.args.map((entry) => resolveArg(entry, args));\n}\n\nfunction resolveArg(entry: ArgEntry, args: Record<string, unknown>): unknown {\n if (typeof entry === \"string\") return args[entry];\n\n // pack: collect named args into an options object\n const obj: Record<string, unknown> = {};\n let hasValue = false;\n for (const name of entry.pack) {\n if (args[name] !== undefined) {\n obj[name] = args[name];\n hasValue = true;\n }\n }\n return hasValue ? obj : undefined;\n}\n","/**\n * Ops — platform-agnostic operation implementations.\n *\n * Every RoleX operation is a pure function of (Runtime, args) → OpResult.\n * No platform-specific code — all I/O goes through injected interfaces.\n *\n * Usage:\n * const ops = createOps({ rt, society, past, resolve, find, resourcex });\n * const result = ops[\"individual.born\"](\"Feature: Sean\", \"sean\");\n */\n\nimport type { PrototypeRepository } from \"@rolexjs/core\";\nimport * as C from \"@rolexjs/core\";\nimport { parse } from \"@rolexjs/parser\";\nimport type { Runtime, State, Structure } from \"@rolexjs/system\";\nimport type { IssueX } from \"issuexjs\";\nimport type { ResourceX } from \"resourcexjs\";\n\n// ================================================================\n// Types\n// ================================================================\n\nexport interface OpResult {\n state: State;\n process: string;\n}\n\nexport interface OpsContext {\n rt: Runtime;\n society: Structure;\n past: Structure;\n resolve(id: string): Structure | Promise<Structure>;\n find(id: string): (Structure | null) | Promise<Structure | null>;\n resourcex?: ResourceX;\n issuex?: IssueX;\n prototype?: PrototypeRepository;\n direct?(locator: string, args?: Record<string, unknown>): Promise<unknown>;\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: ops are dynamically dispatched\nexport type Ops = Record<string, (...args: any[]) => any>;\n\n// ================================================================\n// Factory\n// ================================================================\n\nexport function createOps(ctx: OpsContext): Ops {\n const { rt, society, past, resolve, resourcex, issuex } = ctx;\n\n // ---- Helpers ----\n\n async function ok(node: Structure, process: string): Promise<OpResult> {\n return { state: await rt.project(node), process };\n }\n\n async function archive(node: Structure, process: string): Promise<OpResult> {\n const archived = await rt.transform(node, C.past);\n return ok(archived, process);\n }\n\n function validateGherkin(source?: string): void {\n if (!source) return;\n try {\n parse(source);\n } catch (e: any) {\n throw new Error(`Invalid Gherkin: ${e.message}`);\n }\n }\n\n /** Scoped search within a subtree. No priority needed — used only by removeExisting. */\n function findInState(state: State, target: string): Structure | null {\n if (state.id && state.id.toLowerCase() === target) return state;\n if (state.alias) {\n for (const a of state.alias) {\n if (a.toLowerCase() === target) return state;\n }\n }\n for (const child of state.children ?? []) {\n const found = findInState(child, target);\n if (found) return found;\n }\n return null;\n }\n\n async function removeExisting(parent: Structure, id: string): Promise<void> {\n const state = await rt.project(parent);\n const existing = findInState(state, id);\n if (existing) await rt.remove(existing);\n }\n\n function requireResourceX(): ResourceX {\n if (!resourcex) throw new Error(\"ResourceX is not available.\");\n return resourcex;\n }\n\n function requireIssueX(): IssueX {\n if (!issuex) throw new Error(\"IssueX is not available.\");\n return issuex;\n }\n\n // ================================================================\n // Operations\n // ================================================================\n\n return {\n // ---- Individual: lifecycle ----\n\n async \"individual.born\"(\n content?: string,\n id?: string,\n alias?: readonly string[]\n ): Promise<OpResult> {\n validateGherkin(content);\n const node = await rt.create(society, C.individual, content, id, alias);\n await rt.create(node, C.identity, undefined, id ? `${id}-identity` : undefined);\n return ok(node, \"born\");\n },\n\n async \"individual.retire\"(individual: string): Promise<OpResult> {\n return archive(await resolve(individual), \"retire\");\n },\n\n async \"individual.die\"(individual: string): Promise<OpResult> {\n return archive(await resolve(individual), \"die\");\n },\n\n async \"individual.rehire\"(pastNode: string): Promise<OpResult> {\n const node = await resolve(pastNode);\n const ind = await rt.transform(node, C.individual);\n return ok(ind, \"rehire\");\n },\n\n // ---- Individual: external injection ----\n\n async \"individual.teach\"(\n individual: string,\n principle: string,\n id?: string\n ): Promise<OpResult> {\n validateGherkin(principle);\n const parent = await resolve(individual);\n if (id) await removeExisting(parent, id);\n const node = await rt.create(parent, C.principle, principle, id);\n return ok(node, \"teach\");\n },\n\n async \"individual.train\"(\n individual: string,\n procedure: string,\n id?: string\n ): Promise<OpResult> {\n validateGherkin(procedure);\n const parent = await resolve(individual);\n if (id) await removeExisting(parent, id);\n const node = await rt.create(parent, C.procedure, procedure, id);\n return ok(node, \"train\");\n },\n\n // ---- Role: focus ----\n\n async \"role.focus\"(goal: string): Promise<OpResult> {\n return ok(await resolve(goal), \"focus\");\n },\n\n // ---- Role: execution ----\n\n async \"role.want\"(\n individual: string,\n goal?: string,\n id?: string,\n alias?: readonly string[]\n ): Promise<OpResult> {\n validateGherkin(goal);\n const node = await rt.create(await resolve(individual), C.goal, goal, id, alias);\n return ok(node, \"want\");\n },\n\n async \"role.plan\"(\n goal: string,\n plan?: string,\n id?: string,\n after?: string,\n fallback?: string\n ): Promise<OpResult> {\n validateGherkin(plan);\n const node = await rt.create(await resolve(goal), C.plan, plan, id);\n if (after) await rt.link(node, await resolve(after), \"after\", \"before\");\n if (fallback) await rt.link(node, await resolve(fallback), \"fallback-for\", \"fallback\");\n return ok(node, \"plan\");\n },\n\n async \"role.todo\"(\n plan: string,\n task?: string,\n id?: string,\n alias?: readonly string[]\n ): Promise<OpResult> {\n validateGherkin(task);\n const node = await rt.create(await resolve(plan), C.task, task, id, alias);\n return ok(node, \"todo\");\n },\n\n async \"role.finish\"(task: string, individual: string, encounter?: string): Promise<OpResult> {\n validateGherkin(encounter);\n const taskNode = await resolve(task);\n await rt.tag(taskNode, \"done\");\n if (encounter) {\n const encId = taskNode.id ? `${taskNode.id}-finished` : undefined;\n const enc = await rt.create(await resolve(individual), C.encounter, encounter, encId);\n return ok(enc, \"finish\");\n }\n return ok(taskNode, \"finish\");\n },\n\n async \"role.complete\"(plan: string, individual: string, encounter?: string): Promise<OpResult> {\n validateGherkin(encounter);\n const planNode = await resolve(plan);\n await rt.tag(planNode, \"done\");\n const encId = planNode.id ? `${planNode.id}-completed` : undefined;\n const enc = await rt.create(await resolve(individual), C.encounter, encounter, encId);\n return ok(enc, \"complete\");\n },\n\n async \"role.abandon\"(plan: string, individual: string, encounter?: string): Promise<OpResult> {\n validateGherkin(encounter);\n const planNode = await resolve(plan);\n await rt.tag(planNode, \"abandoned\");\n const encId = planNode.id ? `${planNode.id}-abandoned` : undefined;\n const enc = await rt.create(await resolve(individual), C.encounter, encounter, encId);\n return ok(enc, \"abandon\");\n },\n\n // ---- Role: cognition ----\n\n async \"role.reflect\"(\n encounter: string | undefined,\n individual: string,\n experience?: string,\n id?: string\n ): Promise<OpResult> {\n validateGherkin(experience);\n if (encounter) {\n const encNode = await resolve(encounter);\n const exp = await rt.create(\n await resolve(individual),\n C.experience,\n experience || encNode.information,\n id\n );\n await rt.remove(encNode);\n return ok(exp, \"reflect\");\n }\n // Direct creation — no encounter to consume\n const exp = await rt.create(await resolve(individual), C.experience, experience, id);\n return ok(exp, \"reflect\");\n },\n\n async \"role.realize\"(\n experience: string | undefined,\n individual: string,\n principle?: string,\n id?: string\n ): Promise<OpResult> {\n validateGherkin(principle);\n if (experience) {\n const expNode = await resolve(experience);\n const prin = await rt.create(\n await resolve(individual),\n C.principle,\n principle || expNode.information,\n id\n );\n await rt.remove(expNode);\n return ok(prin, \"realize\");\n }\n // Direct creation — no experience to consume\n const prin = await rt.create(await resolve(individual), C.principle, principle, id);\n return ok(prin, \"realize\");\n },\n\n async \"role.master\"(\n individual: string,\n procedure: string,\n id?: string,\n experience?: string\n ): Promise<OpResult> {\n validateGherkin(procedure);\n const parent = await resolve(individual);\n if (id) await removeExisting(parent, id);\n const proc = await rt.create(parent, C.procedure, procedure, id);\n if (experience) await rt.remove(await resolve(experience));\n return ok(proc, \"master\");\n },\n\n // ---- Role: knowledge management ----\n\n async \"role.forget\"(nodeId: string): Promise<OpResult> {\n const node = await resolve(nodeId);\n await rt.remove(node);\n return { state: { ...node, children: [] }, process: \"forget\" };\n },\n\n // ---- Role: skill ----\n\n async \"role.skill\"(locator: string): Promise<string> {\n const rx = requireResourceX();\n const content = await rx.ingest<string>(locator);\n const text = typeof content === \"string\" ? content : JSON.stringify(content, null, 2);\n try {\n const rxm = await rx.info(locator);\n return `${formatRXM(rxm)}\\n\\n${text}`;\n } catch {\n return text;\n }\n },\n\n // ---- Project ----\n\n async \"project.launch\"(\n content?: string,\n id?: string,\n alias?: readonly string[],\n org?: string\n ): Promise<OpResult> {\n validateGherkin(content);\n const node = await rt.create(society, C.project, content, id, alias);\n if (org) await rt.link(node, await resolve(org), \"ownership\", \"project\");\n return ok(node, \"launch\");\n },\n\n async \"project.scope\"(project: string, scope: string, id?: string): Promise<OpResult> {\n validateGherkin(scope);\n const node = await rt.create(await resolve(project), C.scope, scope, id);\n return ok(node, \"scope\");\n },\n\n async \"project.milestone\"(project: string, milestone: string, id?: string): Promise<OpResult> {\n validateGherkin(milestone);\n const node = await rt.create(await resolve(project), C.milestone, milestone, id);\n return ok(node, \"milestone\");\n },\n\n async \"project.achieve\"(milestone: string): Promise<OpResult> {\n const node = await resolve(milestone);\n await rt.tag(node, \"done\");\n return ok(node, \"achieve\");\n },\n\n async \"project.enroll\"(project: string, individual: string): Promise<OpResult> {\n const projNode = await resolve(project);\n await rt.link(projNode, await resolve(individual), \"participation\", \"participate\");\n return ok(projNode, \"enroll\");\n },\n\n async \"project.remove\"(project: string, individual: string): Promise<OpResult> {\n const projNode = await resolve(project);\n await rt.unlink(projNode, await resolve(individual), \"participation\", \"participate\");\n return ok(projNode, \"remove\");\n },\n\n async \"project.deliver\"(project: string, deliverable: string, id?: string): Promise<OpResult> {\n validateGherkin(deliverable);\n const node = await rt.create(await resolve(project), C.deliverable, deliverable, id);\n return ok(node, \"deliver\");\n },\n\n async \"project.wiki\"(project: string, wiki: string, id?: string): Promise<OpResult> {\n validateGherkin(wiki);\n const node = await rt.create(await resolve(project), C.wiki, wiki, id);\n return ok(node, \"wiki\");\n },\n\n async \"project.archive\"(project: string): Promise<OpResult> {\n return archive(await resolve(project), \"archive\");\n },\n\n // ---- Org ----\n\n async \"org.found\"(content?: string, id?: string, alias?: readonly string[]): Promise<OpResult> {\n validateGherkin(content);\n const node = await rt.create(society, C.organization, content, id, alias);\n return ok(node, \"found\");\n },\n\n async \"org.charter\"(org: string, charter: string, id?: string): Promise<OpResult> {\n validateGherkin(charter);\n const node = await rt.create(await resolve(org), C.charter, charter, id);\n return ok(node, \"charter\");\n },\n\n async \"org.dissolve\"(org: string): Promise<OpResult> {\n return archive(await resolve(org), \"dissolve\");\n },\n\n async \"org.hire\"(org: string, individual: string): Promise<OpResult> {\n const orgNode = await resolve(org);\n await rt.link(orgNode, await resolve(individual), \"membership\", \"belong\");\n return ok(orgNode, \"hire\");\n },\n\n async \"org.fire\"(org: string, individual: string): Promise<OpResult> {\n const orgNode = await resolve(org);\n await rt.unlink(orgNode, await resolve(individual), \"membership\", \"belong\");\n return ok(orgNode, \"fire\");\n },\n\n // ---- Position ----\n\n async \"position.establish\"(\n content?: string,\n id?: string,\n alias?: readonly string[]\n ): Promise<OpResult> {\n validateGherkin(content);\n const node = await rt.create(society, C.position, content, id, alias);\n return ok(node, \"establish\");\n },\n\n async \"position.charge\"(position: string, duty: string, id?: string): Promise<OpResult> {\n validateGherkin(duty);\n const node = await rt.create(await resolve(position), C.duty, duty, id);\n return ok(node, \"charge\");\n },\n\n async \"position.require\"(position: string, procedure: string, id?: string): Promise<OpResult> {\n validateGherkin(procedure);\n const parent = await resolve(position);\n if (id) await removeExisting(parent, id);\n const node = await rt.create(parent, C.requirement, procedure, id);\n return ok(node, \"require\");\n },\n\n async \"position.abolish\"(position: string): Promise<OpResult> {\n return archive(await resolve(position), \"abolish\");\n },\n\n async \"position.appoint\"(position: string, individual: string): Promise<OpResult> {\n const posNode = await resolve(position);\n const indNode = await resolve(individual);\n await rt.link(posNode, indNode, \"appointment\", \"serve\");\n\n // Auto-train: copy position requirements as individual procedures\n const posState = await rt.project(posNode);\n for (const child of posState.children ?? []) {\n if (child.name !== \"requirement\" || !child.information) continue;\n // rt.create is idempotent for same parent + same id\n await rt.create(indNode, C.procedure, child.information, child.id);\n }\n\n return ok(posNode, \"appoint\");\n },\n\n async \"position.dismiss\"(position: string, individual: string): Promise<OpResult> {\n const posNode = await resolve(position);\n await rt.unlink(posNode, await resolve(individual), \"appointment\", \"serve\");\n return ok(posNode, \"dismiss\");\n },\n\n // ---- Census ----\n\n async \"census.list\"(type?: string): Promise<string> {\n const target = type === \"past\" ? past : society;\n const state = await rt.project(target);\n const children = state.children ?? [];\n const filtered =\n type === \"past\"\n ? children\n : children.filter((c) => (type ? c.name === type : c.name !== \"past\"));\n if (filtered.length === 0) {\n return type ? `No ${type} found.` : \"Society is empty.\";\n }\n\n // If filtering by type, use simple flat rendering\n if (type) {\n const lines: string[] = [];\n for (const item of filtered) {\n const tag = item.tag ? ` #${item.tag}` : \"\";\n const alias = item.alias?.length ? ` (${item.alias.join(\", \")})` : \"\";\n lines.push(`${item.id ?? \"(no id)\"}${alias}${tag}`);\n }\n return lines.join(\"\\n\");\n }\n\n // Organization-centric tree view\n const orgs = filtered.filter((c) => c.name === \"organization\");\n const individuals = filtered.filter((c) => c.name === \"individual\");\n\n // Build a set of individuals who belong to an org\n const affiliatedIndividuals = new Set<string>();\n // Build a map: individual id → positions they serve\n const individualPositions = new Map<string, string[]>();\n for (const ind of individuals) {\n const serves = ind.links?.filter((l) => l.relation === \"serve\") ?? [];\n if (serves.length > 0) {\n individualPositions.set(\n ind.id ?? \"\",\n serves.map((l) => l.target.id ?? \"(no id)\")\n );\n }\n }\n\n const lines: string[] = [];\n\n for (const org of orgs) {\n const alias = org.alias?.length ? ` (${org.alias.join(\", \")})` : \"\";\n const tag = org.tag ? ` #${org.tag}` : \"\";\n lines.push(`${org.id}${alias}${tag}`);\n\n // Projects owned by this org\n const projects = org.links?.filter((l) => l.relation === \"project\") ?? [];\n for (const p of projects) {\n const pAlias = p.target.alias?.length ? ` (${p.target.alias.join(\", \")})` : \"\";\n const pTag = p.target.tag ? ` #${p.target.tag}` : \"\";\n lines.push(` 📦 ${p.target.id ?? \"(no id)\"}${pAlias}${pTag}`);\n }\n\n // Members of this org\n const members = org.links?.filter((l) => l.relation === \"membership\") ?? [];\n if (members.length === 0 && projects.length === 0) {\n lines.push(\" (empty)\");\n }\n for (const m of members) {\n affiliatedIndividuals.add(m.target.id ?? \"\");\n const mAlias = m.target.alias?.length ? ` (${m.target.alias.join(\", \")})` : \"\";\n const mTag = m.target.tag ? ` #${m.target.tag}` : \"\";\n const posLabels = individualPositions.get(m.target.id ?? \"\");\n const posStr = posLabels?.length ? ` — ${posLabels.join(\", \")}` : \"\";\n lines.push(` ${m.target.id}${mAlias}${mTag}${posStr}`);\n }\n lines.push(\"\");\n }\n\n // Unaffiliated individuals\n const unaffiliated = individuals.filter((ind) => !affiliatedIndividuals.has(ind.id ?? \"\"));\n if (unaffiliated.length > 0) {\n lines.push(\"─── unaffiliated ───\");\n for (const ind of unaffiliated) {\n const alias = ind.alias?.length ? ` (${ind.alias.join(\", \")})` : \"\";\n const tag = ind.tag ? ` #${ind.tag}` : \"\";\n const posLabels = individualPositions.get(ind.id ?? \"\");\n const posStr = posLabels?.length ? ` — ${posLabels.join(\", \")}` : \"\";\n lines.push(` ${ind.id}${alias}${tag}${posStr}`);\n }\n }\n\n return lines.join(\"\\n\");\n },\n\n // ---- Resource (proxy to ResourceX) ----\n\n \"resource.add\"(path: string) {\n return requireResourceX().add(path);\n },\n\n \"resource.search\"(query?: string) {\n return requireResourceX().search(query);\n },\n\n \"resource.has\"(locator: string) {\n return requireResourceX().has(locator);\n },\n\n \"resource.info\"(locator: string) {\n return requireResourceX().info(locator);\n },\n\n \"resource.remove\"(locator: string) {\n return requireResourceX().remove(locator);\n },\n\n \"resource.push\"(locator: string, options?: { registry?: string }) {\n return requireResourceX().push(locator, options);\n },\n\n \"resource.pull\"(locator: string, options?: { registry?: string }) {\n return requireResourceX().pull(locator, options);\n },\n\n \"resource.clearCache\"(registry?: string) {\n return requireResourceX().clearCache(registry);\n },\n\n // ---- Issue (proxy to IssueX) ----\n\n async \"issue.publish\"(title: string, body: string, author: string, assignee?: string) {\n const ix = requireIssueX();\n return ix.createIssue({ title, body, author, assignee });\n },\n\n async \"issue.get\"(number: number) {\n return requireIssueX().getIssueByNumber(number);\n },\n\n async \"issue.list\"(status?: string, author?: string, assignee?: string, label?: string) {\n const filter: Record<string, string> = {};\n if (status) filter.status = status;\n if (author) filter.author = author;\n if (assignee) filter.assignee = assignee;\n if (label) filter.label = label;\n return requireIssueX().listIssues(\n Object.keys(filter).length > 0 ? (filter as any) : undefined\n );\n },\n\n async \"issue.update\"(number: number, title?: string, body?: string, assignee?: string) {\n const ix = requireIssueX();\n const issue = await ix.getIssueByNumber(number);\n if (!issue) throw new Error(`Issue #${number} not found.`);\n const patch: Record<string, unknown> = {};\n if (title !== undefined) patch.title = title;\n if (body !== undefined) patch.body = body;\n if (assignee !== undefined) patch.assignee = assignee;\n return ix.updateIssue(issue.id, patch);\n },\n\n async \"issue.close\"(number: number) {\n const ix = requireIssueX();\n const issue = await ix.getIssueByNumber(number);\n if (!issue) throw new Error(`Issue #${number} not found.`);\n return ix.closeIssue(issue.id);\n },\n\n async \"issue.reopen\"(number: number) {\n const ix = requireIssueX();\n const issue = await ix.getIssueByNumber(number);\n if (!issue) throw new Error(`Issue #${number} not found.`);\n return ix.reopenIssue(issue.id);\n },\n\n async \"issue.assign\"(number: number, assignee: string) {\n const ix = requireIssueX();\n const issue = await ix.getIssueByNumber(number);\n if (!issue) throw new Error(`Issue #${number} not found.`);\n return ix.updateIssue(issue.id, { assignee });\n },\n\n async \"issue.comment\"(number: number, body: string, author: string) {\n const ix = requireIssueX();\n const issue = await ix.getIssueByNumber(number);\n if (!issue) throw new Error(`Issue #${number} not found.`);\n return ix.createComment(issue.id, body, author);\n },\n\n async \"issue.comments\"(number: number) {\n const ix = requireIssueX();\n const issue = await ix.getIssueByNumber(number);\n if (!issue) throw new Error(`Issue #${number} not found.`);\n return ix.listComments(issue.id);\n },\n\n async \"issue.label\"(number: number, label: string) {\n const ix = requireIssueX();\n const issue = await ix.getIssueByNumber(number);\n if (!issue) throw new Error(`Issue #${number} not found.`);\n // Find or create label by name\n let labelObj = await ix.getLabelByName(label);\n if (!labelObj) labelObj = await ix.createLabel({ name: label });\n await ix.addLabel(issue.id, labelObj.id);\n return ix.getIssueByNumber(number);\n },\n\n async \"issue.unlabel\"(number: number, label: string) {\n const ix = requireIssueX();\n const issue = await ix.getIssueByNumber(number);\n if (!issue) throw new Error(`Issue #${number} not found.`);\n const labelObj = await ix.getLabelByName(label);\n if (!labelObj) throw new Error(`Label \"${label}\" not found.`);\n await ix.removeLabel(issue.id, labelObj.id);\n return ix.getIssueByNumber(number);\n },\n };\n}\n\n// ================================================================\n// Helpers\n// ================================================================\n\nfunction formatRXM(rxm: any): string {\n const lines: string[] = [`--- RXM: ${rxm.locator} ---`];\n const def = rxm.definition;\n if (def) {\n if (def.author) lines.push(`Author: ${def.author}`);\n if (def.description) lines.push(`Description: ${def.description}`);\n }\n const source = rxm.source;\n if (source?.files) {\n lines.push(\"Files:\");\n lines.push(renderFileTree(source.files, \" \"));\n }\n lines.push(\"---\");\n return lines.join(\"\\n\");\n}\n\nfunction renderFileTree(files: Record<string, any>, indent = \"\"): string {\n const lines: string[] = [];\n for (const [name, value] of Object.entries(files)) {\n if (value && typeof value === \"object\" && !(\"size\" in value)) {\n lines.push(`${indent}${name}`);\n lines.push(renderFileTree(value, `${indent} `));\n } else {\n const size = value?.size ? ` (${value.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AM,KAAK,QAAQ;AACnB,UAAM,KAAK,eAAe,OAAO,OAAO,IAAI,CAAC;AAAA,EAC/C;AACA,QAAM,KAAK,KAAK;AAChB,SAAO,MAAM,KAAK,IAAI;AACxB;AAEA,SAAS,eAAe,OAA4B,SAAS,IAAY;AACvE,QAAM,QAAkB,CAAC;AACzB,aAAW,CAAC,MAAM,KAAK,KAAK,OAAO,QAAQ,KAAK,GAAG;AACjD,QAAI,SAAS,OAAO,UAAU,YAAY,EAAE,UAAU,QAAQ;AAC5D,YAAM,KAAK,GAAG,MAAM,GAAG,IAAI,EAAE;AAC7B,YAAM,KAAK,eAAe,OAAO,GAAG,MAAM,IAAI,CAAC;AAAA,IACjD,OAAO;AACL,YAAM,OAAO,OAAO,OAAO,KAAK,MAAM,IAAI,YAAY;AACtD,YAAM,KAAK,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,EAAE;AAAA,IACtC;AAAA,EACF;AACA,SAAO,MAAM,OAAO,OAAO,EAAE,KAAK,IAAI;AACxC;","names":["def","past","individual","principle","procedure","goal","plan","task","encounter","experience","exp","prin","project","scope","milestone","deliverable","wiki","charter","position","duty","lines","def"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rolexjs/prototype",
3
- "version": "1.4.0-dev-20260304140703",
3
+ "version": "1.4.0-dev-20260305002626",
4
4
  "description": "RoleX schema-driven API definition layer",
5
5
  "keywords": [
6
6
  "rolex",
@@ -39,9 +39,9 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@issuexjs/core": "^0.2.0",
42
- "@rolexjs/core": "1.4.0-dev-20260304140703",
43
- "@rolexjs/system": "1.4.0-dev-20260304140703",
44
- "@rolexjs/parser": "1.4.0-dev-20260304140703",
42
+ "@rolexjs/core": "1.4.0-dev-20260305002626",
43
+ "@rolexjs/system": "1.4.0-dev-20260305002626",
44
+ "@rolexjs/parser": "1.4.0-dev-20260305002626",
45
45
  "issuexjs": "^0.2.0",
46
46
  "resourcexjs": "^2.14.0"
47
47
  },