@henols/c64-re-tools 2.5.0-rc.1 → 2.5.0
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/package.json +1 -1
- package/skills/c64-assembler/SKILL.md +2 -1
- package/skills/c64-basic/SKILL.md +2 -1
- package/skills/c64-development/SKILL.md +1 -1
- package/skills/c64-disk/SKILL.md +2 -1
- package/skills/c64-docs/SKILL.md +2 -1
- package/skills/c64-knowledge/SKILL.md +2 -1
- package/skills/c64-memory-map/SKILL.md +2 -1
- package/skills/c64-packer/SKILL.md +2 -1
- package/skills/c64-provenance/SKILL.md +2 -1
- package/skills/c64-reverse-engineering/SKILL.md +2 -2
- package/skills/c64-source/SKILL.md +5 -3
- package/skills/c64-source/scripts/source.ts +30 -16
- package/skills/c64-static-analysis/SKILL.md +2 -1
- package/skills/c64-testing/SKILL.md +2 -1
- package/skills/c64-unpacker/SKILL.md +2 -1
- package/src/cli/main.ts +4 -2
- package/src/cli/status.ts +0 -1
package/package.json
CHANGED
|
@@ -67,7 +67,8 @@ A source that you generated from the project knowledge has switches in `config.a
|
|
|
67
67
|
- Write each file that you make for your work in `.c64-re-tools/local/` of the project. Git ignores that folder. Examples are results, batches, step files, runs, snapshots and memory dumps.
|
|
68
68
|
- The script refuses an `--out` path in `.c64-re-tools/knowledge/` and the index of the knowledge. Change the project knowledge only with the commands that change it.
|
|
69
69
|
- The script refuses a folder where the command writes a file. It refuses a file where the command writes a folder.
|
|
70
|
-
- When a file is the evidence for a finding in the project knowledge, move it out of `.c64-re-tools/local/` first. The project knowledge refuses evidence in that folder.
|
|
70
|
+
- When a test or another file is the evidence for a finding in the project knowledge, move it out of `.c64-re-tools/local/` first. The project knowledge refuses that evidence in that folder.
|
|
71
|
+
- A coverage map can stay in `.c64-re-tools/local/`. The project knowledge keeps its ranges and its SHA-256.
|
|
71
72
|
- Do not move a coverage map after you put it into the project knowledge. The knowledge refers to the map by its path at that time.
|
|
72
73
|
- Put a run that is evidence in `runs/<name>/`, with its run file, its results and its snapshot files. Change the paths in the run file to the new paths. Then git keeps them, and another person can do the run again.
|
|
73
74
|
- A shell redirect (`>`) is relative to the working directory, not to the project folder. From the folder above the project, write `<folder>/.c64-re-tools/local/result.json`.
|
|
@@ -43,7 +43,8 @@ To get the command list, run the script with no arguments.
|
|
|
43
43
|
- Write each file that you make for your work in `.c64-re-tools/local/` of the project. Git ignores that folder. Examples are results, batches, step files, runs, snapshots and memory dumps.
|
|
44
44
|
- The script refuses an `--out` path in `.c64-re-tools/knowledge/` and the index of the knowledge. Change the project knowledge only with the commands that change it.
|
|
45
45
|
- The script refuses a folder where the command writes a file. It refuses a file where the command writes a folder.
|
|
46
|
-
- When a file is the evidence for a finding in the project knowledge, move it out of `.c64-re-tools/local/` first. The project knowledge refuses evidence in that folder.
|
|
46
|
+
- When a test or another file is the evidence for a finding in the project knowledge, move it out of `.c64-re-tools/local/` first. The project knowledge refuses that evidence in that folder.
|
|
47
|
+
- A coverage map can stay in `.c64-re-tools/local/`. The project knowledge keeps its ranges and its SHA-256.
|
|
47
48
|
- Do not move a coverage map after you put it into the project knowledge. The knowledge refers to the map by its path at that time.
|
|
48
49
|
- Put a run that is evidence in `runs/<name>/`, with its run file, its results and its snapshot files. Change the paths in the run file to the new paths. Then git keeps them, and another person can do the run again.
|
|
49
50
|
- A shell redirect (`>`) is relative to the working directory, not to the project folder. From the folder above the project, write `<folder>/.c64-re-tools/local/result.json`.
|
|
@@ -48,7 +48,7 @@ Use this layout. No script makes it.
|
|
|
48
48
|
|
|
49
49
|
```
|
|
50
50
|
src/ the source, with src/main.a as the entry
|
|
51
|
-
build/ the built programs and their symbol files
|
|
51
|
+
build/ the built programs and their symbol files. Do not commit them: each build writes them again.
|
|
52
52
|
tests/ run files with expect steps
|
|
53
53
|
docs/ the documentation, when the user asks for it
|
|
54
54
|
```
|
package/skills/c64-disk/SKILL.md
CHANGED
|
@@ -69,7 +69,8 @@ To get the command list, run the script with no arguments.
|
|
|
69
69
|
- Write each file that you make for your work in `.c64-re-tools/local/` of the project. Git ignores that folder. Examples are results, batches, step files, runs, snapshots and memory dumps.
|
|
70
70
|
- The script refuses an `--out` path in `.c64-re-tools/knowledge/` and the index of the knowledge. Change the project knowledge only with the commands that change it.
|
|
71
71
|
- The script refuses a folder where the command writes a file. It refuses a file where the command writes a folder.
|
|
72
|
-
- When a file is the evidence for a finding in the project knowledge, move it out of `.c64-re-tools/local/` first. The project knowledge refuses evidence in that folder.
|
|
72
|
+
- When a test or another file is the evidence for a finding in the project knowledge, move it out of `.c64-re-tools/local/` first. The project knowledge refuses that evidence in that folder.
|
|
73
|
+
- A coverage map can stay in `.c64-re-tools/local/`. The project knowledge keeps its ranges and its SHA-256.
|
|
73
74
|
- Do not move a coverage map after you put it into the project knowledge. The knowledge refers to the map by its path at that time.
|
|
74
75
|
- Put a run that is evidence in `runs/<name>/`, with its run file, its results and its snapshot files. Change the paths in the run file to the new paths. Then git keeps them, and another person can do the run again.
|
|
75
76
|
- A shell redirect (`>`) is relative to the working directory, not to the project folder. From the folder above the project, write `<folder>/.c64-re-tools/local/result.json`.
|
package/skills/c64-docs/SKILL.md
CHANGED
|
@@ -58,7 +58,8 @@ Get the values for the commands from these places:
|
|
|
58
58
|
- Write each file that you make for your work in `.c64-re-tools/local/` of the project. Git ignores that folder. Examples are results, batches, step files, runs, snapshots and memory dumps.
|
|
59
59
|
- The script refuses an `--out` path in `.c64-re-tools/knowledge/` and the index of the knowledge. Change the project knowledge only with the commands that change it.
|
|
60
60
|
- The script refuses a folder where the command writes a file. It refuses a file where the command writes a folder.
|
|
61
|
-
- When a file is the evidence for a finding in the project knowledge, move it out of `.c64-re-tools/local/` first. The project knowledge refuses evidence in that folder.
|
|
61
|
+
- When a test or another file is the evidence for a finding in the project knowledge, move it out of `.c64-re-tools/local/` first. The project knowledge refuses that evidence in that folder.
|
|
62
|
+
- A coverage map can stay in `.c64-re-tools/local/`. The project knowledge keeps its ranges and its SHA-256.
|
|
62
63
|
- Do not move a coverage map after you put it into the project knowledge. The knowledge refers to the map by its path at that time.
|
|
63
64
|
- Put a run that is evidence in `runs/<name>/`, with its run file, its results and its snapshot files. Change the paths in the run file to the new paths. Then git keeps them, and another person can do the run again.
|
|
64
65
|
- A shell redirect (`>`) is relative to the working directory, not to the project folder. From the folder above the project, write `<folder>/.c64-re-tools/local/result.json`.
|
|
@@ -87,7 +87,8 @@ The knowledge is text in `.c64-re-tools/knowledge/` of the project. Commit that
|
|
|
87
87
|
- Write each file that you make for your work in `.c64-re-tools/local/` of the project. Git ignores that folder. Examples are results, batches, step files, runs, snapshots and memory dumps.
|
|
88
88
|
- The script refuses an `--out` path in `.c64-re-tools/knowledge/` and the index of the knowledge. Change the project knowledge only with the commands that change it.
|
|
89
89
|
- The script refuses a folder where the command writes a file. It refuses a file where the command writes a folder.
|
|
90
|
-
- When a file is the evidence for a finding in the project knowledge, move it out of `.c64-re-tools/local/` first. The project knowledge refuses evidence in that folder.
|
|
90
|
+
- When a test or another file is the evidence for a finding in the project knowledge, move it out of `.c64-re-tools/local/` first. The project knowledge refuses that evidence in that folder.
|
|
91
|
+
- A coverage map can stay in `.c64-re-tools/local/`. The project knowledge keeps its ranges and its SHA-256.
|
|
91
92
|
- Do not move a coverage map after you put it into the project knowledge. The knowledge refers to the map by its path at that time.
|
|
92
93
|
- Put a run that is evidence in `runs/<name>/`, with its run file, its results and its snapshot files. Change the paths in the run file to the new paths. Then git keeps them, and another person can do the run again.
|
|
93
94
|
- A shell redirect (`>`) is relative to the working directory, not to the project folder. From the folder above the project, write `<folder>/.c64-re-tools/local/result.json`.
|
|
@@ -50,7 +50,8 @@ To get the command list, run the script with no arguments.
|
|
|
50
50
|
- Write each file that you make for your work in `.c64-re-tools/local/` of the project. Git ignores that folder. Examples are results, batches, step files, runs, snapshots and memory dumps.
|
|
51
51
|
- The script refuses an `--out` path in `.c64-re-tools/knowledge/` and the index of the knowledge. Change the project knowledge only with the commands that change it.
|
|
52
52
|
- The script refuses a folder where the command writes a file. It refuses a file where the command writes a folder.
|
|
53
|
-
- When a file is the evidence for a finding in the project knowledge, move it out of `.c64-re-tools/local/` first. The project knowledge refuses evidence in that folder.
|
|
53
|
+
- When a test or another file is the evidence for a finding in the project knowledge, move it out of `.c64-re-tools/local/` first. The project knowledge refuses that evidence in that folder.
|
|
54
|
+
- A coverage map can stay in `.c64-re-tools/local/`. The project knowledge keeps its ranges and its SHA-256.
|
|
54
55
|
- Do not move a coverage map after you put it into the project knowledge. The knowledge refers to the map by its path at that time.
|
|
55
56
|
- Put a run that is evidence in `runs/<name>/`, with its run file, its results and its snapshot files. Change the paths in the run file to the new paths. Then git keeps them, and another person can do the run again.
|
|
56
57
|
- A shell redirect (`>`) is relative to the working directory, not to the project folder. From the folder above the project, write `<folder>/.c64-re-tools/local/result.json`.
|
|
@@ -49,7 +49,8 @@ To get the command list, run the script with no arguments.
|
|
|
49
49
|
- Write each file that you make for your work in `.c64-re-tools/local/` of the project. Git ignores that folder. Examples are results, batches, step files, runs, snapshots and memory dumps.
|
|
50
50
|
- The script refuses an `--out` path in `.c64-re-tools/knowledge/` and the index of the knowledge. Change the project knowledge only with the commands that change it.
|
|
51
51
|
- The script refuses a folder where the command writes a file. It refuses a file where the command writes a folder.
|
|
52
|
-
- When a file is the evidence for a finding in the project knowledge, move it out of `.c64-re-tools/local/` first. The project knowledge refuses evidence in that folder.
|
|
52
|
+
- When a test or another file is the evidence for a finding in the project knowledge, move it out of `.c64-re-tools/local/` first. The project knowledge refuses that evidence in that folder.
|
|
53
|
+
- A coverage map can stay in `.c64-re-tools/local/`. The project knowledge keeps its ranges and its SHA-256.
|
|
53
54
|
- Do not move a coverage map after you put it into the project knowledge. The knowledge refers to the map by its path at that time.
|
|
54
55
|
- Put a run that is evidence in `runs/<name>/`, with its run file, its results and its snapshot files. Change the paths in the run file to the new paths. Then git keeps them, and another person can do the run again.
|
|
55
56
|
- A shell redirect (`>`) is relative to the working directory, not to the project folder. From the folder above the project, write `<folder>/.c64-re-tools/local/result.json`.
|
|
@@ -66,7 +66,8 @@ To get the command list, run the script with no arguments.
|
|
|
66
66
|
- Write each file that you make for your work in `.c64-re-tools/local/` of the project. Git ignores that folder. Examples are results, batches, step files, runs, snapshots and memory dumps.
|
|
67
67
|
- The script refuses an `--out` path in `.c64-re-tools/knowledge/` and the index of the knowledge. Change the project knowledge only with the commands that change it.
|
|
68
68
|
- The script refuses a folder where the command writes a file. It refuses a file where the command writes a folder.
|
|
69
|
-
- When a file is the evidence for a finding in the project knowledge, move it out of `.c64-re-tools/local/` first. The project knowledge refuses evidence in that folder.
|
|
69
|
+
- When a test or another file is the evidence for a finding in the project knowledge, move it out of `.c64-re-tools/local/` first. The project knowledge refuses that evidence in that folder.
|
|
70
|
+
- A coverage map can stay in `.c64-re-tools/local/`. The project knowledge keeps its ranges and its SHA-256.
|
|
70
71
|
- Do not move a coverage map after you put it into the project knowledge. The knowledge refers to the map by its path at that time.
|
|
71
72
|
- Put a run that is evidence in `runs/<name>/`, with its run file, its results and its snapshot files. Change the paths in the run file to the new paths. Then git keeps them, and another person can do the run again.
|
|
72
73
|
- A shell redirect (`>`) is relative to the working directory, not to the project folder. From the folder above the project, write `<folder>/.c64-re-tools/local/result.json`.
|
|
@@ -131,7 +131,7 @@ If the project has no layout, use this one. No script checks it. Each script tak
|
|
|
131
131
|
```
|
|
132
132
|
original/ the disk image or the program as you got it
|
|
133
133
|
src/ the generated source
|
|
134
|
-
build/ the built programs
|
|
134
|
+
build/ the built programs. Do not commit them: each build writes them again.
|
|
135
135
|
tests/ the test scenarios, and the recordings in tests/recordings/
|
|
136
136
|
runs/ the runs that the knowledge gives as evidence
|
|
137
137
|
docs/ the documentation, with the reference in docs/reference/
|
|
@@ -139,7 +139,7 @@ tools/ scripts for the formats of this program only
|
|
|
139
139
|
README.md the entry page of the documentation
|
|
140
140
|
```
|
|
141
141
|
|
|
142
|
-
Commit each folder of the layout and `.c64-re-tools/knowledge/`. The knowledge holds the program, the entry state and the coverage, so the project needs no other folder for them. Put all other files that you make in `.c64-re-tools/local/`, also the captures and the coverage maps after you put them into the knowledge. Do not let git ignore a folder of the layout
|
|
142
|
+
Commit each folder of the layout other than `build/`, and `.c64-re-tools/knowledge/`. The knowledge holds the program, the entry state and the coverage, so the project needs no other folder for them. Put all other files that you make in `.c64-re-tools/local/`, also the captures and the coverage maps after you put them into the knowledge. Do not let git ignore a folder of the layout other than `build/`. Do not change the `.gitignore` files of the project.
|
|
143
143
|
|
|
144
144
|
If the project has a layout, use that layout.
|
|
145
145
|
|
|
@@ -58,7 +58,8 @@ To get the command list, run the script with no arguments.
|
|
|
58
58
|
- Write each file that you make for your work in `.c64-re-tools/local/` of the project. Git ignores that folder. Examples are results, batches, step files, runs, snapshots and memory dumps.
|
|
59
59
|
- The script refuses an `--out` path in `.c64-re-tools/knowledge/` and the index of the knowledge. Change the project knowledge only with the commands that change it.
|
|
60
60
|
- The script refuses a folder where the command writes a file. It refuses a file where the command writes a folder.
|
|
61
|
-
- When a file is the evidence for a finding in the project knowledge, move it out of `.c64-re-tools/local/` first. The project knowledge refuses evidence in that folder.
|
|
61
|
+
- When a test or another file is the evidence for a finding in the project knowledge, move it out of `.c64-re-tools/local/` first. The project knowledge refuses that evidence in that folder.
|
|
62
|
+
- A coverage map can stay in `.c64-re-tools/local/`. The project knowledge keeps its ranges and its SHA-256.
|
|
62
63
|
- Do not move a coverage map after you put it into the project knowledge. The knowledge refers to the map by its path at that time.
|
|
63
64
|
- Put a run that is evidence in `runs/<name>/`, with its run file, its results and its snapshot files. Change the paths in the run file to the new paths. Then git keeps them, and another person can do the run again.
|
|
64
65
|
- A shell redirect (`>`) is relative to the working directory, not to the project folder. From the folder above the project, write `<folder>/.c64-re-tools/local/result.json`.
|
|
@@ -74,7 +75,7 @@ Each flag applies only to the commands in the table. On another command, the scr
|
|
|
74
75
|
| `--out <dir>` | `generate` | The folder for the source files. It is necessary. The script writes over the files of an earlier run. It removes a generated `.asm` file that this run does not write. A run without `--loader` keeps `loader.asm`, `loader.prg` and `start_screen.asm` of an earlier run. `staleLoader` tells when they are of another knowledge revision. |
|
|
75
76
|
| `--entry <address>` | `generate` | An address where code starts. Give the flag again for more addresses. There is no default. |
|
|
76
77
|
| `--space <space>` | `generate` | The knowledge space: `c64`, `drive8`, or `bank0` to `bank255`. The default is `c64`. The coverage, `--loader` and the platform names apply only to `c64`. |
|
|
77
|
-
| `--loader` | `generate` | Also write `loader.asm` and `loader.prg`, and `start_screen.asm` when the knowledge has a start screen. It needs a capture in the knowledge. The default is no loader. |
|
|
78
|
+
| `--loader` | `generate` | Also write `loader.asm` and `loader.prg`, and `start_screen.asm` when the knowledge has a start screen. The script writes `loader.prg` only after the check of the new loader ran. Else the `loader.prg` of an earlier run stays. It needs a capture in the knowledge. The default is no loader. |
|
|
78
79
|
| `--analyzer-names` | `generate` | Name an address without a name of the user or the LLM, and without a platform name, with its analyzer name, for example `FUN_17e2`. Without the flag, the source makes its own name, for example `l_17e2`. |
|
|
79
80
|
| `--to <folder>` | `export` | The folder of the new project. It is necessary. The script also writes `<folder>.zip` beside the folder. |
|
|
80
81
|
| `--name <name>` | `export` | The name of `baseline/<name>.prg` and `build/<name>.prg`. The default is the name of the folder. |
|
|
@@ -259,7 +260,8 @@ The start screen:
|
|
|
259
260
|
- `limits`: each CIA value that the loader cannot set as it was at the entry. An old capture has no CIA values. Then capture the program again at its entry point.
|
|
260
261
|
- `startScreen`: with a start screen, `shown: true` when the VIC-II had the values of the start screen, and `waits: true` when the start screen waited without a key. `wait` and `continue` are the addresses of the wait and of the code after it. The check sets the PC to `continue`, and then runs the loader to its jump.
|
|
261
262
|
- `packed`: `packedBytes` and `unpackedBytes` of the packed form.
|
|
262
|
-
- When the check of `loader.prg` cannot run, the script
|
|
263
|
+
- When the check of `loader.prg` cannot run, the script does not write `loader.prg`. The `loader.prg` of an earlier run stays as it was. `loader.asm` is new. `reason` tells why the check did not run.
|
|
264
|
+
- `kept`: when the result has no new `loader.prg`, the path of the `loader.prg` of an earlier run. That file is not of this source.
|
|
263
265
|
|
|
264
266
|
Do these actions when `verified` is `false`:
|
|
265
267
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// FAIL.
|
|
11
11
|
|
|
12
12
|
import { createHash } from "node:crypto";
|
|
13
|
-
import { existsSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
13
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
14
14
|
import { basename, join, relative, sep } from "node:path";
|
|
15
15
|
|
|
16
16
|
import { isRefusal, Refusal } from "#src/errors.ts";
|
|
@@ -663,6 +663,9 @@ function sourceMapText(rendered: Rendered, space: string, revision: string | nul
|
|
|
663
663
|
return `${head},\n"labels": [\n${labels.join(",\n")}\n],\n"items": [\n${items.join(",\n")}\n]}\n`;
|
|
664
664
|
}
|
|
665
665
|
|
|
666
|
+
/** The folder in .c64-re-tools/local/ where the check of the loader runs the new loader.prg. */
|
|
667
|
+
const LOADER_CHECK_DIRECTORY = "loader-check";
|
|
668
|
+
|
|
666
669
|
/** The files of the loader. Only a run with --loader writes them, so only such a run removes them. */
|
|
667
670
|
const LOADER_FILES: ReadonlySet<string> = new Set(["loader.asm", "loader.prg", START_SCREEN_FILE]);
|
|
668
671
|
|
|
@@ -690,8 +693,9 @@ function staleLoader(out: string, revision: string): { files: string[]; revision
|
|
|
690
693
|
/**
|
|
691
694
|
* Removes the generated .asm files of an earlier run that this run does not
|
|
692
695
|
* write, and an earlier not_executed.json and source-map.json. An earlier
|
|
693
|
-
* loader.asm
|
|
694
|
-
*
|
|
696
|
+
* loader.asm stays unless this run has --loader: a source of the user can
|
|
697
|
+
* include loader.asm. An earlier loader.prg always stays: only a new loader.prg
|
|
698
|
+
* whose check ran replaces it. Other files stay. Gives the names it removed.
|
|
695
699
|
*/
|
|
696
700
|
function removeOldFiles(out: string, keep: ReadonlySet<string>, loaderRun: boolean): string[] {
|
|
697
701
|
const directory = resolveProjectPath(out);
|
|
@@ -702,7 +706,7 @@ function removeOldFiles(out: string, keep: ReadonlySet<string>, loaderRun: boole
|
|
|
702
706
|
const name = entry.name;
|
|
703
707
|
const path = join(directory, name);
|
|
704
708
|
if (LOADER_FILES.has(name) && !loaderRun) continue;
|
|
705
|
-
const old = name ===
|
|
709
|
+
const old = name === NOT_EXECUTED_FILE || name === SOURCE_MAP_FILE || (name.endsWith(".asm") && !keep.has(name) && readFileSync(path, "utf8").startsWith(GENERATED_MARK));
|
|
706
710
|
if (!old) continue;
|
|
707
711
|
rmSync(path, { force: true });
|
|
708
712
|
removed.push(name);
|
|
@@ -966,8 +970,12 @@ async function generate(call: Call): Promise<{ output: Record<string, unknown>;
|
|
|
966
970
|
patchesNotWritten: listed(laid.patchesNotWritten, max, (item) => ({ start: formatC64Address(item.start), end: formatC64Address(item.end), switch: item.switch, reason: item.reason })),
|
|
967
971
|
}),
|
|
968
972
|
};
|
|
973
|
+
// A loader.prg of an earlier run stays when this run checks no new one: it can be a committed file.
|
|
974
|
+
const loaderPath = `${out}/loader.prg`;
|
|
975
|
+
const keptLoader = () => (existsSync(resolveProjectPath(loaderPath)) ? { kept: loaderPath } : {});
|
|
976
|
+
const notVerified = (fields: Record<string, unknown>) => ({ verified: false, ...fields, ...keptLoader() });
|
|
969
977
|
// The loader includes the source, so it is built only from a source that is identical to the image.
|
|
970
|
-
const notBuilt = (reason: string) => (state === undefined ? {} : { loader: {
|
|
978
|
+
const notBuilt = (reason: string) => (state === undefined ? {} : { loader: notVerified({ reason: loaderRefused ?? reason }) });
|
|
971
979
|
if (built.program === undefined) {
|
|
972
980
|
return { output: { ...output, check: { identical: false, diagnostics: built.diagnostics.slice(0, MAX_DIAGNOSTICS) }, ...notBuilt("The source does not assemble, and the loader includes it.") }, removed, failed: true };
|
|
973
981
|
}
|
|
@@ -998,40 +1006,46 @@ async function generate(call: Call): Promise<{ output: Record<string, unknown>;
|
|
|
998
1006
|
if (releases.length > 0) output.releases = releases;
|
|
999
1007
|
const releasesFailed = releases.some((item) => item.result !== "identical" && (item.base || item.result !== "layout differs"));
|
|
1000
1008
|
const sourceFailed = laid.patchesNotWritten.length > 0 || switches.some((item) => item.result !== "fits") || defaultFailed || releasesFailed;
|
|
1001
|
-
if (loaderRefused !== undefined) return { output: { ...output, loader: {
|
|
1009
|
+
if (loaderRefused !== undefined) return { output: { ...output, loader: notVerified({ reason: loaderRefused }) }, removed, failed: true };
|
|
1002
1010
|
if (loader === undefined || state === undefined) return { output, removed, failed: missingEntry !== undefined || sourceFailed };
|
|
1003
1011
|
|
|
1004
1012
|
// The entry state is the state of the base release: the loader is built and checked with it.
|
|
1005
1013
|
const loaderBuilt = await buildLoader(files, laid, loader, image, state, baseValues);
|
|
1006
|
-
if ("diagnostics" in loaderBuilt) return { output: { ...output, loader: {
|
|
1014
|
+
if ("diagnostics" in loaderBuilt) return { output: { ...output, loader: notVerified({ reason: "loader.asm does not assemble.", diagnostics: loaderBuilt.diagnostics }) }, removed, failed: true };
|
|
1007
1015
|
const { jump, copierSource, expected, startScreen } = loaderBuilt;
|
|
1008
1016
|
const copierBuild = loaderBuilt.program;
|
|
1009
1017
|
const fileByte = (address: number) => copierBuild[2 + address - (loader.packed?.start ?? 0x0801)]!;
|
|
1010
|
-
// The packed form: Exomizer packs the build of main.asm with the copier. Without Exomizer, or when its check fails, there is no loader.prg.
|
|
1018
|
+
// The packed form: Exomizer packs the build of main.asm with the copier. Without Exomizer, or when its check fails, there is no new loader.prg.
|
|
1011
1019
|
let packed: PackedLoader | undefined;
|
|
1012
1020
|
if (loader.packed !== undefined) {
|
|
1013
1021
|
try {
|
|
1014
1022
|
packed = await packLoader(built.program, copierBuild, loader, localToolContext());
|
|
1015
1023
|
} catch (error) {
|
|
1016
1024
|
if (!isRefusal(error)) throw error;
|
|
1017
|
-
return { output: { ...output, loader: {
|
|
1025
|
+
return { output: { ...output, loader: notVerified({ reason: `loader.asm has the packed form, and the pack with Exomizer failed. ${error.message}` }) }, removed, failed: true };
|
|
1018
1026
|
}
|
|
1019
1027
|
}
|
|
1020
1028
|
const program = packed?.program ?? copierBuild;
|
|
1021
|
-
|
|
1022
|
-
|
|
1029
|
+
// The check runs the new loader from a scratch file. Only a loader whose check ran goes to --out, so a check
|
|
1030
|
+
// that cannot run (no host, or a host of another release) keeps the loader.prg of an earlier run.
|
|
1031
|
+
ensureLocal(projectRoot());
|
|
1032
|
+
const scratch = `${PROJECT_DIRECTORY}/${LOCAL_DIRECTORY}/${LOADER_CHECK_DIRECTORY}`;
|
|
1033
|
+
mkdirSync(resolveProjectPath(scratch), { recursive: true });
|
|
1034
|
+
const checkPath = `${scratch}/loader.prg`;
|
|
1035
|
+
writeFileSync(resolveProjectPath(checkPath), program);
|
|
1023
1036
|
// The unpack runs before the copier.
|
|
1024
1037
|
const copierFrames = packed === undefined ? RUN_LIMIT_FRAMES : packed.cycles === undefined ? LOADER_FRAMES : RUN_LIMIT_FRAMES + Math.ceil(packed.cycles / PAL_FRAME_CYCLES);
|
|
1025
1038
|
let ran: LoaderRun;
|
|
1026
1039
|
try {
|
|
1027
|
-
ran = await runLoader(
|
|
1040
|
+
ran = await runLoader(checkPath, program, loader, image, state, { jump, copierSource, fileByte, copierFrames, ...(startScreen === undefined ? {} : { startScreen }) }, expected);
|
|
1028
1041
|
} catch (error) {
|
|
1029
|
-
// A loader.prg without its check does not stay: it looks like a checked loader.
|
|
1030
|
-
rmSync(resolveProjectPath(loaderPath), { force: true });
|
|
1031
|
-
written.splice(written.findIndex((file) => file.out === loaderPath), 1);
|
|
1032
1042
|
if (!isRefusal(error)) throw error;
|
|
1033
|
-
|
|
1043
|
+
const what = existsSync(resolveProjectPath(loaderPath)) ? "kept the loader.prg of an earlier run" : "wrote no loader.prg";
|
|
1044
|
+
return { output: { ...output, loader: notVerified({ reason: `The check of loader.prg did not run, so the script ${what}. ${error.message}` }) }, removed, failed: true };
|
|
1045
|
+
} finally {
|
|
1046
|
+
rmSync(resolveProjectPath(scratch), { recursive: true, force: true });
|
|
1034
1047
|
}
|
|
1048
|
+
written.push(writeReported(loaderPath, program, { what: "--out" }));
|
|
1035
1049
|
output.loader = {
|
|
1036
1050
|
program: loaderPath,
|
|
1037
1051
|
...(packed === undefined ? {} : { packed: { packedBytes: packed.packedBytes, unpackedBytes: packed.unpackedBytes } }),
|
|
@@ -65,7 +65,8 @@ To get the command list, run the script with no arguments.
|
|
|
65
65
|
- Write each file that you make for your work in `.c64-re-tools/local/` of the project. Git ignores that folder. Examples are results, batches, step files, runs, snapshots and memory dumps.
|
|
66
66
|
- The script refuses an `--out` path in `.c64-re-tools/knowledge/` and the index of the knowledge. Change the project knowledge only with the commands that change it.
|
|
67
67
|
- The script refuses a folder where the command writes a file. It refuses a file where the command writes a folder.
|
|
68
|
-
- When a file is the evidence for a finding in the project knowledge, move it out of `.c64-re-tools/local/` first. The project knowledge refuses evidence in that folder.
|
|
68
|
+
- When a test or another file is the evidence for a finding in the project knowledge, move it out of `.c64-re-tools/local/` first. The project knowledge refuses that evidence in that folder.
|
|
69
|
+
- A coverage map can stay in `.c64-re-tools/local/`. The project knowledge keeps its ranges and its SHA-256.
|
|
69
70
|
- Do not move a coverage map after you put it into the project knowledge. The knowledge refers to the map by its path at that time.
|
|
70
71
|
- Put a run that is evidence in `runs/<name>/`, with its run file, its results and its snapshot files. Change the paths in the run file to the new paths. Then git keeps them, and another person can do the run again.
|
|
71
72
|
- A shell redirect (`>`) is relative to the working directory, not to the project folder. From the folder above the project, write `<folder>/.c64-re-tools/local/result.json`.
|
|
@@ -60,7 +60,8 @@ To get the command list, run the script with no arguments.
|
|
|
60
60
|
- Write each file that you make for your work in `.c64-re-tools/local/` of the project. Git ignores that folder. Examples are results, batches, step files, runs, snapshots and memory dumps.
|
|
61
61
|
- The script refuses an `--out` path in `.c64-re-tools/knowledge/` and the index of the knowledge. Change the project knowledge only with the commands that change it.
|
|
62
62
|
- The script refuses a folder where the command writes a file. It refuses a file where the command writes a folder.
|
|
63
|
-
- When a file is the evidence for a finding in the project knowledge, move it out of `.c64-re-tools/local/` first. The project knowledge refuses evidence in that folder.
|
|
63
|
+
- When a test or another file is the evidence for a finding in the project knowledge, move it out of `.c64-re-tools/local/` first. The project knowledge refuses that evidence in that folder.
|
|
64
|
+
- A coverage map can stay in `.c64-re-tools/local/`. The project knowledge keeps its ranges and its SHA-256.
|
|
64
65
|
- Do not move a coverage map after you put it into the project knowledge. The knowledge refers to the map by its path at that time.
|
|
65
66
|
- Put a run that is evidence in `runs/<name>/`, with its run file, its results and its snapshot files. Change the paths in the run file to the new paths. Then git keeps them, and another person can do the run again.
|
|
66
67
|
- A shell redirect (`>`) is relative to the working directory, not to the project folder. From the folder above the project, write `<folder>/.c64-re-tools/local/result.json`.
|
|
@@ -80,7 +80,8 @@ The script refuses a step in an old form. The message gives the step to write.
|
|
|
80
80
|
- Write each file that you make for your work in `.c64-re-tools/local/` of the project. Git ignores that folder. Examples are results, batches, step files, runs, snapshots and memory dumps.
|
|
81
81
|
- The script refuses an `--out` path in `.c64-re-tools/knowledge/` and the index of the knowledge. Change the project knowledge only with the commands that change it.
|
|
82
82
|
- The script refuses a folder where the command writes a file. It refuses a file where the command writes a folder.
|
|
83
|
-
- When a file is the evidence for a finding in the project knowledge, move it out of `.c64-re-tools/local/` first. The project knowledge refuses evidence in that folder.
|
|
83
|
+
- When a test or another file is the evidence for a finding in the project knowledge, move it out of `.c64-re-tools/local/` first. The project knowledge refuses that evidence in that folder.
|
|
84
|
+
- A coverage map can stay in `.c64-re-tools/local/`. The project knowledge keeps its ranges and its SHA-256.
|
|
84
85
|
- Do not move a coverage map after you put it into the project knowledge. The knowledge refers to the map by its path at that time.
|
|
85
86
|
- Put a run that is evidence in `runs/<name>/`, with its run file, its results and its snapshot files. Change the paths in the run file to the new paths. Then git keeps them, and another person can do the run again.
|
|
86
87
|
- A shell redirect (`>`) is relative to the working directory, not to the project folder. From the folder above the project, write `<folder>/.c64-re-tools/local/result.json`.
|
package/src/cli/main.ts
CHANGED
|
@@ -92,8 +92,10 @@ async function main(argv: string[]): Promise<number> {
|
|
|
92
92
|
const note = scope === "project" && (targets === undefined || targets.includes("windsurf")) ? undoWindsurfProjectMcp(before) : undefined;
|
|
93
93
|
process.stdout.write(note === undefined ? output : withoutWindsurfMcp(output));
|
|
94
94
|
if (note !== undefined) console.log(` ${note}\n`);
|
|
95
|
-
// A skill that this version renamed or dropped must not stay next to the new ones.
|
|
96
|
-
|
|
95
|
+
// A skill that this version renamed or dropped must not stay next to the new ones. AP SDK can write its
|
|
96
|
+
// new manifest and still exit with an error: then the next install no longer knows the dropped items, so
|
|
97
|
+
// the cleanup runs after each install. An install that wrote no manifest drops nothing.
|
|
98
|
+
const removed = removeDroppedItems(earlier, scope);
|
|
97
99
|
if (removed.length > 0) console.log(` Removed, because this version no longer has them: ${removed.join(", ")}\n`);
|
|
98
100
|
return code;
|
|
99
101
|
}
|
package/src/cli/status.ts
CHANGED
|
@@ -91,7 +91,6 @@ export function installedLines(cwd = process.cwd()): string[] {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
if (lines.length === 0) return ["Installed: nothing in this project or globally."];
|
|
94
|
-
lines.push(" The MCP server gives its own version in the result of c64_status.");
|
|
95
94
|
return lines;
|
|
96
95
|
}
|
|
97
96
|
|