@hikae/ledger-core 0.3.0 → 0.3.2
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/README.md +1 -1
- package/dist/holds.d.ts +1 -1
- package/dist/holds.js +4 -4
- package/dist/ports.js +1 -1
- package/dist/pr.js +1 -1
- package/dist/stage.js +1 -1
- package/dist/tiers.d.ts +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @hikae/ledger-core
|
|
2
2
|
|
|
3
|
-
Pure core shared by the local ledger agent and
|
|
3
|
+
Pure core shared by the local ledger agent and a host (the libghostty of ledger). No I/O, no cloud SDKs.
|
|
4
4
|
|
|
5
5
|
- `tiers`: ladder-based self-improving model routing (`seedFor`, `tierFor`, `evolve`).
|
|
6
6
|
- `stage`: Issue factory stage machine (`issueStage`, `ISSUE_STAGES`).
|
package/dist/holds.d.ts
CHANGED
|
@@ -17,5 +17,5 @@ export declare const HUMAN_HOLD_LABEL = "factory:paused";
|
|
|
17
17
|
export declare const BOT_HOLD_LABEL = "factory:held";
|
|
18
18
|
/** Active at `now` for the item's current head. */
|
|
19
19
|
export declare function holdActive(h: Hold, now: number, headSha?: string): boolean;
|
|
20
|
-
/** Holds a label set implies (
|
|
20
|
+
/** Holds a label set implies (a host stores holds as labels). */
|
|
21
21
|
export declare function labelHolds(key: string, labels: Iterable<string>, at: string): Hold[];
|
package/dist/holds.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Holds: why an item (or the whole provider) is not being worked on. The union of ledger's doctor holds, task HOLD
|
|
2
|
-
// answers and escalation refusals with
|
|
2
|
+
// answers and escalation refusals with a host's label holds, provider hold, failure-count holds and leases.
|
|
3
3
|
export const HOLD_REASONS = [
|
|
4
|
-
//
|
|
4
|
+
// queue-side holds (a local queue: drafts, scopes, parked or dispatched items)
|
|
5
5
|
"draft", "scope_excluded", "approved_at_head", "merge_loop", "parked", "dispatched_to_human", "escalation_refused",
|
|
6
|
-
//
|
|
6
|
+
// store-side holds (labels, provider back-off, failure counts, leases)
|
|
7
7
|
"human_label", "bot_label", "provider", "repair_failures", "triage_failures", "lease", "lock",
|
|
8
8
|
// both
|
|
9
9
|
"owner_hold",
|
|
@@ -18,7 +18,7 @@ export function holdActive(h, now, headSha) {
|
|
|
18
18
|
return false;
|
|
19
19
|
return true;
|
|
20
20
|
}
|
|
21
|
-
/** Holds a label set implies (
|
|
21
|
+
/** Holds a label set implies (a host stores holds as labels). */
|
|
22
22
|
export function labelHolds(key, labels, at) {
|
|
23
23
|
const s = new Set([...labels].map((l) => l.toLowerCase()));
|
|
24
24
|
const out = [];
|
package/dist/ports.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
// Ports: what the core needs from its host.
|
|
1
|
+
// Ports: what the core needs from its host. A host implements them with DynamoDB/S3/GitHub App; the local ledger with
|
|
2
2
|
// SQLite/files/gh. The core never imports a host SDK.
|
|
3
3
|
export const systemClock = { now: () => Date.now() };
|
package/dist/pr.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// PR ledger row statuses and the invalidation transition, shared by ledger (app/src/ledger.ts) and
|
|
1
|
+
// PR ledger row statuses and the invalidation transition, shared by ledger (app/src/ledger.ts) and a host
|
|
2
2
|
// (src/ledger.mjs). ledger's authored-PR statuses are part of the union.
|
|
3
3
|
export const ACTIVE_STATUSES = ["queued", "reviewing", "waiting_ci", "changes_requested", "ready_to_approve", "approval_pending_verification",
|
|
4
4
|
"approved", "human_required", "merged_waiting_release", "release_in_progress", "post_release_monitoring", "recovering",
|
package/dist/stage.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Issue stage machine: the factory stage of an Issue derived from its state and labels. Shared by the local ledger and
|
|
2
|
-
//
|
|
2
|
+
// a host so both boards read the same stage for the same Issue.
|
|
3
3
|
export const ISSUE_STAGES = ["triage", "queued", "in_progress", "verifying", "human_required", "backlog", "completed", "closed"];
|
|
4
4
|
export function issueStage(issue) {
|
|
5
5
|
const labels = new Set((issue.labels ?? []).map((l) => String((typeof l === "object" && l !== null ? l.name : l) ?? l).toLowerCase()));
|
package/dist/tiers.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export interface TierPolicy {
|
|
|
17
17
|
gated?: boolean;
|
|
18
18
|
effort?: string;
|
|
19
19
|
}>;
|
|
20
|
-
/** Default reasoning effort (ledger passes it to the worker;
|
|
20
|
+
/** Default reasoning effort (ledger passes it to the worker; a host omits it). */
|
|
21
21
|
effort?: string;
|
|
22
22
|
}
|
|
23
23
|
export interface Outcome {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hikae/ledger-core",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Pure core shared by the local ledger agent and
|
|
3
|
+
"version": "0.3.2",
|
|
4
|
+
"description": "Pure core shared by the local ledger agent and a host: model tier policy, issue stage machine, port interfaces.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|