human-to-code 0.1.16 → 0.1.17
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
CHANGED
|
@@ -56,7 +56,7 @@ By default this runs the **direct converter**, not an instruction to rewrite the
|
|
|
56
56
|
1. Loads config and scans the project for `.human` files and inline `@human` markers, without importing application modules or executing project configuration.
|
|
57
57
|
2. Reports marker-shaped requests in unsupported file types and refuses a `.human` request whose sibling output already exists. Intentionally ignored directories and symlinks remain outside discovery.
|
|
58
58
|
3. Prints a receipt (language, provider, model, and the exact worklist) and asks for confirmation. Nothing is written until you confirm — or pass `-y`/`--yes`. If no request is found it returns `NEEDS_INPUT`.
|
|
59
|
-
4. On confirmation, converts each item with one model completion per unit, extracts one unambiguous code block, and validates the complete candidate before writing. JavaScript and TypeScript use the TypeScript parser; other supported languages receive a deterministic structural syntax check.
|
|
59
|
+
4. On confirmation, converts each item with one model completion per unit, extracts one unambiguous code block, and validates the complete candidate before writing. JavaScript and TypeScript use the TypeScript parser; other supported languages receive a deterministic structural syntax check. Inline validation compares the candidate with the original file and rejects only syntax errors introduced by that replacement, without blaming it for unchanged baseline errors.
|
|
60
60
|
5. Applies each accepted item defensively: new sibling files use exclusive creation, inline markers must still match the bytes found during discovery, and multi-line replacements inherit the marker's indentation. A failing or stale item is skipped with a reason rather than aborting the rest.
|
|
61
61
|
|
|
62
62
|
The direct converter writes code straight to the working tree. Its syntax gate catches malformed output; it does **not** prove API correctness, run project builds or tests, execute code in a sandbox, create a `.strict.human.json` change contract, produce a `VERIFIED` run, or perform the guided pipeline's repository-wide secret scan — only the indexed declarations it attaches to an inline prompt as context are secret-scanned (a finding is `SECURITY_BLOCKED`). For the reviewed contract → grounding → sandbox-validation lifecycle — where the `.strict.human.json` contract and the `VERIFIED`/`apply`/`rollback` machinery live — use `human-to-code guided` (see [The reviewed change contract](#the-reviewed-change-contract) and the [CLI](#cli) table).
|
package/SECURITY.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
`human-to-code` reads attacker-controlled repositories, sends selected evidence to an LLM provider, and may execute project validation commands. The project therefore treats repository content, model output, documentation, provider endpoints, and build/test tooling as untrusted.
|
|
4
4
|
|
|
5
|
-
Version `0.1.
|
|
5
|
+
Version `0.1.16` is a preview. The shipped ecosystem and provider/model combinations are not certified, so guided generated runs do not reach `VERIFIED` through the CLI and guided automatic application/rollback remain unreachable for normal generated runs. The default direct converter is a separate convenience path that writes accepted units to the working tree after confirmation; it never claims `VERIFIED`. Do not weaken either boundary to make a preview run appear successful.
|
|
6
6
|
|
|
7
7
|
## Trust boundaries
|
|
8
8
|
|
|
@@ -28,8 +28,9 @@ Unreadable roots, non-directories, symlinked roots, scan truncation, conflicting
|
|
|
28
28
|
|
|
29
29
|
The direct converter treats model text as untrusted before writing: it accepts
|
|
30
30
|
at most one unambiguous fenced code block, validates the complete candidate's
|
|
31
|
-
syntax/structure
|
|
32
|
-
|
|
31
|
+
new syntax/structure diagnostics relative to the unchanged baseline, refuses
|
|
32
|
+
existing sibling targets using both discovery checks and exclusive creation,
|
|
33
|
+
verifies exact inline marker bytes again at apply time,
|
|
33
34
|
and preserves marker indentation. Invalid or stale units are retried within the
|
|
34
35
|
bounded generation policy and then skipped without mutation.
|
|
35
36
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"candidate-validation.d.ts","sourceRoot":"","sources":["../../../src/agents/direct/candidate-validation.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,qBAAa,8BAA+B,SAAQ,KAAK;gBAC3C,OAAO,EAAE,MAAM;CAI5B;
|
|
1
|
+
{"version":3,"file":"candidate-validation.d.ts","sourceRoot":"","sources":["../../../src/agents/direct/candidate-validation.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,qBAAa,8BAA+B,SAAQ,KAAK;gBAC3C,OAAO,EAAE,MAAM;CAI5B;AAqID,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE9F;AAED,iFAAiF;AACjF,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsB7F"}
|
|
@@ -10,7 +10,22 @@ export class DirectCandidateValidationError extends Error {
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
const TYPESCRIPT_EXTENSIONS = new Set([".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs"]);
|
|
13
|
-
function
|
|
13
|
+
function newlyIntroducedDiagnostic(baseline, candidate) {
|
|
14
|
+
const remainingBaseline = new Map();
|
|
15
|
+
for (const diagnostic of baseline) {
|
|
16
|
+
remainingBaseline.set(diagnostic.key, (remainingBaseline.get(diagnostic.key) ?? 0) + 1);
|
|
17
|
+
}
|
|
18
|
+
for (const diagnostic of candidate) {
|
|
19
|
+
const remaining = remainingBaseline.get(diagnostic.key) ?? 0;
|
|
20
|
+
if (remaining > 0)
|
|
21
|
+
remainingBaseline.set(diagnostic.key, remaining - 1);
|
|
22
|
+
else
|
|
23
|
+
return diagnostic;
|
|
24
|
+
}
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
function balancedSyntaxDiagnostics(text, sourcePath) {
|
|
28
|
+
const diagnostics = [];
|
|
14
29
|
const stack = [];
|
|
15
30
|
let quote;
|
|
16
31
|
let triple;
|
|
@@ -75,15 +90,22 @@ function validateBalancedSyntax(text, sourcePath) {
|
|
|
75
90
|
else if (char === ")" || char === "]" || char === "}") {
|
|
76
91
|
const expected = char === ")" ? "(" : char === "]" ? "[" : "{";
|
|
77
92
|
if (stack.pop() !== expected) {
|
|
78
|
-
|
|
93
|
+
diagnostics.push({ key: `delimiter:${expected}:${char}`, message: "mismatched delimiters" });
|
|
79
94
|
}
|
|
80
95
|
}
|
|
81
96
|
}
|
|
82
|
-
if (quote
|
|
83
|
-
|
|
97
|
+
if (quote)
|
|
98
|
+
diagnostics.push({ key: `quote:${quote}`, message: "an unterminated string" });
|
|
99
|
+
if (triple)
|
|
100
|
+
diagnostics.push({ key: `triple:${triple}`, message: "an unterminated multiline string" });
|
|
101
|
+
if (blockComment)
|
|
102
|
+
diagnostics.push({ key: "comment:block", message: "an unterminated block comment" });
|
|
103
|
+
for (const delimiter of stack) {
|
|
104
|
+
diagnostics.push({ key: `delimiter:${delimiter}`, message: "an unterminated delimiter" });
|
|
84
105
|
}
|
|
106
|
+
return diagnostics;
|
|
85
107
|
}
|
|
86
|
-
function
|
|
108
|
+
function typeScriptSyntaxDiagnostics(text, sourcePath) {
|
|
87
109
|
const extension = extname(sourcePath).toLowerCase();
|
|
88
110
|
const jsx = extension === ".tsx" || extension === ".jsx";
|
|
89
111
|
const result = ts.transpileModule(text, {
|
|
@@ -96,17 +118,25 @@ function validateTypeScriptSyntax(text, sourcePath) {
|
|
|
96
118
|
allowJs: true,
|
|
97
119
|
},
|
|
98
120
|
});
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
121
|
+
return (result.diagnostics ?? [])
|
|
122
|
+
.filter((diagnostic) => diagnostic.category === ts.DiagnosticCategory.Error)
|
|
123
|
+
.map((diagnostic) => {
|
|
124
|
+
const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, " ");
|
|
125
|
+
return { key: `${diagnostic.code}:${message}`, message };
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
async function sourceAndCandidateForUnit(unit, code) {
|
|
129
|
+
if (unit.kind === "file") {
|
|
130
|
+
return { candidate: code.endsWith("\n") ? code : `${code}\n` };
|
|
103
131
|
}
|
|
132
|
+
const baseline = await readFile(unit.absoluteSource, "utf8");
|
|
133
|
+
return {
|
|
134
|
+
baseline,
|
|
135
|
+
candidate: replaceInlineMarker(baseline, unit.range, unit.expectedMarker, code),
|
|
136
|
+
};
|
|
104
137
|
}
|
|
105
138
|
export async function candidateTextForUnit(unit, code) {
|
|
106
|
-
|
|
107
|
-
return code.endsWith("\n") ? code : `${code}\n`;
|
|
108
|
-
const source = await readFile(unit.absoluteSource, "utf8");
|
|
109
|
-
return replaceInlineMarker(source, unit.range, unit.expectedMarker, code);
|
|
139
|
+
return (await sourceAndCandidateForUnit(unit, code)).candidate;
|
|
110
140
|
}
|
|
111
141
|
/** Validate the complete candidate file before any direct-agent write occurs. */
|
|
112
142
|
export async function validateGeneratedUnit(unit, code) {
|
|
@@ -116,10 +146,19 @@ export async function validateGeneratedUnit(unit, code) {
|
|
|
116
146
|
throw new DirectCandidateValidationError(`${unit.sourcePath}: model formatting remained in generated source.`);
|
|
117
147
|
}
|
|
118
148
|
const sourcePath = unit.kind === "file" ? unit.outputPath : unit.sourcePath;
|
|
119
|
-
const candidate = await
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
149
|
+
const { baseline, candidate } = await sourceAndCandidateForUnit(unit, code);
|
|
150
|
+
const typescript = TYPESCRIPT_EXTENSIONS.has(extname(sourcePath).toLowerCase());
|
|
151
|
+
const baselineDiagnostics = baseline === undefined
|
|
152
|
+
? []
|
|
153
|
+
: typescript
|
|
154
|
+
? typeScriptSyntaxDiagnostics(baseline, sourcePath)
|
|
155
|
+
: balancedSyntaxDiagnostics(baseline, sourcePath);
|
|
156
|
+
const candidateDiagnostics = typescript
|
|
157
|
+
? typeScriptSyntaxDiagnostics(candidate, sourcePath)
|
|
158
|
+
: balancedSyntaxDiagnostics(candidate, sourcePath);
|
|
159
|
+
const introduced = newlyIntroducedDiagnostic(baselineDiagnostics, candidateDiagnostics);
|
|
160
|
+
if (introduced) {
|
|
161
|
+
throw new DirectCandidateValidationError(`${sourcePath}: generated candidate failed syntax validation: ${introduced.message}.`);
|
|
162
|
+
}
|
|
124
163
|
}
|
|
125
164
|
//# sourceMappingURL=candidate-validation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"candidate-validation.js","sourceRoot":"","sources":["../../../src/agents/direct/candidate-validation.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGvD,MAAM,OAAO,8BAA+B,SAAQ,KAAK;IACvD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,gCAAgC,CAAC;IAC/C,CAAC;CACF;AAED,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"candidate-validation.js","sourceRoot":"","sources":["../../../src/agents/direct/candidate-validation.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGvD,MAAM,OAAO,8BAA+B,SAAQ,KAAK;IACvD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,gCAAgC,CAAC;IAC/C,CAAC;CACF;AAED,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAOtF,SAAS,yBAAyB,CAChC,QAA8C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AC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,UAAW,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;IAC7E,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,yBAAyB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5E,MAAM,UAAU,GAAG,qBAAqB,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IAChF,MAAM,mBAAmB,GAAG,QAAQ,KAAK,SAAS;QAChD,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,UAAU;YACV,CAAC,CAAC,2BAA2B,CAAC,QAAQ,EAAE,UAAU,CAAC;YACnD,CAAC,CAAC,yBAAyB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IACtD,MAAM,oBAAoB,GAAG,UAAU;QACrC,CAAC,CAAC,2BAA2B,CAAC,SAAS,EAAE,UAAU,CAAC;QACpD,CAAC,CAAC,yBAAyB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACrD,MAAM,UAAU,GAAG,yBAAyB,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,CAAC;IACxF,IAAI,UAAU,EAAE,CAAC;QACf,MAAM,IAAI,8BAA8B,CACtC,GAAG,UAAU,mDAAmD,UAAU,CAAC,OAAO,GAAG,CACtF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/docs/MODULES.md
CHANGED
|
@@ -88,7 +88,7 @@ accept typed, already-reviewed data and perform no I/O or mutation.
|
|
|
88
88
|
| `discovery.ts` | Bounded file walking and conversion-unit creation, including existing-target and unsupported-marker notices. |
|
|
89
89
|
| `declarations.ts` | Language-aware declared-identifier extraction, including type-led C, C++, C#, and Java declarations. |
|
|
90
90
|
| `replacement.ts` | Exact inline-marker byte verification plus newline-preserving indentation formatting shared by memory and application. |
|
|
91
|
-
| `candidate-validation.ts` |
|
|
91
|
+
| `candidate-validation.ts` | Baseline-aware pre-write syntax gate: TypeScript parser diagnostics for JS/TS and deterministic structure checks for other direct languages. Inline units are rejected only for newly introduced diagnostics. It does not claim semantic or sandbox verification. |
|
|
92
92
|
| `file-memory.ts` | Ephemeral declaration memory, replacement normalization, candidate-validation retry isolation, and sequential per-file generation. |
|
|
93
93
|
| `generation-client.ts` | One direct provider request through OpenAI-compatible chat or Ollama, using the central direct prompt builder. |
|
|
94
94
|
| `presentation.ts` | Stable conversion receipt and unambiguous single-code-block extraction; rejects multiple or unterminated fences. |
|