@fcon-tech/portolan 0.4.5
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/LICENSE +21 -0
- package/README.md +110 -0
- package/adapters/README.md +226 -0
- package/adapters/omp/portolan-mcp +19 -0
- package/adapters/opencode/expedition-launcher +70 -0
- package/adapters/opencode/install.test.ts +105 -0
- package/adapters/opencode/install.ts +357 -0
- package/adapters/pi/portolan-mcp +19 -0
- package/adapters/scheduling/night-watch.cron +23 -0
- package/core/schema/chart.schema.json +154 -0
- package/core/src/bin/portolan.ts +84 -0
- package/core/src/chart-io.rollback-fixture.ts +55 -0
- package/core/src/chart-io.ts +121 -0
- package/core/src/chart-store.ts +137 -0
- package/core/src/chartroom/cli.ts +63 -0
- package/core/src/chartroom/render.ts +213 -0
- package/core/src/chartroom/review-template.html +232 -0
- package/core/src/chartroom/review.ts +109 -0
- package/core/src/chartroom/template.html +1090 -0
- package/core/src/fan-in.ts +84 -0
- package/core/src/harbor/chat-format.ts +154 -0
- package/core/src/harbor/cli.ts +178 -0
- package/core/src/harbor/errors.ts +22 -0
- package/core/src/harbor/fingerprint.ts +29 -0
- package/core/src/harbor/history.ts +178 -0
- package/core/src/harbor/launcher.ts +155 -0
- package/core/src/harbor/night-policy.ts +64 -0
- package/core/src/harbor/proposals.ts +324 -0
- package/core/src/harbor/run.ts +72 -0
- package/core/src/harbor/settings.ts +108 -0
- package/core/src/harbor/snapshot.ts +187 -0
- package/core/src/harbor/watch.ts +103 -0
- package/core/src/index.ts +28 -0
- package/core/src/notices.ts +117 -0
- package/core/src/perimeter.ts +44 -0
- package/core/src/server/adapter-boundary.ts +66 -0
- package/core/src/server/main.ts +27 -0
- package/core/src/server/registry.ts +609 -0
- package/core/src/server/server.ts +123 -0
- package/core/src/server/test-harness.ts +161 -0
- package/core/src/sheets.ts +151 -0
- package/core/src/staleness.ts +203 -0
- package/core/src/tools/log.ts +215 -0
- package/core/src/tools/manifests.ts +912 -0
- package/core/src/tools/neighborhood.ts +423 -0
- package/core/src/tools/shared.ts +72 -0
- package/core/src/tools/sound.ts +634 -0
- package/core/src/tools/sweep.ts +198 -0
- package/core/src/tools/symbols.ts +176 -0
- package/core/src/tools/trust-report.ts +193 -0
- package/core/src/types.ts +162 -0
- package/core/src/validate.ts +106 -0
- package/package.json +34 -0
- package/skill/SKILL.md +279 -0
- package/skill/examples/sailing-directions-example.md +35 -0
- package/skill/sailing-directions.template.md +59 -0
- package/skill/verify/checks.ts +476 -0
- package/skill/verify/dry-run.ts +738 -0
- package/skill/verify/fixture.ts +128 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The fixture province for the expedition-skill dry runs: a small
|
|
3
|
+
* three-vessel target (apps/cli, apps/api, packages/lib) with a root README
|
|
4
|
+
* that plants two doc drifts the survey must refute — a claimed cli→api
|
|
5
|
+
* fairway with no deterministic support, and an export (validate) the source
|
|
6
|
+
* does not have. Content is deterministic; the dry run's output must be too.
|
|
7
|
+
*/
|
|
8
|
+
import { mkdirSync, writeFileSync } from "node:fs";
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
|
|
11
|
+
export function createFixture(root: string): void {
|
|
12
|
+
const file = (rel: string, text: string) => {
|
|
13
|
+
const path = join(root, rel);
|
|
14
|
+
mkdirSync(join(path, ".."), { recursive: true });
|
|
15
|
+
writeFileSync(path, text);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
file(
|
|
19
|
+
"package.json",
|
|
20
|
+
JSON.stringify(
|
|
21
|
+
{ name: "fixture-province", private: true, workspaces: ["apps/*", "packages/*"] },
|
|
22
|
+
null,
|
|
23
|
+
2
|
|
24
|
+
) + "\n"
|
|
25
|
+
);
|
|
26
|
+
file(
|
|
27
|
+
"README.md",
|
|
28
|
+
[
|
|
29
|
+
"# Fixture province",
|
|
30
|
+
"",
|
|
31
|
+
"A small province for Portolan dry runs.",
|
|
32
|
+
"",
|
|
33
|
+
"- The CLI calls the API over HTTP for every parse.",
|
|
34
|
+
"- packages/lib exports validate() from src/validate.ts.",
|
|
35
|
+
"",
|
|
36
|
+
].join("\n")
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
file(
|
|
40
|
+
"apps/cli/package.json",
|
|
41
|
+
JSON.stringify(
|
|
42
|
+
{
|
|
43
|
+
name: "@fixture/cli",
|
|
44
|
+
bin: { fixture: "./bin/cli.ts" },
|
|
45
|
+
dependencies: { "@fixture/lib": "workspace:*" },
|
|
46
|
+
},
|
|
47
|
+
null,
|
|
48
|
+
2
|
|
49
|
+
) + "\n"
|
|
50
|
+
);
|
|
51
|
+
file(
|
|
52
|
+
"apps/cli/bin/cli.ts",
|
|
53
|
+
[
|
|
54
|
+
"#!/usr/bin/env bun",
|
|
55
|
+
'import { parse } from "@fixture/lib";',
|
|
56
|
+
"",
|
|
57
|
+
'const prefix = "CLI";',
|
|
58
|
+
'const mode = process.env[prefix + "_MODE"];',
|
|
59
|
+
"const args = process.argv.slice(2);",
|
|
60
|
+
'const json = args.includes("--json");',
|
|
61
|
+
'const value = parse(args.find((a) => !a.startsWith("-")) ?? "");',
|
|
62
|
+
"if (json) console.log(JSON.stringify({ value, mode }));",
|
|
63
|
+
"else console.log(value);",
|
|
64
|
+
"",
|
|
65
|
+
].join("\n")
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
file(
|
|
69
|
+
"apps/api/package.json",
|
|
70
|
+
JSON.stringify(
|
|
71
|
+
{ name: "@fixture/api", dependencies: { "@fixture/lib": "workspace:*" } },
|
|
72
|
+
null,
|
|
73
|
+
2
|
|
74
|
+
) + "\n"
|
|
75
|
+
);
|
|
76
|
+
file(
|
|
77
|
+
"apps/api/server.ts",
|
|
78
|
+
[
|
|
79
|
+
'import { parse } from "@fixture/lib";',
|
|
80
|
+
"",
|
|
81
|
+
'const PORT = Number(process.env.PORT ?? 8080);',
|
|
82
|
+
"",
|
|
83
|
+
"Bun.serve({",
|
|
84
|
+
" port: PORT,",
|
|
85
|
+
" fetch(request) {",
|
|
86
|
+
" const url = new URL(request.url);",
|
|
87
|
+
' if (url.pathname === "/health") return new Response("ok");',
|
|
88
|
+
" try {",
|
|
89
|
+
' const q = url.searchParams.get("q") ?? "";',
|
|
90
|
+
" return new Response(parse(q));",
|
|
91
|
+
" } catch {",
|
|
92
|
+
' return new Response("ok"); // errors swallowed, no error signal',
|
|
93
|
+
" }",
|
|
94
|
+
" },",
|
|
95
|
+
"});",
|
|
96
|
+
"",
|
|
97
|
+
].join("\n")
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
file(
|
|
101
|
+
"packages/lib/package.json",
|
|
102
|
+
JSON.stringify(
|
|
103
|
+
{ name: "@fixture/lib", main: "src/parse.ts" },
|
|
104
|
+
null,
|
|
105
|
+
2
|
|
106
|
+
) + "\n"
|
|
107
|
+
);
|
|
108
|
+
file(
|
|
109
|
+
"packages/lib/src/parse.ts",
|
|
110
|
+
[
|
|
111
|
+
"export function parse(input: string): string {",
|
|
112
|
+
' return input.split(",").join("|");',
|
|
113
|
+
"}",
|
|
114
|
+
"",
|
|
115
|
+
].join("\n")
|
|
116
|
+
);
|
|
117
|
+
file(
|
|
118
|
+
"packages/lib/check.ts",
|
|
119
|
+
[
|
|
120
|
+
'import { parse } from "./src/parse";',
|
|
121
|
+
"",
|
|
122
|
+
'const ok = parse("a,b") === "a|b";',
|
|
123
|
+
'console.log(ok ? "lib check passed" : "lib check failed");',
|
|
124
|
+
"process.exit(ok ? 0 : 1);",
|
|
125
|
+
"",
|
|
126
|
+
].join("\n")
|
|
127
|
+
);
|
|
128
|
+
}
|