Repository navigation
Repair ReplaceRange ownership guidance and historical probe closure #353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
c0903ad
Reconcile canonical ownership with the executable flat-text reference
flyingrobots ab95368
Freeze the matching historical closure for basis comparison probes
flyingrobots eba191c
Refuse historical closure drift before comparison compilation
flyingrobots 85e7b0a
Guard frozen closure reads against leaf symlink swaps
flyingrobots File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
edict/replace-range-probes/basis-identity/application-provenance.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "schema": "jedit.probe-frozen-application/v1", | ||
| "sourceCommit": "9e6466150e43afc83966f9fe67c6ddce2f58d5bc", | ||
| "sourceRoot": "edict/replace-range", | ||
| "files": { | ||
| "edict.application.json": "sha256:3182577627cd1f88bf590f3a8481ef53476c83d783aa142182e7c65eb1f72f8b", | ||
| "vendor/jedit-text/adapter.cbor": "sha256:ab1437164084cbaf453f869c4302df9e648186fe6833bcb81c1e267c8dfeb6f9", | ||
| "vendor/jedit-text/adapter.sha256": "sha256:f8f24ec4077411189f7cdc73052c2149b24036a31535e95d4254fb6393e66421", | ||
| "vendor/jedit-text/echo-operation-configuration.cbor": "sha256:ea787368881f448021f2d71c72cbadbc487e59a09e9638acfc25ec3579a3609d", | ||
| "vendor/jedit-text/echo-operation-configuration.sha256": "sha256:583070043579837cfffb4949867bb672f71f935a45e20e6ecbf7caf7483d600c", | ||
| "vendor/jedit-text/edict.lawpack-output.json": "sha256:141c0000932ba19cff687e4173e40b0a38410f70bd511c9bc51f3fb3f73ee62b", | ||
| "vendor/jedit-text/exports.cbor": "sha256:cab9c575da49cb33289e45fc45afb9d7f05558dada734be7eb3acfbbabb1d4db", | ||
| "vendor/jedit-text/exports.sha256": "sha256:9bb11d9f8153c18af53b484526d9980b05c27eb20aa97e7623d1bf1ed5a69aea", | ||
| "vendor/jedit-text/manifest.cbor": "sha256:0323ed8e9510e473d329166d421dc7d8e1da353065c1cd2dee77e6313ba9bf91", | ||
| "vendor/jedit-text/manifest.sha256": "sha256:316cf602502a45cbab89b77b6344854edee750eaf1f0c8167da48d19ead75c22", | ||
| "vendor/jedit-text/verifier-rules.cbor": "sha256:e6d445fe8b4428307c274dd1a883b848d1aa72d1194730e75928cd1f375b2464", | ||
| "vendor/jedit-text/verifier-rules.sha256": "sha256:4fd69ab96251d649e9c9528bac6188839f0210b128ffc54701b9ee4ef6e7f7b7" | ||
| } | ||
| } |
20 changes: 20 additions & 0 deletions
20
edict/replace-range-probes/basis-identity/application/edict.application.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "schema": "edict.application/v1", | ||
| "coordinate": "jedit.text.replace_range@1", | ||
| "sources": [ | ||
| "src/ReplaceRange.edict" | ||
| ], | ||
| "lawpacks": [ | ||
| { | ||
| "manifest": "vendor/jedit-text/manifest.cbor", | ||
| "exports": "vendor/jedit-text/exports.cbor", | ||
| "adapter": "vendor/jedit-text/adapter.cbor", | ||
| "targetConfiguration": "vendor/jedit-text/echo-operation-configuration.cbor" | ||
| } | ||
| ], | ||
| "target": { | ||
| "profile": "echo.dpo@1", | ||
| "providerPackage": ".build/echo-provider" | ||
| }, | ||
| "outputDirectory": ".build/application" | ||
| } |
Binary file added
BIN
+446 Bytes
edict/replace-range-probes/basis-identity/application/vendor/jedit-text/adapter.cbor
Binary file not shown.
1 change: 1 addition & 0 deletions
1
edict/replace-range-probes/basis-identity/application/vendor/jedit-text/adapter.sha256
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| sha256:b8d9f15ef18dc99691ab1e034ca40a8b8ac52a1bc1b27597284f1edbaf84f049 |
1 change: 1 addition & 0 deletions
1
...nge-probes/basis-identity/application/vendor/jedit-text/echo-operation-configuration.cbor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ¢japiVersionx(echo.operation-lowering-configuration/v1kprogramKindx!compiler-produced-bounded-pure/v1 |
1 change: 1 addition & 0 deletions
1
...e-probes/basis-identity/application/vendor/jedit-text/echo-operation-configuration.sha256
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| sha256:bcb811b2d00d9824a256a26e48c14401c87fff509f2f75deb2ba703003a3f6d4 |
67 changes: 67 additions & 0 deletions
67
...place-range-probes/basis-identity/application/vendor/jedit-text/edict.lawpack-output.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| { | ||
| "schema": "edict.lawpack-output/v1", | ||
| "lawpackId": "jedit.text", | ||
| "lawpackVersion": "1", | ||
| "artifacts": [ | ||
| { | ||
| "path": "manifest.cbor", | ||
| "kind": "manifest", | ||
| "coordinate": "edict.lawpack/v1", | ||
| "digest": "sha256:95758c1605894672cc9069fde01bb8b6e11842b053102660c9cd4f4d6f34d64e" | ||
| }, | ||
| { | ||
| "path": "manifest.sha256", | ||
| "kind": "manifestDigest", | ||
| "coordinate": "edict.lawpack/v1", | ||
| "digest": "sha256:95758c1605894672cc9069fde01bb8b6e11842b053102660c9cd4f4d6f34d64e" | ||
| }, | ||
| { | ||
| "path": "exports.cbor", | ||
| "kind": "exports", | ||
| "coordinate": "jedit.text.exports/v1", | ||
| "digest": "sha256:cbbc79fd92f09f341a1fae221a2a869bb64e15c511af39333e0453cd87fe456a" | ||
| }, | ||
| { | ||
| "path": "exports.sha256", | ||
| "kind": "exportsDigest", | ||
| "coordinate": "jedit.text.exports/v1", | ||
| "digest": "sha256:cbbc79fd92f09f341a1fae221a2a869bb64e15c511af39333e0453cd87fe456a" | ||
| }, | ||
| { | ||
| "path": "echo-operation-configuration.cbor", | ||
| "kind": "localResource", | ||
| "coordinate": "echo.operation-lowering-configuration/v1", | ||
| "digest": "sha256:bcb811b2d00d9824a256a26e48c14401c87fff509f2f75deb2ba703003a3f6d4" | ||
| }, | ||
| { | ||
| "path": "echo-operation-configuration.sha256", | ||
| "kind": "localResourceDigest", | ||
| "coordinate": "echo.operation-lowering-configuration/v1", | ||
| "digest": "sha256:bcb811b2d00d9824a256a26e48c14401c87fff509f2f75deb2ba703003a3f6d4" | ||
| }, | ||
| { | ||
| "path": "verifier-rules.cbor", | ||
| "kind": "localResource", | ||
| "coordinate": "jedit.text.verifier-rules/v1", | ||
| "digest": "sha256:364fb4ff98ae64fcd8d793aae3d7cb133ff8a1ce661330cea47688b13a0a823f" | ||
| }, | ||
| { | ||
| "path": "verifier-rules.sha256", | ||
| "kind": "localResourceDigest", | ||
| "coordinate": "jedit.text.verifier-rules/v1", | ||
| "digest": "sha256:364fb4ff98ae64fcd8d793aae3d7cb133ff8a1ce661330cea47688b13a0a823f" | ||
| }, | ||
| { | ||
| "path": "adapter.cbor", | ||
| "kind": "adapter", | ||
| "coordinate": "jedit.text.echo-adapter/v1", | ||
| "digest": "sha256:b8d9f15ef18dc99691ab1e034ca40a8b8ac52a1bc1b27597284f1edbaf84f049" | ||
| }, | ||
| { | ||
| "path": "adapter.sha256", | ||
| "kind": "adapterDigest", | ||
| "coordinate": "jedit.text.echo-adapter/v1", | ||
| "digest": "sha256:b8d9f15ef18dc99691ab1e034ca40a8b8ac52a1bc1b27597284f1edbaf84f049" | ||
| } | ||
| ] | ||
| } |
Binary file added
BIN
+2.31 KB
edict/replace-range-probes/basis-identity/application/vendor/jedit-text/exports.cbor
Binary file not shown.
1 change: 1 addition & 0 deletions
1
edict/replace-range-probes/basis-identity/application/vendor/jedit-text/exports.sha256
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| sha256:cbbc79fd92f09f341a1fae221a2a869bb64e15c511af39333e0453cd87fe456a |
Binary file added
BIN
+787 Bytes
edict/replace-range-probes/basis-identity/application/vendor/jedit-text/manifest.cbor
Binary file not shown.
1 change: 1 addition & 0 deletions
1
edict/replace-range-probes/basis-identity/application/vendor/jedit-text/manifest.sha256
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| sha256:95758c1605894672cc9069fde01bb8b6e11842b053102660c9cd4f4d6f34d64e |
1 change: 1 addition & 0 deletions
1
edict/replace-range-probes/basis-identity/application/vendor/jedit-text/verifier-rules.cbor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ¤fschemasjedit.text.schema@1lschemaDigestxGsha256:f49b0ff6c9c7010d3a72b46734d47832853f496739a083edc41dddec3431bac7oruntimeOntologyugeneric-bounded-graphworacleIsExecutableInputô |
1 change: 1 addition & 0 deletions
1
...t/replace-range-probes/basis-identity/application/vendor/jedit-text/verifier-rules.sha256
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| sha256:364fb4ff98ae64fcd8d793aae3d7cb133ff8a1ce661330cea47688b13a0a823f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
edict/replace-range-probes/basis-identity/verify-closure.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| // © James Ross Ω FLYING•ROBOTS <https://github.com/flyingrobots> | ||
| import { createHash } from 'node:crypto'; | ||
| import { closeSync, constants, fstatSync, lstatSync, openSync, readFileSync, readdirSync, writeFileSync } from 'node:fs'; | ||
| import { join, relative, resolve } from 'node:path'; | ||
|
|
||
| const hash = bytes => createHash('sha256').update(bytes).digest('hex'); | ||
|
|
||
| // The build owns an immutable COPY snapshot. Leaf descriptors also refuse links | ||
| // swapped after traversal; this is not a sandbox for hostile mutable ancestors. | ||
| function readRegular(path) { | ||
| if (typeof constants.O_NOFOLLOW !== 'number') throw new Error('O_NOFOLLOW is required'); | ||
| const fd = openSync(path, constants.O_RDONLY | constants.O_NOFOLLOW); | ||
| try { | ||
| if (!fstatSync(fd).isFile()) throw new Error('nonregular historical input'); | ||
| return readFileSync(fd); | ||
| } finally { | ||
| closeSync(fd); | ||
| } | ||
| } | ||
|
|
||
| try { | ||
| const [application, provenance, output] = process.argv.slice(2); | ||
| if (!application || !provenance || !output) throw new Error('expected application, provenance and checksum output'); | ||
| const root = resolve(application); | ||
| const receiptBytes = readRegular(provenance); | ||
| const receipt = JSON.parse(receiptBytes); | ||
| if (receipt.schema !== 'jedit.probe-frozen-application/v1' || | ||
| !/^[a-f0-9]{40}$/.test(receipt.sourceCommit) || | ||
| receipt.files === null || typeof receipt.files !== 'object' || Array.isArray(receipt.files)) { | ||
| throw new Error('invalid provenance envelope'); | ||
| } | ||
| const recorded = Object.entries(receipt.files); | ||
| if (recorded.length === 0) throw new Error('empty historical closure'); | ||
| const actual = []; | ||
| function walk(directory, prefix = '') { | ||
| if (!lstatSync(directory).isDirectory()) throw new Error('nonregular historical directory'); | ||
| for (const name of readdirSync(directory).sort()) { | ||
| const path = join(directory, name); | ||
| const entry = lstatSync(path); | ||
| const key = prefix + name; | ||
| if (entry.isDirectory()) walk(path, `${key}/`); | ||
| else if (entry.isFile()) actual.push(key); | ||
| else throw new Error(`nonregular historical input: ${key}`); | ||
| } | ||
| } | ||
| walk(root); | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
| const checksums = []; | ||
| for (const [path, expected] of recorded) { | ||
| if (path.startsWith('/') || /[\\\r\n\t\0]/.test(path) || | ||
| path.split('/').some(part => part === '' || part === '.' || part === '..') || | ||
| typeof expected !== 'string' || !/^sha256:[a-f0-9]{64}$/.test(expected)) { | ||
| throw new Error('invalid recorded path or digest'); | ||
| } | ||
| const bytes = readRegular(join(root, path)); | ||
| if (`sha256:${hash(bytes)}` !== expected) throw new Error(`historical hash mismatch: ${path}`); | ||
| checksums.push(`${expected.slice(7)} ${path}`); | ||
| } | ||
| const listed = new Set(recorded.map(([path]) => path)); | ||
| if (actual.length !== listed.size || actual.some(path => !listed.has(path))) { | ||
| throw new Error('unrecorded historical input'); | ||
| } | ||
| // Bind the JSON envelope too, so runtime verification detects receipt drift. | ||
| const receiptPath = relative(root, resolve(provenance)); | ||
| if (/[\\\r\n\t\0]/.test(receiptPath)) throw new Error('invalid provenance path'); | ||
| checksums.push(`${hash(receiptBytes)} ${receiptPath}`); | ||
| writeFileSync(output, `${checksums.join('\n')}\n`); | ||
| process.stdout.write(`${JSON.stringify({ kind: 'FrozenClosureVerified', files: recorded.length })}\n`); | ||
| } catch (error) { | ||
| process.stderr.write(`${JSON.stringify({ kind: 'InvalidFrozenClosure', detail: error instanceof Error ? error.message : 'invalid closure' })}\n`); | ||
| process.exitCode = 1; | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.