feat: 회의 파일 가져오기와 입력 엔진 배포 보완
This commit is contained in:
parent
5a8c5cd792
commit
b3519e5da7
54 changed files with 1129 additions and 116 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
These tools separate a proven service race from unverified claims about physical keys and real CPU/model load.
|
||||
|
||||
1. Run `node scripts/verification/typing-race-proof.mjs` from the checkout root. It overlays three HEAD services in memory while keeping current dependencies and tests. A successful comparison requires the old services to corrupt the next Hangul word in three independent timing cases, the current services to preserve it, and unchanged-input correction to work in both. The other 13 assertions cover UIA snapshot contracts. This is not a complete installed-release A/B.
|
||||
1. Run `node scripts/verification/typing-race-proof.mjs` from the checkout root. It overlays three services from the pre-fix commit `f49acf01057cc100b9caeace6eada26cf7bf4b54` in memory while keeping current dependencies and tests. Override with `--baseline <commit>` when investigating another baseline; the report records both commits and source hashes. A successful comparison requires the old services to corrupt the next Hangul word in three independent timing cases, the current services to preserve it, and unchanged-input correction to work in both. The other 13 assertions cover UIA snapshot contracts. This is not a complete installed-release A/B.
|
||||
2. Build `typing-fixture/build.ps1` and `typing-runtime/build.ps1`. Quit the installed app and manually open the isolated runtime launcher as required by repository AGENTS.md. Do not run `run-desktop.bat` for this experiment; it kills unrelated Electron processes. Keep the test profile separate from the personal profile. The runtime receipt records the product bundle hash and product package version; the wrapper itself is not a released installer.
|
||||
3. Run the fixture with correction off, then correction on, saving each JSON under a distinct name. Use default Hangul IME mode first. Require exact calibration text and native IME composition messages. Compare all three requested paces under idle and bounded CPU load. A missing/aborted case, mismatched text, partial SendInput return or absent IME evidence is not a pass. Report achieved pacing, accepted key events and CPU samples during the input window, not just the requested load.
|
||||
4. Prove the correction path is active with Latin layout correction mode and a correction-enabled profile. A zero-loss Hangul run alone could simply mean the correction path never ran. Disable learned-text persistence throughout.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// Deterministic source A/B. No GUI, input injection, checkout mutation, or personal data.
|
||||
// Run from this checkout: node scripts/verification/typing-race-proof.mjs
|
||||
// Run from this checkout: node scripts/verification/typing-race-proof.mjs [--baseline <commit>]
|
||||
import { execFileSync, spawnSync } from 'node:child_process'
|
||||
import { createHash } from 'node:crypto'
|
||||
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'
|
||||
|
|
@ -28,9 +28,17 @@ mkdirSync(output, { recursive: true })
|
|||
const sha256 = (text) => createHash('sha256').update(text).digest('hex')
|
||||
const normalized = (file) => path.resolve(file).replaceAll('\\', '/').toLowerCase()
|
||||
const head = execFileSync('git', ['rev-parse', 'HEAD'], { cwd: root, encoding: 'utf8' }).trim()
|
||||
const args = process.argv.slice(2)
|
||||
if (args.length !== 0 && (args.length !== 2 || args[0] !== '--baseline')) {
|
||||
throw new Error('Usage: typing-race-proof.mjs [--baseline <commit>]')
|
||||
}
|
||||
// The fix is now committed: HEAD is no longer a broken baseline.
|
||||
const baselineRef = args[1] ?? 'f49acf01057cc100b9caeace6eada26cf7bf4b54'
|
||||
const baselineCommit = execFileSync('git', ['rev-parse', '--verify', '--end-of-options', `${baselineRef}^{commit}`],
|
||||
{ cwd: root, encoding: 'utf8' }).trim()
|
||||
const overrides = {}
|
||||
const evidence = sources.map((file) => {
|
||||
const baseline = execFileSync('git', ['show', `${head}:${file}`], { cwd: root, encoding: 'utf8', maxBuffer: 4_000_000 })
|
||||
const baseline = execFileSync('git', ['show', `${baselineCommit}:${file}`], { cwd: root, encoding: 'utf8', maxBuffer: 4_000_000 })
|
||||
const current = readFileSync(path.join(root, file), 'utf8')
|
||||
overrides[normalized(path.join(root, file))] = baseline
|
||||
return { file, baselineSha256: sha256(baseline), currentSha256: sha256(current) }
|
||||
|
|
@ -38,14 +46,14 @@ const evidence = sources.map((file) => {
|
|||
const testEvidence = tests.map((file) => ({
|
||||
file: `apps/desktop/${file}`, currentSha256: sha256(readFileSync(path.join(desktop, file), 'utf8'))
|
||||
}))
|
||||
writeFileSync(path.join(output, 'head-source-overrides.json'), JSON.stringify(overrides))
|
||||
writeFileSync(path.join(output, 'baseline-source-overrides.json'), JSON.stringify(overrides))
|
||||
const configPath = path.join(output, 'vitest.proof.config.mjs')
|
||||
writeFileSync(configPath, `
|
||||
import { readFileSync } from 'node:fs';
|
||||
const overrides = process.env.D3RO_RACE_BASELINE === '1'
|
||||
? JSON.parse(readFileSync(${JSON.stringify(path.join(output, 'head-source-overrides.json'))}, 'utf8')) : {};
|
||||
? JSON.parse(readFileSync(${JSON.stringify(path.join(output, 'baseline-source-overrides.json'))}, 'utf8')) : {};
|
||||
export default {
|
||||
plugins: [{ name: 'read-only-head-source-overlay', enforce: 'pre', load(id) {
|
||||
plugins: [{ name: 'read-only-baseline-source-overlay', enforce: 'pre', load(id) {
|
||||
return overrides[id.split('?')[0].replaceAll('\\\\', '/').toLowerCase()] ?? null;
|
||||
}}],
|
||||
test: { environment: 'node', globals: true,
|
||||
|
|
@ -59,7 +67,7 @@ export default {
|
|||
`)
|
||||
const runs = []
|
||||
for (const baseline of [true, false]) {
|
||||
const label = baseline ? 'baseline-head' : 'current-fix'
|
||||
const label = baseline ? 'baseline-source' : 'current-fix'
|
||||
const resultPath = path.join(output, `${label}.json`)
|
||||
const result = spawnSync(process.execPath, [vitest, 'run', ...tests, '--config', configPath,
|
||||
'--reporter=json', `--outputFile=${resultPath}`], {
|
||||
|
|
@ -77,9 +85,9 @@ for (const baseline of [true, false]) {
|
|||
}
|
||||
const report = {
|
||||
capturedAt: new Date().toISOString(), kind: 'deterministic-source-ab-not-gui',
|
||||
head, node: process.version, sources: evidence, tests: testEvidence, runs,
|
||||
head, baselineCommit, node: process.version, sources: evidence, tests: testEvidence, runs,
|
||||
sourcesUnchangedDuringRun: [...evidence, ...testEvidence].every(({ file, currentSha256 }) => sha256(readFileSync(path.join(root, file), 'utf8')) === currentSha256),
|
||||
baselineScope: 'Only the three listed services are loaded from HEAD; dependencies, test doubles and tests are current in both runs. This is not a full historical release test.',
|
||||
baselineScope: 'Only the three listed services are loaded from baselineCommit; dependencies, test doubles and tests are current in both runs. This is not a full historical release test.',
|
||||
scope: 'Actual TypoCorrectionService + TextInsertService with an in-memory text sink, and actual InputTelemetryService with delayed UIA responses. Three text-preservation cases isolate timestamp, revision and native-tick guards; one unchanged-input control must still correct. The remaining 13 cases check snapshot invalidation/metadata/coalescing contracts, not 13 independent text-loss reproductions. Native keys, OS IME, model loading and CPU stress are not exercised.'
|
||||
}
|
||||
writeFileSync(path.join(output, 'report.json'), JSON.stringify(report, null, 2) + '\n')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue