@runeditrun/rer 0.2.73 → 0.2.75
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/cli/contract.mjs +1 -1
- package/cli/export.mjs +1 -1
- package/cli/parse.mjs +1 -0
- package/cli/portability-worker.mjs +6 -7
- package/cli/release.mjs +9 -0
- package/cli/site-check.mjs +4 -2
- package/cli/site-prepare.mjs +6 -0
- package/cli/site-render.mjs +7 -1
- package/cli/site-runtime.mjs +55 -0
- package/cli/site.mjs +45 -17
- package/global/CHANGELOG.md +13 -0
- package/modules/container/build.mjs +2 -1
- package/modules/deploy-kit/README.md +47 -2
- package/modules/deploy-kit/owner-cli.mjs +2 -1
- package/modules/deploy-kit/site-readback.mjs +12 -2
- package/modules/deploy-kit/site-runtime.mjs +33 -0
- package/modules/deploy-kit/site.mjs +27 -8
- package/modules/operator-auth/scheduled/definition.mjs +3 -1
- package/modules/operator-auth/scheduled/expiry.mjs +2 -2
- package/modules/operator-auth/scheduled/fence.mjs +2 -1
- package/modules/operator-auth/scheduled/runner.mjs +13 -5
- package/modules/portability/README.md +27 -8
- package/modules/portability/backfills.mjs +22 -14
- package/modules/portability/bridge.mjs +9 -6
- package/modules/portability/migration-sql.mjs +8 -0
- package/modules/portability/migration-statements.mjs +22 -17
- package/modules/portability/rebuilds.mjs +106 -0
- package/modules/portability/replay-views.mjs +35 -0
- package/modules/release/produce.mjs +5 -3
- package/modules/release/publication-scan.mjs +5 -4
- package/modules/site/docs-search/SearchField.tsx +18 -0
- package/modules/site/docs-search/artifacts.mjs +54 -0
- package/modules/site/docs-search/client.ts +194 -0
- package/modules/site/docs-search/index-build.mjs +63 -0
- package/modules/site/docs-search/retrieve.ts +16 -0
- package/modules/site/docs-search/search.css +19 -0
- package/modules/site/docs-search/sections.ts +24 -0
- package/modules/site/docs-search/types.ts +14 -0
- package/modules/site/docs-search/worker.ts +39 -0
- package/package.json +1 -1
- package/scripts/publish-check/README.md +6 -1
- package/scripts/publish-check/cli.py +8 -4
- package/scripts/publish-check/history_hydration.py +4 -1
- package/scripts/publish-check/slots.py +67 -0
- package/scripts/publish-check/timeout.json +1 -0
- package/scripts/publish-check/timeout.mjs +14 -0
- package/scripts/publish-check.mjs +18 -5
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { tokens, identifier, folded } from './generated.mjs';
|
|
2
|
+
import { statementNames, dataStatement } from './migration-statements.mjs';
|
|
3
|
+
|
|
4
|
+
// Resolve the latest view definitions in the applied history, rather than
|
|
5
|
+
// trusting an independently edited sqlite_master view. Nested views resolve
|
|
6
|
+
// recursively; cycles and reads of non-carried tables refuse replay.
|
|
7
|
+
export function replayViews(statements) {
|
|
8
|
+
const views=new Map();
|
|
9
|
+
for(const sql of statements) {
|
|
10
|
+
const list=tokens(sql),words=list.map(t=>t.quoted?undefined:folded(t.text));
|
|
11
|
+
if(!['create','drop'].includes(words[0]) || words[1]!=='view')continue;
|
|
12
|
+
const at=words[2]==='if'?(words[0]==='create'?5:4):2,name=folded(identifier(list[at]));
|
|
13
|
+
if(words[0]==='drop'){views.delete(name);continue;}
|
|
14
|
+
const as=list.findIndex((t,i)=>i>at && !t.quoted && folded(t.text)==='as');
|
|
15
|
+
if(as<0){views.set(name,undefined);continue;}
|
|
16
|
+
const body=sql.slice(list[as].end),data=dataStatement('INSERT INTO rer_view_probe '+body);
|
|
17
|
+
views.set(name,{names:statementNames(body),words:data?.words??[],star:data?.star});
|
|
18
|
+
}
|
|
19
|
+
return views;
|
|
20
|
+
}
|
|
21
|
+
export function viewReads(names,words,{views,tables,carried,table,secrets},seen=new Set()) {
|
|
22
|
+
const reads=[];
|
|
23
|
+
for(const name of names.filter(n=>tables.includes(n) && n!==table)) {
|
|
24
|
+
if(!views.has(name)){if(!carried.includes(name))return false;reads.push(name);continue;}
|
|
25
|
+
const view=views.get(name);
|
|
26
|
+
if(!view || seen.has(name))return false;
|
|
27
|
+
const nested=viewReads(view.names,[...words,...view.words],{views,tables,carried,table,secrets},new Set([...seen,name]));
|
|
28
|
+
if(!nested)return false;
|
|
29
|
+
// A wildcard could expose a secret column through a renamed view output.
|
|
30
|
+
if(view.star && nested.some(n=>Object.entries(secrets).some(([t,columns])=>folded(t)===n && columns.length)))return false;
|
|
31
|
+
reads.push(...nested);
|
|
32
|
+
}
|
|
33
|
+
if(reads.some(name=>Object.entries(secrets).some(([t,columns])=>folded(t)===name && columns.some(c=>words.includes(folded(c))))))return false;
|
|
34
|
+
return reads;
|
|
35
|
+
}
|
|
@@ -12,11 +12,13 @@ import { releasePublicBase } from './public-base.mjs';
|
|
|
12
12
|
import { prepareTagAdoption, confirmTagAdoption, assertTagAdoption } from './tag-adoption.mjs';
|
|
13
13
|
import { placeholderMarks, placeholderMessage } from '../../cli/placeholder-mark.mjs';
|
|
14
14
|
import { cleanupTemporary } from './cleanup.mjs';
|
|
15
|
+
import { parseTimeoutSeconds } from '../../scripts/publish-check/timeout.mjs';
|
|
15
16
|
|
|
16
17
|
// Failure output belongs to the private receipt, not the site preview.
|
|
17
18
|
const withoutOutput = gates => JSON.parse(JSON.stringify(gates, (key, value) => key === 'output' ? undefined : value));
|
|
18
19
|
|
|
19
|
-
export async function release({ repo, ref = 'HEAD', output, project, repository, dryRun = false, tag = false, cleanHistory: clean = false, envFile, onto, publicBase, localVerify = false, allowPlaceholderMark = false, verifyWorkflow }) {
|
|
20
|
+
export async function release({ repo, ref = 'HEAD', output, project, repository, dryRun = false, tag = false, cleanHistory: clean = false, envFile, onto, publicBase, localVerify = false, allowPlaceholderMark = false, verifyWorkflow, scanTimeoutSeconds }) {
|
|
21
|
+
if (scanTimeoutSeconds !== undefined) scanTimeoutSeconds = parseTimeoutSeconds(scanTimeoutSeconds, { integer: true });
|
|
20
22
|
if (!/^[\w.-]+\/[\w.-]+$/.test(project ?? '')) throw Error('--project must be publisher/name');
|
|
21
23
|
if (!/^https:\/\/github\.com\/[\w.-]+\/[\w.-]+(?:\.git)?$/i.test(repository ?? '')) throw Error('--repository must be a credential-free GitHub repository URL');
|
|
22
24
|
if (onto !== undefined && clean) throw Error('--onto and --clean-history are mutually exclusive');
|
|
@@ -60,8 +62,8 @@ export async function release({ repo, ref = 'HEAD', output, project, repository,
|
|
|
60
62
|
const exported = destination ? publicChild(source, temporary, destination, publicParent, Boolean(tag))
|
|
61
63
|
: clean ? cleanHistory(source, temporary, Boolean(tag)) : null;
|
|
62
64
|
let report = exported
|
|
63
|
-
? publicationScan(exported.repo, exported.commit, envFile, project, repository, scanBase)
|
|
64
|
-
: sourcePublicationScan(source, temporary, envFile, project, repository, scanBase, Boolean(tag), adopted);
|
|
65
|
+
? publicationScan(exported.repo, exported.commit, envFile, project, repository, scanBase, undefined, scanTimeoutSeconds)
|
|
66
|
+
: sourcePublicationScan(source, temporary, envFile, project, repository, scanBase, Boolean(tag), adopted, scanTimeoutSeconds);
|
|
65
67
|
if (destination) {
|
|
66
68
|
assertPublicTree(exported.repo, exported.commit, source.tree);
|
|
67
69
|
if (report.status === 'PASS' && (report.complete !== true || report.guarantees?.historyScanned !== true ||
|
|
@@ -17,14 +17,15 @@ export function validatePublicationDestination(source, project, repository) {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export function publicationScan(repo, ref, envFile, project, repository, publicBase, annotationFile) {
|
|
20
|
+
export function publicationScan(repo, ref, envFile, project, repository, publicBase, annotationFile, scanTimeoutSeconds) {
|
|
21
21
|
const started = performance.now();
|
|
22
22
|
let report;
|
|
23
23
|
try {
|
|
24
24
|
report = JSON.parse(execFileSync(process.execPath,
|
|
25
25
|
[resolve(import.meta.dirname, '../../scripts/publish-check.mjs'), '--repo', repo, '--ref', ref,
|
|
26
26
|
...(publicBase ? ['--public-base', publicBase] : []), ...(project != null ? ['--project', project] : []), ...(repository != null ? ['--repository', repository] : []), ...(envFile ? ['--env-file', envFile] : []),
|
|
27
|
-
...(annotationFile ? ['--annotation-file', annotationFile] : [])
|
|
27
|
+
...(annotationFile ? ['--annotation-file', annotationFile] : []),
|
|
28
|
+
...(scanTimeoutSeconds === undefined ? [] : ['--timeout-seconds', String(scanTimeoutSeconds)])],
|
|
28
29
|
{ stdio: ['ignore', 'pipe', 'pipe'], maxBuffer: 128 * 1024 * 1024 }));
|
|
29
30
|
} catch (error) {
|
|
30
31
|
try { report = JSON.parse(error.stdout); }
|
|
@@ -39,7 +40,7 @@ export function publicationScan(repo, ref, envFile, project, repository, publicB
|
|
|
39
40
|
// seed. Materialize raw committed bytes, without checkout filters or export
|
|
40
41
|
// attributes, and mirror every source ref for the existing history policy.
|
|
41
42
|
// Neither the caller's local files nor verification output enters this tree.
|
|
42
|
-
export function sourcePublicationScan(source, temporary, envFile, project, repository, publicBase, tagged, adopted) {
|
|
43
|
+
export function sourcePublicationScan(source, temporary, envFile, project, repository, publicBase, tagged, adopted, scanTimeoutSeconds) {
|
|
43
44
|
const started = performance.now();
|
|
44
45
|
const candidate = sourceTree(source, resolve(temporary, 'publication'));
|
|
45
46
|
git(source.repo, 'clone', '--mirror', '--no-hardlinks', '--', source.repo, resolve(candidate, '.git'));
|
|
@@ -61,7 +62,7 @@ export function sourcePublicationScan(source, temporary, envFile, project, repos
|
|
|
61
62
|
git(candidate, 'tag', '-d', name);
|
|
62
63
|
}
|
|
63
64
|
const stagingSeconds = (performance.now() - started) / 1000;
|
|
64
|
-
const report = publicationScan(candidate, source.commit, envFile, project, repository, publicBase, annotationFile);
|
|
65
|
+
const report = publicationScan(candidate, source.commit, envFile, project, repository, publicBase, annotationFile, scanTimeoutSeconds);
|
|
65
66
|
Object.assign(report.invocation, { stagingSeconds, totalSeconds: (performance.now() - started) / 1000 });
|
|
66
67
|
return report;
|
|
67
68
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import './search.css';
|
|
2
|
+
|
|
3
|
+
/** Static markup; the standalone site's client enhances each instance. */
|
|
4
|
+
export function SearchField({ id, endpoint = '/docs/search' }: { id: string; endpoint?: string }) {
|
|
5
|
+
return <div className="docs-search" data-docs-search data-endpoint={endpoint}>
|
|
6
|
+
<label className="docs-search-label" htmlFor={id}>Search docs</label>
|
|
7
|
+
<div className="docs-search-field">
|
|
8
|
+
<input id={id} type="search" placeholder="Search docs" autoComplete="off" spellCheck={false}
|
|
9
|
+
role="combobox" aria-autocomplete="list" aria-haspopup="listbox" aria-expanded="false"
|
|
10
|
+
aria-controls={`${id}-results`} aria-describedby={`${id}-status`} />
|
|
11
|
+
<kbd aria-hidden="true">/</kbd>
|
|
12
|
+
</div>
|
|
13
|
+
<div className="docs-search-panel" data-search-panel hidden>
|
|
14
|
+
<p id={`${id}-status`} className="docs-search-status" role="status" aria-live="polite" aria-atomic="true">Search the docs</p>
|
|
15
|
+
<ul id={`${id}-results`} className="docs-search-results" role="listbox" aria-label="Search results" hidden />
|
|
16
|
+
</div>
|
|
17
|
+
</div>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { mkdir, readFile, rename, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { relative, resolve } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { createRequire } from 'node:module';
|
|
5
|
+
import { buildSearchIndex } from './index-build.mjs';
|
|
6
|
+
|
|
7
|
+
// The seed owns its build toolchain; rer remains dependency-free for offline launch.
|
|
8
|
+
const { build } = createRequire(resolve('package.json'))('esbuild');
|
|
9
|
+
|
|
10
|
+
/** Explicit credentialed build step. A failure stops publication; no lexical fallback. */
|
|
11
|
+
export async function buildSearchArtifacts({ corpus, assets, output, previousUrl, endpoint = '/docs/search', localName = 'docs-search-local', compatibilityDate = '2026-09-08' }, { embed, accountId } = {}) {
|
|
12
|
+
const pages = JSON.parse(await readFile(corpus, 'utf8'));
|
|
13
|
+
await mkdir(output, { recursive: true });
|
|
14
|
+
const indexPath = resolve(output, 'index.json');
|
|
15
|
+
const previous = [];
|
|
16
|
+
try { previous.push(JSON.parse(await readFile(indexPath, 'utf8'))); }
|
|
17
|
+
catch (error) { if (error.code !== 'ENOENT') throw error; }
|
|
18
|
+
if (previousUrl) {
|
|
19
|
+
const response = await fetch(previousUrl, { signal: AbortSignal.timeout(15000) });
|
|
20
|
+
if (response.status !== 404) {
|
|
21
|
+
if (!response.ok) throw Error(`Previous search artifact unavailable (${response.status}); build stopped.`);
|
|
22
|
+
previous.push(await response.json());
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const remoteEmbed = async (model, input) => {
|
|
26
|
+
if (!process.env.CLOUDFLARE_API_TOKEN || !accountId) throw Error('Search indexing requires CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN (Workers AI Read).');
|
|
27
|
+
const response = await fetch(`https://api.cloudflare.com/client/v4/accounts/${accountId}/ai/run/${model}`, {
|
|
28
|
+
method: 'POST', headers: { Authorization: `Bearer ${process.env.CLOUDFLARE_API_TOKEN}`, 'Content-Type': 'application/json' },
|
|
29
|
+
body: JSON.stringify(input), signal: AbortSignal.timeout(60000),
|
|
30
|
+
});
|
|
31
|
+
if (!response.ok) throw Error(`Workers AI embedding failed (${response.status}); build stopped.`);
|
|
32
|
+
const body = await response.json();
|
|
33
|
+
if (!body.success) throw Error('Workers AI refused embeddings; build stopped.');
|
|
34
|
+
return body.result;
|
|
35
|
+
};
|
|
36
|
+
const { index, counts } = await buildSearchIndex(pages, { previous, embed: embed ?? remoteEmbed,
|
|
37
|
+
onBatch: ({ embedded, total }) => console.log(`Docs search embeddings: ${embedded}/${total}`) });
|
|
38
|
+
const bytes = JSON.stringify(index);
|
|
39
|
+
await writeFile(`${indexPath}.new`, bytes);
|
|
40
|
+
await rename(`${indexPath}.new`, indexPath);
|
|
41
|
+
// Published with the same assets as the pages; the next clean deployment
|
|
42
|
+
// reuses these vectors by content hash, never a crawler or an update timer.
|
|
43
|
+
await writeFile(resolve(assets, 'docs-search-vectors.json'), bytes);
|
|
44
|
+
const runtime = fileURLToPath(new URL('./worker.ts', import.meta.url));
|
|
45
|
+
await build({ stdin: { contents: `import {createSearchWorker} from ${JSON.stringify(runtime)};export default createSearchWorker(${JSON.stringify({ endpoint, corpusHash: index.corpusHash })});`,
|
|
46
|
+
resolveDir: resolve(output), sourcefile: 'site-search-entry.ts', loader: 'ts' }, bundle: true, format: 'esm', platform: 'browser', target: 'es2022', outfile: resolve(output, 'worker.mjs') });
|
|
47
|
+
const configuration = { name: localName, main: './worker.mjs', compatibility_date: compatibilityDate,
|
|
48
|
+
...(accountId ? { account_id: accountId } : {}), workers_dev: false,
|
|
49
|
+
assets: { directory: relative(resolve(output), resolve(assets)), binding: 'ASSETS', run_worker_first: true, html_handling: 'auto-trailing-slash', not_found_handling: '404-page' },
|
|
50
|
+
ai: { binding: 'AI', remote: true } };
|
|
51
|
+
await writeFile(resolve(output, 'wrangler.json'), `${JSON.stringify(configuration, null, 2)}\n`);
|
|
52
|
+
console.log(`Docs search: total=${counts.total} reused=${counts.reused} embedded=${counts.embedded} bytes=${Buffer.byteLength(bytes)}`);
|
|
53
|
+
return { index, counts };
|
|
54
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
type SearchResult = { href: string; titlePath: string[]; snippet: string; score: number };
|
|
2
|
+
const mounted = new WeakMap<HTMLElement, () => void>();
|
|
3
|
+
|
|
4
|
+
function readResults(payload: unknown): SearchResult[] {
|
|
5
|
+
if (!payload || typeof payload !== 'object' || !('results' in payload) || !Array.isArray(payload.results)) {
|
|
6
|
+
throw new Error('Invalid search response');
|
|
7
|
+
}
|
|
8
|
+
return payload.results.slice(0, 5).map((value: unknown) => {
|
|
9
|
+
if (!value || typeof value !== 'object' || !('href' in value) || typeof value.href !== 'string'
|
|
10
|
+
|| !('titlePath' in value) || !Array.isArray(value.titlePath) || !value.titlePath.every((part: unknown) => typeof part === 'string')
|
|
11
|
+
|| !('snippet' in value) || typeof value.snippet !== 'string'
|
|
12
|
+
|| !('score' in value) || typeof value.score !== 'number' || !Number.isFinite(value.score)) {
|
|
13
|
+
throw new Error('Invalid search result');
|
|
14
|
+
}
|
|
15
|
+
const url = new URL(value.href, document.baseURI);
|
|
16
|
+
if (url.origin !== location.origin || !['http:', 'https:'].includes(url.protocol)) throw new Error('Invalid search link');
|
|
17
|
+
return { href: url.href, titlePath: value.titlePath, snippet: value.snippet, score: value.score };
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function mount(root: HTMLElement): () => void {
|
|
22
|
+
const input = root.querySelector<HTMLInputElement>('input[type="search"]');
|
|
23
|
+
const panel = root.querySelector<HTMLElement>('[data-search-panel]');
|
|
24
|
+
const list = root.querySelector<HTMLUListElement>('[role="listbox"]');
|
|
25
|
+
const status = root.querySelector<HTMLElement>('[role="status"]');
|
|
26
|
+
if (!input || !panel || !list || !status) throw new Error('Incomplete docs search field');
|
|
27
|
+
const address = root.dataset.endpoint;
|
|
28
|
+
if (!address) throw new Error('Docs search endpoint is missing');
|
|
29
|
+
const baseEndpoint = new URL(address, document.baseURI);
|
|
30
|
+
const listeners = new AbortController();
|
|
31
|
+
let request: AbortController | undefined;
|
|
32
|
+
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
33
|
+
let revision = 0;
|
|
34
|
+
let links: HTMLAnchorElement[] = [];
|
|
35
|
+
let active = -1;
|
|
36
|
+
let renderedQuery: string | undefined;
|
|
37
|
+
|
|
38
|
+
function cancel() {
|
|
39
|
+
revision += 1;
|
|
40
|
+
clearTimeout(timer);
|
|
41
|
+
timer = undefined;
|
|
42
|
+
request?.abort();
|
|
43
|
+
request = undefined;
|
|
44
|
+
list!.removeAttribute('aria-busy');
|
|
45
|
+
}
|
|
46
|
+
function select(index: number) {
|
|
47
|
+
active = index;
|
|
48
|
+
links.forEach((link, position) => link.setAttribute('aria-selected', String(position === active)));
|
|
49
|
+
if (links[active]) input!.setAttribute('aria-activedescendant', links[active].id);
|
|
50
|
+
else input!.removeAttribute('aria-activedescendant');
|
|
51
|
+
}
|
|
52
|
+
function close() {
|
|
53
|
+
cancel();
|
|
54
|
+
panel!.hidden = true;
|
|
55
|
+
input!.setAttribute('aria-expanded', 'false');
|
|
56
|
+
select(-1);
|
|
57
|
+
}
|
|
58
|
+
function message(text: string) {
|
|
59
|
+
links = [];
|
|
60
|
+
select(-1);
|
|
61
|
+
list!.replaceChildren();
|
|
62
|
+
list!.hidden = true;
|
|
63
|
+
status!.textContent = text;
|
|
64
|
+
}
|
|
65
|
+
function show() {
|
|
66
|
+
panel!.hidden = false;
|
|
67
|
+
input!.setAttribute('aria-expanded', 'true');
|
|
68
|
+
}
|
|
69
|
+
function render(results: SearchResult[]) {
|
|
70
|
+
message(results.length ? '' : 'No results');
|
|
71
|
+
const fragment = document.createDocumentFragment();
|
|
72
|
+
links = results.map((result, index) => {
|
|
73
|
+
const item = document.createElement('li');
|
|
74
|
+
item.setAttribute('role', 'none');
|
|
75
|
+
const link = document.createElement('a');
|
|
76
|
+
link.id = `${list!.id}-${index}`;
|
|
77
|
+
link.href = result.href;
|
|
78
|
+
link.tabIndex = -1;
|
|
79
|
+
link.setAttribute('role', 'option');
|
|
80
|
+
link.setAttribute('aria-selected', 'false');
|
|
81
|
+
const title = document.createElement('span');
|
|
82
|
+
title.className = 'docs-search-result-title';
|
|
83
|
+
title.textContent = result.titlePath.join(' > ');
|
|
84
|
+
const snippet = document.createElement('span');
|
|
85
|
+
snippet.className = 'docs-search-result-snippet';
|
|
86
|
+
snippet.textContent = result.snippet;
|
|
87
|
+
link.appendChild(title);
|
|
88
|
+
link.appendChild(snippet);
|
|
89
|
+
item.appendChild(link);
|
|
90
|
+
fragment.appendChild(item);
|
|
91
|
+
return link;
|
|
92
|
+
});
|
|
93
|
+
list!.appendChild(fragment);
|
|
94
|
+
list!.hidden = !links.length;
|
|
95
|
+
}
|
|
96
|
+
function search() {
|
|
97
|
+
cancel();
|
|
98
|
+
show();
|
|
99
|
+
renderedQuery = undefined;
|
|
100
|
+
const query = input!.value.trim();
|
|
101
|
+
if (query.length < 2) { message('Search the docs'); return; }
|
|
102
|
+
message('Searching…');
|
|
103
|
+
const current = revision;
|
|
104
|
+
timer = setTimeout(async () => {
|
|
105
|
+
const controller = new AbortController();
|
|
106
|
+
request = controller;
|
|
107
|
+
list!.setAttribute('aria-busy', 'true');
|
|
108
|
+
try {
|
|
109
|
+
const endpoint = new URL(baseEndpoint);
|
|
110
|
+
endpoint.searchParams.set('q', query);
|
|
111
|
+
const response = await fetch(endpoint, { signal: controller.signal, headers: { Accept: 'application/json' } });
|
|
112
|
+
if (!response.ok) throw new Error('Search request failed');
|
|
113
|
+
const results = readResults(await response.json());
|
|
114
|
+
if (current !== revision || controller.signal.aborted) return;
|
|
115
|
+
renderedQuery = query;
|
|
116
|
+
render(results);
|
|
117
|
+
} catch {
|
|
118
|
+
if (current === revision && !controller.signal.aborted) message('Search unavailable');
|
|
119
|
+
} finally {
|
|
120
|
+
if (current === revision) {
|
|
121
|
+
request = undefined;
|
|
122
|
+
list!.removeAttribute('aria-busy');
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}, 240);
|
|
126
|
+
}
|
|
127
|
+
const options = { signal: listeners.signal };
|
|
128
|
+
input.addEventListener('input', search, options);
|
|
129
|
+
input.addEventListener('focus', () => {
|
|
130
|
+
if (renderedQuery === input.value.trim()) show();
|
|
131
|
+
else search();
|
|
132
|
+
}, options);
|
|
133
|
+
input.addEventListener('keydown', event => {
|
|
134
|
+
if (event.isComposing) return;
|
|
135
|
+
if (event.key === 'Escape') { event.preventDefault(); close(); }
|
|
136
|
+
else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
|
|
137
|
+
event.preventDefault();
|
|
138
|
+
if (panel.hidden && renderedQuery !== input.value.trim()) search();
|
|
139
|
+
else show();
|
|
140
|
+
if (links.length) {
|
|
141
|
+
const next = active < 0 ? (event.key === 'ArrowDown' ? 0 : links.length - 1)
|
|
142
|
+
: (active + (event.key === 'ArrowDown' ? 1 : -1) + links.length) % links.length;
|
|
143
|
+
select(next);
|
|
144
|
+
links[next].scrollIntoView({ block: 'nearest' });
|
|
145
|
+
}
|
|
146
|
+
} else if (event.key === 'Enter' && !panel.hidden && links.length) {
|
|
147
|
+
event.preventDefault();
|
|
148
|
+
links[active < 0 ? 0 : active].click();
|
|
149
|
+
}
|
|
150
|
+
}, options);
|
|
151
|
+
list.addEventListener('pointerdown', event => event.preventDefault(), options);
|
|
152
|
+
list.addEventListener('pointerover', event => {
|
|
153
|
+
const target = event.target instanceof Element ? event.target.closest('a') : null;
|
|
154
|
+
const index = links.findIndex(link => link === target);
|
|
155
|
+
if (index >= 0) select(index);
|
|
156
|
+
}, options);
|
|
157
|
+
document.addEventListener('pointerdown', event => {
|
|
158
|
+
if (event.target instanceof Node && !root.contains(event.target)) close();
|
|
159
|
+
}, options);
|
|
160
|
+
document.addEventListener('focusin', event => {
|
|
161
|
+
if (event.target instanceof Node && !root.contains(event.target)) close();
|
|
162
|
+
}, options);
|
|
163
|
+
document.addEventListener('keydown', event => {
|
|
164
|
+
if (event.key !== '/' || event.defaultPrevented || event.isComposing || event.ctrlKey || event.metaKey || event.altKey) return;
|
|
165
|
+
const target = event.target;
|
|
166
|
+
if (target instanceof Element && target.closest('input, textarea, select, [contenteditable]:not([contenteditable="false"])')) return;
|
|
167
|
+
const details = root.closest('details');
|
|
168
|
+
if (!input.getClientRects().length && !(details && !details.open && details.getClientRects().length)) return;
|
|
169
|
+
event.preventDefault();
|
|
170
|
+
if (details) details.open = true;
|
|
171
|
+
input.focus();
|
|
172
|
+
input.select();
|
|
173
|
+
}, options);
|
|
174
|
+
return () => { close(); listeners.abort(); mounted.delete(root); };
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/** Idempotent enhancement; cleanup only removes instances created by this call. */
|
|
178
|
+
export function initDocsSearch(scope: ParentNode = document): () => void {
|
|
179
|
+
const roots = Array.from(scope.querySelectorAll<HTMLElement>('[data-docs-search]'));
|
|
180
|
+
if (scope instanceof HTMLElement && scope.matches('[data-docs-search]')) roots.unshift(scope);
|
|
181
|
+
const cleanups: (() => void)[] = [];
|
|
182
|
+
for (const root of roots) {
|
|
183
|
+
if (mounted.has(root)) continue;
|
|
184
|
+
const cleanup = mount(root);
|
|
185
|
+
mounted.set(root, cleanup);
|
|
186
|
+
cleanups.push(cleanup);
|
|
187
|
+
}
|
|
188
|
+
return () => cleanups.forEach(cleanup => cleanup());
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (typeof document !== 'undefined') {
|
|
192
|
+
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', () => initDocsSearch(), { once: true });
|
|
193
|
+
else initDocsSearch();
|
|
194
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
|
|
3
|
+
export const model = '@cf/baai/bge-base-en-v1.5';
|
|
4
|
+
export const pooling = 'cls';
|
|
5
|
+
export const dimensions = 768;
|
|
6
|
+
const digest = value => createHash('sha256').update(value).digest('hex');
|
|
7
|
+
|
|
8
|
+
// Keep long sections inside the model's context. Every part keeps the same
|
|
9
|
+
// heading link; retrieval collapses duplicate links after scoring.
|
|
10
|
+
function parts(text) {
|
|
11
|
+
const chunks = [];
|
|
12
|
+
// Paragraph boundaries are stable cache boundaries. Within a long paragraph,
|
|
13
|
+
// keep sentences together so a short task isn't diluted by an entire guide.
|
|
14
|
+
for (const paragraph of text.split(/\n\n+/).filter(Boolean)) {
|
|
15
|
+
let part = '';
|
|
16
|
+
const sentences = paragraph.split(/(?<=[.!?])\s+/);
|
|
17
|
+
for (const sentence of sentences) {
|
|
18
|
+
if (part && part.length + sentence.length > 650) { chunks.push(part.trim()); part = ''; }
|
|
19
|
+
if (sentence.length > 650) {
|
|
20
|
+
for (const word of sentence.split(/\s+/).filter(Boolean)) {
|
|
21
|
+
if (part && part.length + word.length > 650) { chunks.push(part.trim()); part = ''; }
|
|
22
|
+
if (word.length > 650) {
|
|
23
|
+
if (part) { chunks.push(part.trim()); part = ''; }
|
|
24
|
+
for (let i = 0; i < word.length; i += 650) chunks.push(word.slice(i, i + 650));
|
|
25
|
+
} else part += `${part ? ' ' : ''}${word}`;
|
|
26
|
+
}
|
|
27
|
+
} else part += `${part ? ' ' : ''}${sentence.trim()}`;
|
|
28
|
+
}
|
|
29
|
+
if (part.trim()) chunks.push(part.trim());
|
|
30
|
+
}
|
|
31
|
+
return chunks;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function searchChunks(pages) {
|
|
35
|
+
return pages.flatMap(page => page.searchSections.flatMap(section => parts(section.text).map(text => {
|
|
36
|
+
const href = `${page.href}#${section.anchor}`;
|
|
37
|
+
const hash = digest(JSON.stringify([model, pooling, href, section.titlePath, text]));
|
|
38
|
+
return { ...section, text, href, hash };
|
|
39
|
+
})));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function validVector(vector) {
|
|
43
|
+
return Array.isArray(vector) && vector.length === dimensions && vector.every(Number.isFinite) && vector.some(value => value !== 0);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export async function buildSearchIndex(pages, { previous = [], embed, onBatch = () => {} }) {
|
|
47
|
+
const chunks = searchChunks(pages);
|
|
48
|
+
const cached = new Map(previous.filter(index => index?.version === 1 && index.model === model && index.pooling === pooling && index.dimensions === dimensions)
|
|
49
|
+
.flatMap(index => index.chunks).filter(chunk => validVector(chunk.vector)).map(chunk => [chunk.hash, chunk.vector]));
|
|
50
|
+
const missing = chunks.filter(chunk => !cached.has(chunk.hash));
|
|
51
|
+
let embedded = 0;
|
|
52
|
+
for (let offset = 0; offset < missing.length; offset += 32) {
|
|
53
|
+
const batch = missing.slice(offset, offset + 32);
|
|
54
|
+
const response = await embed(model, { text: batch.map(chunk => `${chunk.titlePath.join(' > ')}\n${chunk.text}`), pooling });
|
|
55
|
+
if (response.data?.length !== batch.length || !response.data.every(validVector)) throw Error('Workers AI returned invalid embeddings; search build stopped.');
|
|
56
|
+
batch.forEach((chunk, i) => cached.set(chunk.hash, response.data[i].map(value => Number(value.toFixed(6)))));
|
|
57
|
+
embedded += batch.length;
|
|
58
|
+
onBatch({ embedded, total: missing.length });
|
|
59
|
+
}
|
|
60
|
+
const index = { version: 1, model, pooling, dimensions, corpusHash: digest(chunks.map(chunk => chunk.hash).join('\n')),
|
|
61
|
+
chunks: chunks.map(chunk => ({ ...chunk, vector: cached.get(chunk.hash) })) };
|
|
62
|
+
return { index, counts: { total: chunks.length, reused: chunks.length - embedded, embedded } };
|
|
63
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SearchIndex, SearchResult } from './types';
|
|
2
|
+
|
|
3
|
+
const magnitude = (vector: number[]) => Math.sqrt(vector.reduce((sum, value) => sum + value * value, 0));
|
|
4
|
+
export function search(index: SearchIndex, query: number[], minimumScore = 0.55): SearchResult[] {
|
|
5
|
+
if (query.length !== index.dimensions || !query.every(Number.isFinite)) throw Error('Invalid query embedding');
|
|
6
|
+
const norm = magnitude(query);
|
|
7
|
+
if (!norm) throw Error('Empty query embedding');
|
|
8
|
+
const ranked = index.chunks.map(chunk => ({
|
|
9
|
+
href: chunk.href,
|
|
10
|
+
titlePath: chunk.titlePath,
|
|
11
|
+
snippet: chunk.text.length > 155 ? `${chunk.text.slice(0, 154).replace(/\s+\S*$/, '')}…` : chunk.text,
|
|
12
|
+
score: chunk.vector.reduce((sum, value, i) => sum + value * query[i], 0) / (norm * magnitude(chunk.vector)),
|
|
13
|
+
})).filter(result => result.score >= minimumScore).sort((a, b) => b.score - a.score);
|
|
14
|
+
const seen = new Set<string>();
|
|
15
|
+
return ranked.filter(result => { if (seen.has(result.href)) return false; seen.add(result.href); return true; }).slice(0, 5);
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* Inline results stay inside the sidebar's scroll area and the phone menu. */
|
|
2
|
+
.docs-search { min-width: 0; margin-bottom: 26px; color: var(--ink); }
|
|
3
|
+
.docs-search-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
|
|
4
|
+
.docs-search-field { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px; padding: 0 10px; border: 1px solid var(--rule); border-radius: 7px; background: var(--paper); }
|
|
5
|
+
.docs-search-field:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
|
|
6
|
+
.docs-search input { display: block; width: 100%; min-width: 0; min-height: 42px; padding: 8px 0; border: 0; border-radius: 0; outline: none; background: transparent; color: var(--ink); font: inherit; font-size: 15px; line-height: 1.4; }
|
|
7
|
+
.docs-search input::-webkit-search-cancel-button { filter: grayscale(1); }
|
|
8
|
+
.docs-search input::placeholder { color: var(--ink-soft); opacity: 1; }
|
|
9
|
+
.docs-search kbd { flex: none; padding: 0 5px; border: 1px solid var(--rule); border-radius: 3px; color: var(--ink-soft); font: inherit; font-size: 12px; line-height: 20px; }
|
|
10
|
+
.docs-search-panel { margin-top: 10px; }
|
|
11
|
+
.docs-search-status { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.4; }
|
|
12
|
+
.docs-search-status:empty { display: none; }
|
|
13
|
+
.docs-search-results { display: grid; margin: 0; padding: 0; list-style: none; }
|
|
14
|
+
.docs-search-results li { min-width: 0; border-bottom: 1px solid var(--rule); }
|
|
15
|
+
.docs-search-results a { display: block; min-width: 0; padding: 10px 5px; border-radius: 3px; color: var(--ink); text-decoration: none; }
|
|
16
|
+
.docs-search-results a:is(:hover, [aria-selected="true"]) { outline: 1px solid var(--ink); outline-offset: -1px; }
|
|
17
|
+
.docs-search-result-title { display: block; font-size: 14px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
|
|
18
|
+
.docs-search-result-snippet { display: block; overflow: hidden; margin-top: 3px; color: var(--ink-soft); font-size: 13px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
|
|
19
|
+
.docs-search [hidden] { display: none; }
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { SearchSection } from './types';
|
|
2
|
+
|
|
3
|
+
// Run on the renderer's tree after it assigns ids. Search can only link to
|
|
4
|
+
// headings the published page actually has, including duplicate heading ids.
|
|
5
|
+
type Node = { type: string; value?: string; tagName?: string; properties?: Record<string, unknown>; children?: Node[] };
|
|
6
|
+
const textOf = (node: Node): string => node.value ?? (node.children ?? []).map(textOf).join('');
|
|
7
|
+
const collapse = (text: string) => text.replace(/\s+/g, ' ').trim();
|
|
8
|
+
|
|
9
|
+
export function headingSections(nodes: Node[], title: string, titleId: string): SearchSection[] {
|
|
10
|
+
const sections: SearchSection[] = [];
|
|
11
|
+
let parent = '';
|
|
12
|
+
let current: SearchSection = { anchor: titleId, titlePath: [title], text: '' };
|
|
13
|
+
const finish = () => { if (current.text.trim()) sections.push({ ...current, text: current.text.trim() }); };
|
|
14
|
+
for (const node of nodes) {
|
|
15
|
+
if (node.tagName === 'h2' || node.tagName === 'h3') {
|
|
16
|
+
finish();
|
|
17
|
+
const heading = collapse(textOf(node));
|
|
18
|
+
if (node.tagName === 'h2') parent = heading;
|
|
19
|
+
current = { anchor: String(node.properties?.id), titlePath: [title, ...(node.tagName === 'h3' && parent ? [parent] : []), heading], text: '' };
|
|
20
|
+
} else current.text += `${collapse(textOf(node))}\n\n`;
|
|
21
|
+
}
|
|
22
|
+
finish();
|
|
23
|
+
return sections;
|
|
24
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type SearchSection = { anchor: string; titlePath: string[]; text: string };
|
|
2
|
+
export type SearchPage = { href: string; searchSections: SearchSection[] };
|
|
3
|
+
export type SearchChunk = SearchSection & { href: string; hash: string };
|
|
4
|
+
export type SearchIndex = {
|
|
5
|
+
version: 1;
|
|
6
|
+
model: string;
|
|
7
|
+
pooling: 'cls';
|
|
8
|
+
dimensions: number;
|
|
9
|
+
corpusHash: string;
|
|
10
|
+
chunks: (SearchChunk & { vector: number[] })[];
|
|
11
|
+
};
|
|
12
|
+
export type Embeddings = { shape: number[]; data: number[][] };
|
|
13
|
+
export type Embed = (model: string, input: { text: string[]; pooling: 'cls' }) => Promise<Embeddings>;
|
|
14
|
+
export type SearchResult = { href: string; titlePath: string[]; snippet: string; score: number };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { search } from './retrieve';
|
|
2
|
+
import type { Embed, SearchIndex } from './types';
|
|
3
|
+
|
|
4
|
+
type Environment = { ASSETS: { fetch(request: Request): Promise<Response> }; AI: { run: Embed } };
|
|
5
|
+
const json = (data: unknown, status = 200) => Response.json(data, { status, headers: { 'Cache-Control': 'no-store', 'X-Content-Type-Options': 'nosniff' } });
|
|
6
|
+
|
|
7
|
+
/** No app state, credentials or database. Install on the site's Worker only. */
|
|
8
|
+
export function createSearchWorker({ corpusHash, endpoint = '/docs/search', minimumScore = 0.55, indexAsset = '/docs-search-vectors.json', model = '@cf/baai/bge-base-en-v1.5', pooling = 'cls' }: { corpusHash: string; endpoint?: string; minimumScore?: number; indexAsset?: string; model?: string; pooling?: string }) {
|
|
9
|
+
let loaded: SearchIndex | undefined;
|
|
10
|
+
async function load(request: Request, env: Environment): Promise<SearchIndex> {
|
|
11
|
+
if (loaded) return loaded;
|
|
12
|
+
const response = await env.ASSETS.fetch(new Request(new URL(indexAsset, request.url)));
|
|
13
|
+
if (!response.ok) throw Error('Search index unavailable');
|
|
14
|
+
const index = await response.json() as SearchIndex;
|
|
15
|
+
if (index.corpusHash !== corpusHash || index.version !== 1 || index.pooling !== pooling || index.model !== model || !index.dimensions || !Array.isArray(index.chunks)) throw Error('Invalid search index');
|
|
16
|
+
loaded = index;
|
|
17
|
+
return index;
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
async fetch(request: Request, env: Environment): Promise<Response> {
|
|
21
|
+
const url = new URL(request.url);
|
|
22
|
+
if (url.hostname.startsWith('www.')) return Response.redirect(`https://${url.hostname.slice(4)}${url.pathname}${url.search}`, 301);
|
|
23
|
+
if (url.pathname !== endpoint) return env.ASSETS.fetch(request);
|
|
24
|
+
if (request.method !== 'GET') return json({ error: 'Method not allowed' }, 405);
|
|
25
|
+
const query = (url.searchParams.get('q') ?? '').trim();
|
|
26
|
+
if (query.length < 2) return json({ results: [] });
|
|
27
|
+
if (query.length > 240) return json({ error: 'Query too long' }, 400);
|
|
28
|
+
try {
|
|
29
|
+
// The generated entry contains the corpus digest, so docs changes also
|
|
30
|
+
// change Worker code. Binding-only isolate reuse cannot retain old vectors.
|
|
31
|
+
const index = await load(request, env);
|
|
32
|
+
const vectors = await env.AI.run(index.model, { text: [`Represent this sentence for searching relevant passages: ${query}`], pooling: index.pooling });
|
|
33
|
+
return json({ results: search(index, vectors.data[0], minimumScore) });
|
|
34
|
+
} catch {
|
|
35
|
+
return json({ error: 'Search unavailable' }, 503);
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
}
|
package/package.json
CHANGED
|
@@ -33,7 +33,12 @@ text's repository references instead of resolving them; `history_scan.py`
|
|
|
33
33
|
resolves the whole scan's references at once through `github_refs.py`
|
|
34
34
|
(GraphQL batches, a REST lookup for any repository a batch leaves in doubt) and
|
|
35
35
|
then adds their rules. The Node entry point bounds
|
|
36
|
-
the
|
|
36
|
+
the scan after slot acquisition and stops its private process group on
|
|
37
|
+
timeout/cancellation. `slots.py` obtains one per-user `fcntl.flock` slot before
|
|
38
|
+
starting the scanner. The holder watches Node's pipe for abrupt parent death;
|
|
39
|
+
its worker inherits the lock so it cannot outlive its slot. Queueing has its
|
|
40
|
+
own one-hour cap. `timeout.json` supplies the shared default and upper bound
|
|
41
|
+
to Python and the Node/release validator.
|
|
37
42
|
|
|
38
43
|
Git message records carry their kind explicitly. Only commit records enable the
|
|
39
44
|
bounded public coauthor address rule described in the command guide; a file named
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import argparse
|
|
3
3
|
import json
|
|
4
4
|
import re
|
|
5
|
+
from pathlib import Path
|
|
5
6
|
from history_scan import scan
|
|
6
7
|
from public_base import parse as parse_public_base, PublicBaseError
|
|
7
8
|
from report import new_report
|
|
@@ -14,6 +15,9 @@ def flag_name(value):
|
|
|
14
15
|
return match.group() if match else None
|
|
15
16
|
|
|
16
17
|
|
|
18
|
+
TIMEOUT = json.loads(Path(__file__).with_name('timeout.json').read_text())
|
|
19
|
+
|
|
20
|
+
|
|
17
21
|
class SafeParser(argparse.ArgumentParser):
|
|
18
22
|
def parse_args(self, args=None, namespace=None):
|
|
19
23
|
parsed, unknown = self.parse_known_args(args, namespace)
|
|
@@ -44,9 +48,9 @@ def seconds(value):
|
|
|
44
48
|
try:
|
|
45
49
|
result = float(value)
|
|
46
50
|
except ValueError:
|
|
47
|
-
raise argparse.ArgumentTypeError(
|
|
48
|
-
if not 0 < result <=
|
|
49
|
-
raise argparse.ArgumentTypeError(
|
|
51
|
+
raise argparse.ArgumentTypeError(f"invalid timeout; expected a number greater than 0 and at most {TIMEOUT['max']}") from None
|
|
52
|
+
if not 0 < result <= TIMEOUT['max']:
|
|
53
|
+
raise argparse.ArgumentTypeError(f"invalid timeout; expected a number greater than 0 and at most {TIMEOUT['max']}")
|
|
50
54
|
return result
|
|
51
55
|
|
|
52
56
|
|
|
@@ -56,7 +60,7 @@ def main():
|
|
|
56
60
|
parser.add_argument('--ref', default='HEAD')
|
|
57
61
|
for option in ('public-base', 'env-file', 'project', 'repository', 'cache-dir', 'annotation-file'):
|
|
58
62
|
parser.add_argument('--' + option)
|
|
59
|
-
parser.add_argument('--timeout-seconds', type=seconds, default=
|
|
63
|
+
parser.add_argument('--timeout-seconds', type=seconds, default=TIMEOUT['default'])
|
|
60
64
|
args = parser.parse_args()
|
|
61
65
|
if args.public_base is not None:
|
|
62
66
|
try:
|
|
@@ -38,8 +38,11 @@ def prepare(history):
|
|
|
38
38
|
# Explicit object wants cover selected commits fetched outside the
|
|
39
39
|
# remote's configured branch refspecs too. stdin keeps one batch
|
|
40
40
|
# even when a full history exceeds the command argument limit.
|
|
41
|
+
# Refetch encourages automatic repacking. Detached maintenance can
|
|
42
|
+
# outlive inspection and write into a caller's disposable repo
|
|
43
|
+
# during cleanup, so hydration must not start it.
|
|
41
44
|
history.run('fetch', '--quiet', '--refetch', '--no-filter', '--no-tags',
|
|
42
|
-
'--no-recurse-submodules', '--no-write-fetch-head', '--stdin', '--', names[0],
|
|
45
|
+
'--no-auto-maintenance', '--no-recurse-submodules', '--no-write-fetch-head', '--stdin', '--', names[0],
|
|
43
46
|
input=b'\n'.join(before) + b'\n')
|
|
44
47
|
except InspectionError:
|
|
45
48
|
raise missing_blob(history, before[0].decode()) from None
|