@plasius/item-crafting
v0.1.11
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.
Factory helpers reject blank identifiers, unsupported enums, invalid timestamps, and malformed retry metadata at runtime before freezing public contract payloads.
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
Release integrity
CI keeps the administrative contributor registry outside Git and npm package
artifacts using exact, case-normalised path checks. CI runs on approved
GitHub-hosted runners for same-repository pull requests and main, with
package-manager cache finalization disabled; fork PR code is denied.
Publication uses the GitHub-hosted production job with Node 24 and a pinned
npm 11.6.2 client. It is token-free and proceeds only while the prepared SHA
is the exact main head after successful push-triggered CI. Do not dispatch CD
until the npm trusted-publisher binding is verified.
