@plasius/item-crafting
v0.1.4
Published
Apprenticeship-gated item-crafting access and authority boundary contracts for Plasius
Maintainers
Readme
@plasius/item-crafting
Apprenticeship-gated item-crafting access and authority boundary contracts for Plasius.
Apache-2.0. ESM + CJS builds. TypeScript types included.
Installation
npm install @plasius/item-craftingScope
@plasius/item-crafting owns the authority-side boundary for:
- apprenticeship-gated access state
- crafting discipline readiness
- workshop boundary metadata
- privacy-safe crafting work-order payloads and workshop throughput assumptions
- portable host descriptors for training-to-crafting handoffs
- bounded retry and failure-policy metadata for handoff contracts
Demo
npm run build
node demo/example.mjsUsage
import {
createHandoffRetryPolicy,
createItemCraftingAccessState,
createItemCraftingHandoffContract,
createItemCraftingWorkOrderRecord,
defaultItemCraftingThroughputAssumptions,
itemCraftingPrivacyScaleRollout,
} from "@plasius/item-crafting";
const state = createItemCraftingAccessState({
apprenticeshipReady: true,
discipline: "smithing",
workshopTier: "local",
});
const workOrder = createItemCraftingWorkOrderRecord({
crafterSubjectId: "crafter-sub-1",
workshopId: "workshop-1",
discipline: state.discipline,
workshopTier: state.workshopTier,
updatedAtIso: new Date().toISOString(),
});
console.log(itemCraftingPrivacyScaleRollout.featureFlagId);
console.log(defaultItemCraftingThroughputAssumptions.maxConcurrentWorkOrders);
console.log(workOrder.workshopId);
const retryPolicy = createHandoffRetryPolicy({
timeoutMs: 1250,
maxAttempts: 3,
retryableFailureCodes: ["CRAFTING_TIMEOUT"],
terminalFailureCodes: ["APPRENTICESHIP_MISSING"],
});
const handoff = createItemCraftingHandoffContract({
handoffId: "handoff-1",
apprenticeshipReady: state.apprenticeshipReady,
discipline: state.discipline,
workshopTier: state.workshopTier,
sourceHost: {
hostId: "training-authority",
runtime: "server",
transport: "http",
capabilityFlags: ["trace-linked"],
},
targetHost: {
hostId: "crafting-authority",
runtime: "worker",
transport: "queue",
capabilityFlags: ["replay-safe"],
},
retryPolicy,
});
console.log(handoff.targetHost.transport);Privacy And Scale Baseline
The package exports an inherited rollout descriptor for the cross-repo feature
flag isekai.training-progression.privacy-scale.enabled.
When that rollout is enabled, package consumers should prefer the minimal
ItemCraftingWorkOrderRecord contract:
crafterSubjectIdis the only player-linked identifier and is expected to be pseudonymous- profile names, chat text, payment details, and free-form work notes are outside the package contract
itemCraftingFieldPoliciesdocuments the retention and sensitivity expectation for every exported work-order fielddefaultItemCraftingThroughputAssumptionspublishes the validated workshop and crafting-event envelope used by the package docs and tests
Governance
- ADRs: docs/adrs
- TDRs: docs/tdrs
- Design notes: docs/design
