dsh-novel-write-engine 0.2.2 → 0.2.3

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.
@@ -75,7 +75,10 @@ export interface SummaryDto {
75
75
  quality?: {
76
76
  averageScore: number;
77
77
  scores: number[];
78
- trend: number;
78
+ trend: number | null;
79
+ trend_basis?: 'last_five_vs_previous_five' | 'insufficient_samples' | 'insufficient_history';
80
+ samples?: number;
81
+ attempts?: number;
79
82
  };
80
83
  health?: {
81
84
  ok: boolean;
@@ -88,6 +91,17 @@ export interface SummaryDto {
88
91
  chapter: number;
89
92
  status: string;
90
93
  }>;
94
+ advisories?: Array<{
95
+ code: string;
96
+ detail: string;
97
+ hint?: string;
98
+ }>;
99
+ /** Advisory codes the author has already acknowledged in the current check. */
100
+ acknowledgedAdvisories?: number;
101
+ legacy?: Array<{
102
+ code: string;
103
+ detail: string;
104
+ }>;
91
105
  }
92
106
  export interface ChapterRowDto {
93
107
  num: number;
@@ -115,7 +129,8 @@ export interface ProjectOptionDto {
115
129
  title: string;
116
130
  active: boolean;
117
131
  registered: boolean;
118
- state: 'ok' | 'damaged' | 'missing' | 'unreadable';
132
+ state: 'ok' | 'damaged' | 'missing' | 'not-project' | 'unreadable';
133
+ identity_changed?: boolean;
119
134
  }
120
135
  export interface PanelSelectionDto {
121
136
  root: string | null;
@@ -124,8 +139,8 @@ export interface PanelSelectionDto {
124
139
  export interface PanelMissingDto {
125
140
  root: string;
126
141
  title: string;
127
- code: 'ENGINE_PROJECT_MISSING' | 'ENGINE_PROJECT_NOT_FOUND';
128
- reason: 'missing' | 'not-project' | 'damaged' | 'not_registered' | 'unreadable';
142
+ code: 'ENGINE_PROJECT_MISSING' | 'ENGINE_PROJECT_NOT_FOUND' | 'ENGINE_TXN_IN_PROGRESS';
143
+ reason: 'missing' | 'not-project' | 'damaged' | 'not_registered' | 'unreadable' | 'busy';
129
144
  hint: string;
130
145
  }
131
146
  export interface PanelPayloadDto {
@@ -26,7 +26,9 @@ export interface PanelProject {
26
26
  label: string;
27
27
  active: boolean;
28
28
  registered: boolean;
29
- state: 'ok' | 'damaged' | 'missing' | 'unreadable';
29
+ state: 'ok' | 'damaged' | 'missing' | 'not-project' | 'unreadable';
30
+ identity_changed?: boolean;
31
+ group: 'writing' | 'damaged' | 'missing';
30
32
  selected: boolean;
31
33
  }
32
34
  export interface PanelMissing {
@@ -105,7 +107,10 @@ export interface PanelView {
105
107
  quality: {
106
108
  averageScore: number;
107
109
  scores: number[];
108
- trend: number;
110
+ trend: number | null;
111
+ trendText: string;
112
+ samples: number;
113
+ attempts: number;
109
114
  };
110
115
  health: {
111
116
  ok: boolean;
@@ -118,6 +123,19 @@ export interface PanelView {
118
123
  chapter: number;
119
124
  status: string;
120
125
  }>;
126
+ /** Machine advisories, shown separately from blocking gates. */
127
+ advisories: Array<{
128
+ code: string;
129
+ detail: string;
130
+ hint: string;
131
+ }>;
132
+ /** How many advisory codes the author already acknowledged. */
133
+ acknowledgedAdvisories: number;
134
+ /** Read-only upgrade findings, shown separately from live errors. */
135
+ legacy: Array<{
136
+ code: string;
137
+ detail: string;
138
+ }>;
121
139
  nextTitle: string;
122
140
  nextDetail: string;
123
141
  nextTool: string;
@@ -126,7 +144,7 @@ export interface PanelView {
126
144
  revision: string;
127
145
  next: string;
128
146
  }
129
- export declare const PANEL_SCHEMA_VERSION = 4;
147
+ export declare const PANEL_SCHEMA_VERSION = 5;
130
148
  /**
131
149
  * Project the wire payload into strings. Version mismatch wins over everything
132
150
  * else: a stale panel must never render data from another schema as if it were
@@ -4,7 +4,7 @@ export declare const PLUGIN_NAME = "dsh-novel-write-engine";
4
4
  export declare const PANEL_ID = "novel-workshop";
5
5
  export declare const PANEL_ROUTE = "/api/novel-write-engine/panel";
6
6
  export declare const SKILL_NAME = "novel-write-engine";
7
- export declare const REMOTE_VERSION = 4;
7
+ export declare const REMOTE_VERSION = 5;
8
8
  /** The panel is a recent-history view; the wire payload and UI use one cap. */
9
9
  export declare const PANEL_CHAPTER_LIMIT = 30;
10
10
  /** Project-relative locations. Every write goes through these constants. */
@@ -63,9 +63,13 @@ export declare const ERROR_CODES: {
63
63
  readonly PROJECT_IDENTITY_MISMATCH: "ENGINE_PROJECT_IDENTITY_MISMATCH";
64
64
  readonly PROJECT_EXISTS: "ENGINE_PROJECT_EXISTS";
65
65
  readonly STAGE_ORDER: "ENGINE_STAGE_ORDER";
66
+ /** The exact same keyed submission already failed in the same context. */
67
+ readonly RETRY_UNCHANGED: "ENGINE_RETRY_UNCHANGED";
66
68
  readonly GATE_BLOCKED: "ENGINE_GATE_BLOCKED";
67
69
  readonly READING_PROOF_INVALID: "ENGINE_READING_PROOF_INVALID";
68
70
  readonly SCORE_MISMATCH: "ENGINE_SCORE_MISMATCH";
71
+ /** A revision tried to rewrite reviewer-owned issue fields. */
72
+ readonly ISSUE_IMMUTABLE: "ENGINE_ISSUE_IMMUTABLE";
69
73
  readonly DELTA_UNVERIFIED: "ENGINE_DELTA_UNVERIFIED";
70
74
  readonly RESOURCE_NEGATIVE_BALANCE: "ENGINE_RESOURCE_NEGATIVE_BALANCE";
71
75
  readonly SCHEMA_TOO_NEW: "ENGINE_SCHEMA_TOO_NEW";
@@ -464,6 +468,8 @@ export interface ForeshadowsDocument {
464
468
  resolved_at: number | null;
465
469
  description: string;
466
470
  anchor?: string;
471
+ /** New 0.2.3 writes are distinguishable from pre-0.2.3 rows by this marker. */
472
+ format_version?: 1;
467
473
  advance_log: Array<{
468
474
  chapter: number;
469
475
  note: string;
@@ -786,7 +792,13 @@ export interface BookReport {
786
792
  min: number;
787
793
  max: number;
788
794
  last_five: number[];
789
- trend: number;
795
+ /** Null when there are not enough distinct chapter reviews to compare. */
796
+ trend: number | null;
797
+ trend_basis: 'last_five_vs_previous_five' | 'insufficient_samples' | 'insufficient_history';
798
+ /** Number of chapters represented by a final review. */
799
+ samples: number;
800
+ /** Committed review rounds for this report, including history. */
801
+ attempts: number;
790
802
  dimensions: Array<{
791
803
  id: string;
792
804
  average: number;
@@ -1013,6 +1025,8 @@ export interface StatusReport {
1013
1025
  chapter: number;
1014
1026
  /** The chapter the pipeline is currently working on. */
1015
1027
  active_chapter: number;
1028
+ /** SHA-256 of the active manuscript, or null when the stage has no draft. */
1029
+ manuscript_hash: string | null;
1016
1030
  stage: Stage;
1017
1031
  rounds: RoundCounters;
1018
1032
  blocking: BlockingItem[];
@@ -1089,6 +1103,10 @@ export interface AuditRow {
1089
1103
  /** True when no transaction started: the gate/input refused the call. */
1090
1104
  attempt?: boolean;
1091
1105
  blocking?: BlockingItem[];
1106
+ /** Keyed operation fingerprint; lets an identical failed retry be refused. */
1107
+ retry_key?: string;
1108
+ /** Brief/stage/revision context for `retry_key`. */
1109
+ retry_context?: string;
1092
1110
  }
1093
1111
  /** One diff hunk between two revisions of a chapter. */
1094
1112
  export interface DiffReport {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-novel-write-engine",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Novel writing engine for DeepSeek Harness: state machine, gates, rulepacks and ledgers moved from prompts into code.",
5
5
  "keywords": [
6
6
  "dsh-plugin",
@@ -1,6 +1,6 @@
1
1
  schema_version: 1
2
2
  name: default
3
- version: "1.0.0"
3
+ version: "1.0.1"
4
4
 
5
5
  lexicon:
6
6
  zero_tolerance:
@@ -145,7 +145,9 @@ punctuation:
145
145
  base: { 战斗/动作章: 3, 日常过渡章: 4, 情感爆发章: 6, 纯叙事章: 3 }
146
146
  scale_words: 3000
147
147
  token: "——"
148
- period_density: { min: 1.5, max: 8 }
148
+ # Chinese web fiction often uses short sentences; 8/100 flagged ordinary
149
+ # narrative (e.g. 9.52/100). Keep a ceiling, but calibrate it for Chinese.
150
+ period_density: { min: 1.5, max: 10 }
149
151
  ellipsis_run: { max: 1, token: "……" }
150
152
  uniform_sentence: { min_sentences: 8, ratio: 0.6 }
151
153
  consecutive_le: { max: 3, char: "了" }