@intentius/behold 0.29.25 → 0.29.26
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/AGENTS.md +3 -1
- package/demos.json +15 -0
- package/dist/cli.js +604 -371
- package/example-choudoufu-estate/README.md +2 -2
- package/example-choudoufu-estate/scripts/choudoufu-up.sh +2 -2
- package/example-terralith/README.md +32 -0
- package/example-terralith/phases/adopt/migrations/adopt.yml +12 -0
- package/example-terralith/phases/adopt/terralith/main.tf +138 -0
- package/example-terralith/phases/split/migrations/split.yml +29 -0
- package/example-terralith/phases/split/team-a/main.tf +52 -0
- package/example-terralith/phases/split/team-b/main.tf +52 -0
- package/example-terralith/phases/split/team-c/main.tf +52 -0
- package/example-terralith/phases/split/terralith/main.tf +27 -0
- package/example-terralith/scripts/lib.sh +64 -0
- package/example-terralith/scripts/terralith-down.sh +9 -0
- package/example-terralith/scripts/terralith-step.sh +88 -0
- package/example-terralith/scripts/terralith-up.sh +50 -0
- package/example-terralith/terralith/main.tf +141 -0
- package/package.json +2 -1
- package/web/app.js +51 -7
- package/web/identity-mark.js +61 -0
- package/web/identity-mark.test.js +32 -0
- package/web/pending.js +2 -0
- package/web/pending.test.js +7 -0
- package/web/terralith-steps.js +93 -0
- package/web/terralith-steps.test.js +71 -0
- package/web/terralith.html +105 -0
- package/web/terralith.js +211 -0
- /package/example-choudoufu-estate/monolith/{carve.json → split.json} +0 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
terraform {
|
|
2
|
+
required_providers {
|
|
3
|
+
aws = {
|
|
4
|
+
source = "hashicorp/aws"
|
|
5
|
+
version = "= 6.59.0"
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
backend "s3" {
|
|
9
|
+
bucket = "terralith-state"
|
|
10
|
+
key = "terralith/terraform.tfstate"
|
|
11
|
+
region = "us-east-1"
|
|
12
|
+
use_lockfile = true
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
provider "aws" {
|
|
17
|
+
region = "us-east-1"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
# ---- network ----
|
|
21
|
+
resource "aws_vpc" "main" {
|
|
22
|
+
cidr_block = "10.42.0.0/16"
|
|
23
|
+
tags = { Name = "terralith-main" }
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
resource "aws_subnet" "app" {
|
|
27
|
+
vpc_id = aws_vpc.main.id
|
|
28
|
+
cidr_block = "10.42.1.0/24"
|
|
29
|
+
tags = { Name = "terralith-app" }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
# ---- team-a ----
|
|
33
|
+
resource "aws_iam_role" "team_a" {
|
|
34
|
+
name = "terralith-team-a-role"
|
|
35
|
+
assume_role_policy = jsonencode({ Version = "2012-10-17", Statement = [{ Effect = "Allow", Principal = { Service = "ec2.amazonaws.com" }, Action = "sts:AssumeRole" }] })
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
resource "aws_iam_role_policy" "team_a_inline" {
|
|
39
|
+
name = "terralith-team-a-inline"
|
|
40
|
+
role = aws_iam_role.team_a.id
|
|
41
|
+
policy = jsonencode({ Version = "2012-10-17", Statement = [{ Effect = "Allow", Action = ["logs:CreateLogStream"], Resource = "*" }] })
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
resource "aws_iam_policy" "team_a" {
|
|
45
|
+
name = "terralith-team-a-policy"
|
|
46
|
+
policy = jsonencode({ Version = "2012-10-17", Statement = [{ Effect = "Allow", Action = ["logs:PutLogEvents"], Resource = "*" }] })
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
resource "aws_iam_role_policy_attachment" "team_a" {
|
|
50
|
+
role = aws_iam_role.team_a.name
|
|
51
|
+
policy_arn = aws_iam_policy.team_a.arn
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
resource "aws_cloudwatch_log_group" "team_a_0" {
|
|
55
|
+
name = "/terralith/team-a/svc-0"
|
|
56
|
+
retention_in_days = 7
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
resource "aws_cloudwatch_log_group" "team_a_1" {
|
|
60
|
+
name = "/terralith/team-a/svc-1"
|
|
61
|
+
retention_in_days = 7
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
resource "aws_cloudwatch_log_group" "team_a_2" {
|
|
65
|
+
name = "/terralith/team-a/svc-2"
|
|
66
|
+
retention_in_days = 7
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
# ---- team-b ----
|
|
70
|
+
resource "aws_iam_role" "team_b" {
|
|
71
|
+
name = "terralith-team-b-role"
|
|
72
|
+
assume_role_policy = jsonencode({ Version = "2012-10-17", Statement = [{ Effect = "Allow", Principal = { Service = "ec2.amazonaws.com" }, Action = "sts:AssumeRole" }] })
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
resource "aws_iam_role_policy" "team_b_inline" {
|
|
76
|
+
name = "terralith-team-b-inline"
|
|
77
|
+
role = aws_iam_role.team_b.id
|
|
78
|
+
policy = jsonencode({ Version = "2012-10-17", Statement = [{ Effect = "Allow", Action = ["logs:CreateLogStream"], Resource = "*" }] })
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
resource "aws_iam_policy" "team_b" {
|
|
82
|
+
name = "terralith-team-b-policy"
|
|
83
|
+
policy = jsonencode({ Version = "2012-10-17", Statement = [{ Effect = "Allow", Action = ["logs:PutLogEvents"], Resource = "*" }] })
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
resource "aws_iam_role_policy_attachment" "team_b" {
|
|
87
|
+
role = aws_iam_role.team_b.name
|
|
88
|
+
policy_arn = aws_iam_policy.team_b.arn
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
resource "aws_cloudwatch_log_group" "team_b_0" {
|
|
92
|
+
name = "/terralith/team-b/svc-0"
|
|
93
|
+
retention_in_days = 7
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
resource "aws_cloudwatch_log_group" "team_b_1" {
|
|
97
|
+
name = "/terralith/team-b/svc-1"
|
|
98
|
+
retention_in_days = 7
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
resource "aws_cloudwatch_log_group" "team_b_2" {
|
|
102
|
+
name = "/terralith/team-b/svc-2"
|
|
103
|
+
retention_in_days = 7
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
# ---- team-c ----
|
|
107
|
+
resource "aws_iam_role" "team_c" {
|
|
108
|
+
name = "terralith-team-c-role"
|
|
109
|
+
assume_role_policy = jsonencode({ Version = "2012-10-17", Statement = [{ Effect = "Allow", Principal = { Service = "ec2.amazonaws.com" }, Action = "sts:AssumeRole" }] })
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
resource "aws_iam_role_policy" "team_c_inline" {
|
|
113
|
+
name = "terralith-team-c-inline"
|
|
114
|
+
role = aws_iam_role.team_c.id
|
|
115
|
+
policy = jsonencode({ Version = "2012-10-17", Statement = [{ Effect = "Allow", Action = ["logs:CreateLogStream"], Resource = "*" }] })
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
resource "aws_iam_policy" "team_c" {
|
|
119
|
+
name = "terralith-team-c-policy"
|
|
120
|
+
policy = jsonencode({ Version = "2012-10-17", Statement = [{ Effect = "Allow", Action = ["logs:PutLogEvents"], Resource = "*" }] })
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
resource "aws_iam_role_policy_attachment" "team_c" {
|
|
124
|
+
role = aws_iam_role.team_c.name
|
|
125
|
+
policy_arn = aws_iam_policy.team_c.arn
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
resource "aws_cloudwatch_log_group" "team_c_0" {
|
|
129
|
+
name = "/terralith/team-c/svc-0"
|
|
130
|
+
retention_in_days = 7
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
resource "aws_cloudwatch_log_group" "team_c_1" {
|
|
134
|
+
name = "/terralith/team-c/svc-1"
|
|
135
|
+
retention_in_days = 7
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
resource "aws_cloudwatch_log_group" "team_c_2" {
|
|
139
|
+
name = "/terralith/team-c/svc-2"
|
|
140
|
+
retention_in_days = 7
|
|
141
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/behold",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.26",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "behold — a live control plane on chant. See your whole estate (every substrate in one graph), coloured by drift; act through delegated, gated Ops.",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"example-carve",
|
|
19
19
|
"example-terraform-estate",
|
|
20
20
|
"example-choudoufu-estate",
|
|
21
|
+
"example-terralith",
|
|
21
22
|
"demos.json",
|
|
22
23
|
"AGENTS.md",
|
|
23
24
|
"LICENSE",
|
package/web/app.js
CHANGED
|
@@ -109,6 +109,8 @@ import { hasOperator, renderOperator, APPROVED_SEMANTICS } from "./operator.js";
|
|
|
109
109
|
import { releaseRows } from "./release.js";
|
|
110
110
|
import { danglingFor, danglingRows, danglingHeading, DANGLING_EXPLAINED } from "./dangling.js";
|
|
111
111
|
import { comparisonRow, comparisonSummary } from "./cross-env.js";
|
|
112
|
+
// The marker-vs-derived mark on a choudoufu card: how its identity was found.
|
|
113
|
+
import { identityMark, tagGlyphSvg } from "./identity-mark.js";
|
|
112
114
|
initTheme();
|
|
113
115
|
// #476: framed in a host pane. The flag is a class on <html>, so the CSS that
|
|
114
116
|
// folds the chrome away needs no JS, and the theme is the host's for this
|
|
@@ -2010,14 +2012,14 @@ function copyToClipboard(text, el) {
|
|
|
2010
2012
|
* The choudoufu move plan (#371), as the scope panel shows it: one row per
|
|
2011
2013
|
* move (`address: from → to`), the line a person runs in the destination
|
|
2012
2014
|
* estate's directory with a copy button, and a link to the morph page. The
|
|
2013
|
-
* plan is read from `/api/choudoufu/
|
|
2015
|
+
* plan is read from `/api/choudoufu/split`, which previews with choudoufu's
|
|
2014
2016
|
* own `-dry-run` when asked and never runs the write — `apply.note` carries
|
|
2015
2017
|
* that sentence here verbatim. A no-op when no served member carries a
|
|
2016
|
-
* `carve.json
|
|
2018
|
+
* `split.json` (or the workbench's `carve.json`).
|
|
2017
2019
|
*/
|
|
2018
2020
|
function renderChoudoufuMoves(host, info) {
|
|
2019
2021
|
if (!info || !info.plans || !info.plans.length || staticMode || publicMode) return;
|
|
2020
|
-
host.appendChild(panelHeading("
|
|
2022
|
+
host.appendChild(panelHeading("split (choudoufu)"));
|
|
2021
2023
|
for (const plan of info.plans) {
|
|
2022
2024
|
const head = document.createElement("div");
|
|
2023
2025
|
head.className = "count-row";
|
|
@@ -2026,15 +2028,15 @@ function renderChoudoufuMoves(host, info) {
|
|
|
2026
2028
|
label.textContent = plan;
|
|
2027
2029
|
const morph = document.createElement("a");
|
|
2028
2030
|
morph.className = "tag";
|
|
2029
|
-
morph.textContent = "
|
|
2030
|
-
morph.href = "/choudoufu/
|
|
2031
|
+
morph.textContent = "split ↗";
|
|
2032
|
+
morph.href = "/choudoufu/split?plan=" + encodeURIComponent(plan);
|
|
2031
2033
|
morph.target = "_blank";
|
|
2032
|
-
morph.title = "Every
|
|
2034
|
+
morph.title = "Every estate a box, the moved cards gliding to their destination";
|
|
2033
2035
|
head.append(label, morph);
|
|
2034
2036
|
host.appendChild(head);
|
|
2035
2037
|
const rows = document.createElement("div");
|
|
2036
2038
|
host.appendChild(rows);
|
|
2037
|
-
apiFetch("/api/choudoufu/
|
|
2039
|
+
apiFetch("/api/choudoufu/split?plan=" + encodeURIComponent(plan))
|
|
2038
2040
|
.then((r) => r.json())
|
|
2039
2041
|
.then((body) => {
|
|
2040
2042
|
if (!body || !Array.isArray(body.moves)) {
|
|
@@ -3347,6 +3349,46 @@ function markPendingCards(ir) {
|
|
|
3347
3349
|
}
|
|
3348
3350
|
}
|
|
3349
3351
|
|
|
3352
|
+
/**
|
|
3353
|
+
* The marker-vs-derived mark on each choudoufu card the live overlay bound
|
|
3354
|
+
* (`attrs._identity`, src/choudoufu-live.ts): a small tag badge on the card's
|
|
3355
|
+
* top-right edge, filled when the object wears the estate's marker and
|
|
3356
|
+
* outlined when it does not. A card has no free corner for words, so they are
|
|
3357
|
+
* the badge's tooltip, and the inspect pane's `bound` and `marker` rows. Same
|
|
3358
|
+
* after-the-render stamp as markCarvedCards(), for the same reason.
|
|
3359
|
+
*/
|
|
3360
|
+
function markIdentityCards(ir) {
|
|
3361
|
+
const svg = document.querySelector("#graph svg");
|
|
3362
|
+
if (!svg) return;
|
|
3363
|
+
// A member frame merges identities into lastGraphIr (web/pending.js), and a
|
|
3364
|
+
// re-render (a theme change, a fit) may paint from another IR object, so
|
|
3365
|
+
// both are read.
|
|
3366
|
+
const known = new Map();
|
|
3367
|
+
for (const src of [lastGraphIr, ir]) for (const n of (src && src.nodes) || []) if (n.attrs && n.attrs._identity) known.set(n.id, n.attrs._identity);
|
|
3368
|
+
for (const [id, identity] of known) {
|
|
3369
|
+
const n = { id };
|
|
3370
|
+
const mark = identityMark(identity);
|
|
3371
|
+
if (!mark || mark.glyph === "none") continue;
|
|
3372
|
+
const g = svg.querySelector('[data-node-id="' + CSS.escape(n.id) + '"]');
|
|
3373
|
+
if (!g || g.querySelector('[data-identity="1"]')) continue;
|
|
3374
|
+
const rect = g.querySelector("rect");
|
|
3375
|
+
const box = rect && rect.getBBox ? rect.getBBox() : null;
|
|
3376
|
+
const size = 14;
|
|
3377
|
+
const x = (box ? box.x + box.width : 150) - size - 6;
|
|
3378
|
+
const y = (box ? box.y : 0) - size / 2;
|
|
3379
|
+
const wrap = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
3380
|
+
wrap.setAttribute("data-identity", "1");
|
|
3381
|
+
wrap.setAttribute("class", "identity-mark");
|
|
3382
|
+
wrap.innerHTML =
|
|
3383
|
+
`<rect x="${x - 3}" y="${y - 2}" width="${size + 6}" height="${size + 4}" rx="5" fill="var(--bg)" stroke="var(--managed)" stroke-width="1"/>` +
|
|
3384
|
+
tagGlyphSvg(mark.glyph, x, y, size, "var(--managed)");
|
|
3385
|
+
const title = document.createElementNS("http://www.w3.org/2000/svg", "title");
|
|
3386
|
+
title.textContent = `${mark.label}: ${mark.tip}`;
|
|
3387
|
+
wrap.prepend(title);
|
|
3388
|
+
g.appendChild(wrap);
|
|
3389
|
+
}
|
|
3390
|
+
}
|
|
3391
|
+
|
|
3350
3392
|
function markDriftedCards(ir) {
|
|
3351
3393
|
const svg = document.querySelector("#graph svg");
|
|
3352
3394
|
if (!svg) return;
|
|
@@ -6102,6 +6144,7 @@ function render(ir, svg, m) {
|
|
|
6102
6144
|
markCarvedCards(); // #254: the SVG is replaced per render — re-stamp the marker
|
|
6103
6145
|
markPlayhead(ir); // #284 item 2: same, for the step the run is sitting on
|
|
6104
6146
|
markOperatorCards(ir); // #234 free rider: same, for the operating loop's home
|
|
6147
|
+
markIdentityCards(ir); // the identity mark: a tag badge on the card's top-right edge
|
|
6105
6148
|
markDriftedCards(ir); // #404: same, for a bound card the plan would change — after the carve/operator stamps, so it can see and yield to them
|
|
6106
6149
|
markPendingCards(ir); // #422: and the cards whose member has not answered yet
|
|
6107
6150
|
markTerragucciCards(); // #490: and what terragucci's reports found, dated
|
|
@@ -7465,6 +7508,7 @@ events.addEventListener("member", (e) => {
|
|
|
7465
7508
|
pendingMembers = stillPending(pendingMembers, frame);
|
|
7466
7509
|
if (moved.length) recolorNodesByCategory(lastGraphIr);
|
|
7467
7510
|
markPendingCards(lastGraphIr);
|
|
7511
|
+
markIdentityCards(lastGraphIr);
|
|
7468
7512
|
renderStatusbar();
|
|
7469
7513
|
});
|
|
7470
7514
|
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// The marker-vs-derived mark: how a card shows where its identity comes from.
|
|
2
|
+
//
|
|
3
|
+
// choudoufu keeps two facts apart, and so does the mark:
|
|
4
|
+
//
|
|
5
|
+
// - how the plan found the live object (`live-plan`'s `bound[].source`):
|
|
6
|
+
// `marker` when the estate-wide tag sweep bound it, `derived` when the
|
|
7
|
+
// configuration names it (an IAM role's name, a log group's name);
|
|
8
|
+
// - whether the object wears this estate's marker (`live-ls` lists it under
|
|
9
|
+
// the estate's tag).
|
|
10
|
+
//
|
|
11
|
+
// A stamped log group is derived AND marked; an inline policy is derived and
|
|
12
|
+
// has no tags argument to carry a marker. A stock root has neither: its
|
|
13
|
+
// identity is the state file's.
|
|
14
|
+
//
|
|
15
|
+
// The glyph is a tag: filled when the object wears the marker, outlined when
|
|
16
|
+
// it does not, absent for a stock root. Pure data and functions; app.js and
|
|
17
|
+
// terralith.js draw.
|
|
18
|
+
|
|
19
|
+
/** Every mark, keyed. `label` is the card's word, `tip` its hover. */
|
|
20
|
+
export const IDENTITY_MARKS = {
|
|
21
|
+
state: { label: "state file", glyph: "none", tip: "A stock root keeps this resource's identity in its state file." },
|
|
22
|
+
marker: { label: "marker", glyph: "solid", tip: "The tag sweep found it by the marker on the resource (tofu-estate, tofu-address)." },
|
|
23
|
+
"derived-marked": { label: "derived · marked", glyph: "solid", tip: "Its name in the code identifies it, and it wears the marker too." },
|
|
24
|
+
derived: { label: "derived", glyph: "outline", tip: "Matched by name alone; it has no tags argument to carry a marker." },
|
|
25
|
+
record: { label: "record", glyph: "outline", tip: "Its identity comes from the estate's record store." },
|
|
26
|
+
cache: { label: "cache", glyph: "outline", tip: "Answered from the local state cache." },
|
|
27
|
+
unbound: { label: "not bound yet", glyph: "outline", tip: "The plan has bound no live object to it yet." },
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** The mark's key for an identity `{source, marked}`, or null for none. */
|
|
31
|
+
export function identityKey(identity) {
|
|
32
|
+
if (!identity || typeof identity !== "object") return null;
|
|
33
|
+
const { source, marked } = identity;
|
|
34
|
+
if (source === "state") return "state";
|
|
35
|
+
if (source === "marker") return "marker";
|
|
36
|
+
if (source === "derived") return marked ? "derived-marked" : "derived";
|
|
37
|
+
if (source === "record" || source === "cache") return source;
|
|
38
|
+
if (source === "unbound") return "unbound";
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** The mark for an identity: `{key, label, glyph, tip}`, or null. */
|
|
43
|
+
export function identityMark(identity) {
|
|
44
|
+
const key = identityKey(identity);
|
|
45
|
+
return key ? { key, ...IDENTITY_MARKS[key] } : null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** The tag glyph as SVG markup at (x, y), `size` px tall, in `color`. */
|
|
49
|
+
export function tagGlyphSvg(glyph, x, y, size, color) {
|
|
50
|
+
if (glyph === "none") return "";
|
|
51
|
+
const s = size / 12;
|
|
52
|
+
const p = (px, py) => `${(x + px * s).toFixed(2)},${(y + py * s).toFixed(2)}`;
|
|
53
|
+
// A luggage tag: a pentagon pointing left, with its eyelet.
|
|
54
|
+
const body = [p(0, 6), p(4, 1), p(12, 1), p(12, 11), p(4, 11)].join(" ");
|
|
55
|
+
const fill = glyph === "solid" ? color : "none";
|
|
56
|
+
const hole = glyph === "solid" ? "var(--bg, #000)" : color;
|
|
57
|
+
return (
|
|
58
|
+
`<polygon points="${body}" fill="${fill}" stroke="${color}" stroke-width="${(1.2 * s).toFixed(2)}" stroke-linejoin="round"/>` +
|
|
59
|
+
`<circle cx="${(x + 4.6 * s).toFixed(2)}" cy="${(y + 6 * s).toFixed(2)}" r="${(1.2 * s).toFixed(2)}" fill="${hole}"/>`
|
|
60
|
+
);
|
|
61
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { IDENTITY_MARKS, identityKey, identityMark, tagGlyphSvg } from "./identity-mark.js";
|
|
3
|
+
|
|
4
|
+
describe("the marker-vs-derived mark", () => {
|
|
5
|
+
it("tells a marker-found card from a derived one, and a derived one that wears the marker from one that does not", () => {
|
|
6
|
+
expect(identityKey({ source: "marker", marked: true })).toBe("marker");
|
|
7
|
+
expect(identityKey({ source: "derived", marked: true })).toBe("derived-marked");
|
|
8
|
+
expect(identityKey({ source: "derived", marked: false })).toBe("derived");
|
|
9
|
+
expect(identityKey({ source: "state", marked: false })).toBe("state");
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it("fills the tag only when the object wears the marker", () => {
|
|
13
|
+
expect(identityMark({ source: "derived", marked: true }).glyph).toBe("solid");
|
|
14
|
+
expect(identityMark({ source: "derived", marked: false }).glyph).toBe("outline");
|
|
15
|
+
expect(identityMark({ source: "state", marked: false }).glyph).toBe("none");
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("has no mark for an identity it does not know", () => {
|
|
19
|
+
expect(identityMark(undefined)).toBeNull();
|
|
20
|
+
expect(identityMark({ source: "guess" })).toBeNull();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it("keeps every label short enough for a card's corner", () => {
|
|
24
|
+
for (const m of Object.values(IDENTITY_MARKS)) expect(m.label.length).toBeLessThanOrEqual(16);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("draws a filled tag, an outlined tag, or nothing", () => {
|
|
28
|
+
expect(tagGlyphSvg("solid", 0, 0, 12, "red")).toContain('fill="red"');
|
|
29
|
+
expect(tagGlyphSvg("outline", 0, 0, 12, "red")).toContain('fill="none"');
|
|
30
|
+
expect(tagGlyphSvg("none", 0, 0, 12, "red")).toBe("");
|
|
31
|
+
});
|
|
32
|
+
});
|
package/web/pending.js
CHANGED
|
@@ -37,6 +37,8 @@ export function applyMemberFrame(ir, frame) {
|
|
|
37
37
|
// and not absent.
|
|
38
38
|
if (frame.unobserved) attrs._unobserved = frame.unobserved;
|
|
39
39
|
else delete attrs._unobserved;
|
|
40
|
+
// The identity mark (web/identity-mark.js), for a card that carries one.
|
|
41
|
+
if (frame.identities && frame.identities[node.id]) attrs._identity = frame.identities[node.id];
|
|
40
42
|
if (was !== next) moved.push(node.id);
|
|
41
43
|
}
|
|
42
44
|
return moved;
|
package/web/pending.test.js
CHANGED
|
@@ -21,6 +21,13 @@ describe("applyMemberFrame (#422)", () => {
|
|
|
21
21
|
expect(graph.nodes[2].attrs).toEqual({ _pendingRead: true });
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
+
it("carries a choudoufu card's identity mark when the frame has one", () => {
|
|
25
|
+
const graph = ir();
|
|
26
|
+
applyMemberFrame(graph, { member: "team-a", statuses: { "team-a/bucket": "good", "team-a/role": "good" }, identities: { "team-a/role": { source: "derived", marked: true } } });
|
|
27
|
+
expect(graph.nodes[1].attrs._identity).toEqual({ source: "derived", marked: true });
|
|
28
|
+
expect(graph.nodes[0].attrs._identity).toBeUndefined();
|
|
29
|
+
});
|
|
30
|
+
|
|
24
31
|
it("carries a failed member's reason, which is not the same as pending", () => {
|
|
25
32
|
const graph = ir();
|
|
26
33
|
applyMemberFrame(graph, { member: "team-b", unobserved: "no credentials", statuses: { "team-b/bucket": "neutral" } });
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// `behold demo terralith`'s walkthrough: what each phase says and how a card
|
|
2
|
+
// reads. Pure data and functions, tested next door; web/terralith.js draws.
|
|
3
|
+
//
|
|
4
|
+
// The model comes from GET /api/terralith (src/terralith-demo.ts), which reads
|
|
5
|
+
// the snapshot files the demo copy's scripts write. Nothing here runs a write:
|
|
6
|
+
// a phase that has not run yet shows the line that runs it, to copy.
|
|
7
|
+
|
|
8
|
+
import { IDENTITY_MARKS, identityKey } from "./identity-mark.js";
|
|
9
|
+
|
|
10
|
+
/** The phases, in order. `lead` is the phase's paragraph; `facts(phase)` its counted line. */
|
|
11
|
+
export const PHASES = [
|
|
12
|
+
{
|
|
13
|
+
id: "stock",
|
|
14
|
+
n: 1,
|
|
15
|
+
label: "Stock",
|
|
16
|
+
title: "A stock terralith",
|
|
17
|
+
lead: "One Terraform root holds a network and the IAM and logging of three teams. All 23 resources sit in one state file on S3, which is where each one's identity lives.",
|
|
18
|
+
facts: (p) => `${p.counts.cards} resources, ready to adopt.`,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: "adopt",
|
|
22
|
+
n: 2,
|
|
23
|
+
label: "Adopt",
|
|
24
|
+
title: "Adopt",
|
|
25
|
+
lead: "This is terragucci's backends migration. The root's backend block becomes a live block, and choudoufu live-import reads the state once and writes the tofu-estate and tofu-address tags on each resource it verifies. The state file stays in the bucket as it was.",
|
|
26
|
+
facts: (p) =>
|
|
27
|
+
`${p.counts.marked} of ${p.counts.cards} resources now carry the marker. ` +
|
|
28
|
+
`The other ${p.counts.cards - p.counts.marked} have no tags argument, and ride the role they belong to.`,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: "split",
|
|
32
|
+
n: 3,
|
|
33
|
+
label: "Split",
|
|
34
|
+
title: "Split",
|
|
35
|
+
lead: "This is terragucci's moves migration. Three team roots appear, and in each one choudoufu live-mv rewrites the tags on that team's resources so they belong to the team's estate. Each resource takes one tag write. Inline policies and attachments follow their role with no write of their own, and split.json holds the record.",
|
|
36
|
+
facts: (p) => {
|
|
37
|
+
const fresh = p.boxes.filter((b) => b.spawned).length;
|
|
38
|
+
return `${p.counts.moved} resources moved into ${fresh} new estate${fresh === 1 ? "" : "s"}. The terralith keeps the network.`;
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
export const phaseById = (id) => PHASES.find((p) => p.id === id) || null;
|
|
44
|
+
|
|
45
|
+
/** Which phase to show: the one the URL names when it has run, else the newest. */
|
|
46
|
+
export function shownPhase(model, wanted) {
|
|
47
|
+
const ran = (model && model.phases) || [];
|
|
48
|
+
if (!ran.length) return null;
|
|
49
|
+
return ran.find((p) => p.id === wanted) || ran[ran.length - 1];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Each step of the stepper: ran, shown, or the one to run next. */
|
|
53
|
+
export function stepperItems(model, shownId) {
|
|
54
|
+
const ran = new Set(((model && model.phases) || []).map((p) => p.id));
|
|
55
|
+
const next = model && model.next ? model.next.id : null;
|
|
56
|
+
return PHASES.map((p) => ({ id: p.id, n: p.n, label: p.label, ran: ran.has(p.id), shown: p.id === shownId, next: p.id === next }));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** A card's face: the type without its provider prefix, and the resource's name. */
|
|
60
|
+
export function cardFace(card) {
|
|
61
|
+
const [type, ...rest] = String(card.id).split(".");
|
|
62
|
+
return { kind: (card.type || type).replace(/^aws_/, ""), name: rest.join(".") || card.id };
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** The small word in a card's corner: the phase's own news about it. */
|
|
66
|
+
export function cardNews(card, phaseId) {
|
|
67
|
+
if (phaseId === "adopt" && card.ratified) return card.ratified;
|
|
68
|
+
if (phaseId === "split" && card.moved) return card.moved.follows ? "follows its role" : `from ${card.moved.from}`;
|
|
69
|
+
return "";
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** A box's subtitle. */
|
|
73
|
+
export function boxSubtitle(box) {
|
|
74
|
+
if (box.stock) return "stock root · state file on S3";
|
|
75
|
+
return `estate ${box.estate}${box.spawned ? " · new" : ""}`;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** The legend: one row per mark the shown phase uses, in the marks' own order. */
|
|
79
|
+
export function legendFor(phase) {
|
|
80
|
+
const used = new Set();
|
|
81
|
+
for (const b of (phase && phase.boxes) || []) for (const c of b.cards) used.add(identityKey(c.identity));
|
|
82
|
+
return Object.keys(IDENTITY_MARKS)
|
|
83
|
+
.filter((k) => used.has(k))
|
|
84
|
+
.map((k) => ({ key: k, ...IDENTITY_MARKS[k] }));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** FLIP: the translate that puts a card back where it was, from two rects. */
|
|
88
|
+
export function flipDelta(before, after) {
|
|
89
|
+
if (!before || !after) return null;
|
|
90
|
+
const dx = before.left - after.left;
|
|
91
|
+
const dy = before.top - after.top;
|
|
92
|
+
return Math.abs(dx) < 0.5 && Math.abs(dy) < 0.5 ? null : { dx, dy };
|
|
93
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { PHASES, boxSubtitle, cardFace, cardNews, flipDelta, legendFor, shownPhase, stepperItems } from "./terralith-steps.js";
|
|
3
|
+
|
|
4
|
+
const card = (id, identity, extra = {}) => ({ id, type: id.split(".")[0], root: "terralith", identity, ...extra });
|
|
5
|
+
const phase = (id, boxes, counts = {}) => ({ id, n: PHASES.find((p) => p.id === id).n, boxes, counts: { cards: 0, marked: 0, moved: 0, ...counts }, notes: [] });
|
|
6
|
+
|
|
7
|
+
describe("the walkthrough's phases", () => {
|
|
8
|
+
const model = {
|
|
9
|
+
phases: [phase("stock", []), phase("adopt", [])],
|
|
10
|
+
next: { id: "split", n: 3, command: "bash scripts/terralith-step.sh split" },
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
it("shows the phase the URL names when it ran, else the newest", () => {
|
|
14
|
+
expect(shownPhase(model, "stock").id).toBe("stock");
|
|
15
|
+
expect(shownPhase(model, "split").id).toBe("adopt");
|
|
16
|
+
expect(shownPhase(model, null).id).toBe("adopt");
|
|
17
|
+
expect(shownPhase({ phases: [] }, "stock")).toBeNull();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("marks each step ran, shown or next", () => {
|
|
21
|
+
expect(stepperItems(model, "adopt").map((s) => [s.id, s.ran, s.shown, s.next])).toEqual([
|
|
22
|
+
["stock", true, false, false],
|
|
23
|
+
["adopt", true, true, false],
|
|
24
|
+
["split", false, false, true],
|
|
25
|
+
]);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("counts what each phase changed in its own line", () => {
|
|
29
|
+
const adopt = PHASES.find((p) => p.id === "adopt");
|
|
30
|
+
expect(adopt.facts(phase("adopt", [], { cards: 23, marked: 17 }))).toBe(
|
|
31
|
+
"17 of 23 resources now carry the marker. The other 6 have no tags argument, and ride the role they belong to.",
|
|
32
|
+
);
|
|
33
|
+
const split = PHASES.find((p) => p.id === "split");
|
|
34
|
+
const boxes = [{ spawned: false }, { spawned: true }, { spawned: true }, { spawned: true }];
|
|
35
|
+
expect(split.facts(phase("split", boxes, { moved: 21 }))).toBe("21 resources moved into 3 new estates. The terralith keeps the network.");
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
describe("a card", () => {
|
|
40
|
+
it("reads its type without the provider and its resource name", () => {
|
|
41
|
+
expect(cardFace(card("aws_iam_role_policy.team_a_inline", {}))).toEqual({ kind: "iam_role_policy", name: "team_a_inline" });
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it("carries live-import's verdict in adopt, and its retag in split", () => {
|
|
45
|
+
const c = card("aws_iam_role.team_a", {}, { ratified: "verified", moved: { from: "terralith", to: "team-a" } });
|
|
46
|
+
expect(cardNews(c, "adopt")).toBe("verified");
|
|
47
|
+
expect(cardNews(c, "split")).toBe("from terralith");
|
|
48
|
+
expect(cardNews({ ...c, moved: { from: "terralith", to: "team-a", follows: "aws_iam_role.team_a" } }, "split")).toBe("follows its role");
|
|
49
|
+
expect(cardNews(c, "stock")).toBe("");
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
describe("boxes and the legend", () => {
|
|
54
|
+
it("says a stock root keeps a state file and a spawned estate is new", () => {
|
|
55
|
+
expect(boxSubtitle({ stock: true })).toBe("stock root · state file on S3");
|
|
56
|
+
expect(boxSubtitle({ stock: false, estate: "team-a", spawned: true })).toBe("estate team-a · new");
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it("lists only the marks the phase uses", () => {
|
|
60
|
+
const p = phase("adopt", [{ cards: [card("aws_vpc.main", { source: "marker", marked: true }), card("aws_iam_role_policy.x", { source: "derived", marked: false })] }]);
|
|
61
|
+
expect(legendFor(p).map((l) => l.key)).toEqual(["marker", "derived"]);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
describe("FLIP", () => {
|
|
66
|
+
it("is the offset back to where the card was, or nothing when it stayed", () => {
|
|
67
|
+
expect(flipDelta({ left: 10, top: 20 }, { left: 110, top: 20 })).toEqual({ dx: -100, dy: 0 });
|
|
68
|
+
expect(flipDelta({ left: 10, top: 20 }, { left: 10.2, top: 20 })).toBeNull();
|
|
69
|
+
expect(flipDelta(undefined, { left: 0, top: 0 })).toBeNull();
|
|
70
|
+
});
|
|
71
|
+
});
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>behold · terralith</title>
|
|
7
|
+
<link
|
|
8
|
+
rel="icon"
|
|
9
|
+
href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6' fill='none' stroke='%23a6adc8' stroke-width='1.6'/%3E%3Ccircle cx='8' cy='8' r='2.2' fill='%23a6adc8'/%3E%3C/svg%3E"
|
|
10
|
+
/>
|
|
11
|
+
<style>
|
|
12
|
+
/* The pre-paint fallback: Sea Shells' tokens (KIOSK_THEME in theme.js), which initTheme() replaces with the viewer's theme. */
|
|
13
|
+
:root {
|
|
14
|
+
--bg: #09141b; --panel: #1c2325; --line: #2c2e2d; --fg: #deb88d; --muted: #746a5c;
|
|
15
|
+
--edge: #4d483f; --managed: #027c9b; --foreign: #fca02f; --pending: #1e4950;
|
|
16
|
+
--degraded: #d15123; --neutral: #695e4e; --runtime: #50a3b5;
|
|
17
|
+
--rule: #3d4142; --focus: #364548; --active: #243235; --well: #01070d; --shadow: #010304;
|
|
18
|
+
--surface-box: #101b22; --surface-pane-a: #152128; --surface-pane-b: #1b272e; --soft: #deb88d; --muted-ink: #7c7365;
|
|
19
|
+
--managed-ink: #0e7f9e; --foreign-ink: #fca02f; --pending-ink: #567b82; --runtime-ink: #50a3b5;
|
|
20
|
+
--font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
21
|
+
--font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
22
|
+
--r-ctl: 6px; --t-body: 13px;
|
|
23
|
+
}
|
|
24
|
+
* { box-sizing: border-box; }
|
|
25
|
+
body { --fg: var(--soft); --muted: var(--muted-ink); --managed: var(--managed-ink); --foreign: var(--foreign-ink); --runtime: var(--runtime-ink); }
|
|
26
|
+
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.45 var(--font-ui); }
|
|
27
|
+
main { max-width: 1400px; margin: 0 auto; padding: 18px 20px 40px; }
|
|
28
|
+
header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 14px; }
|
|
29
|
+
h1 { font-size: 20px; margin: 0; font-weight: 650; letter-spacing: 0.01em; }
|
|
30
|
+
h1 small { font-weight: 450; color: var(--muted); font-size: 14px; margin-left: 6px; }
|
|
31
|
+
.t-theme { margin-left: auto; }
|
|
32
|
+
ol.t-steps { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; flex-wrap: wrap; }
|
|
33
|
+
.t-step { display: flex; align-items: center; gap: 7px; padding: 5px 12px 5px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-box); color: var(--muted); font-size: 14px; cursor: default; }
|
|
34
|
+
.t-step b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font: 600 12px var(--font-mono); background: var(--well); color: var(--muted); }
|
|
35
|
+
.t-step.ran { color: var(--fg); cursor: pointer; }
|
|
36
|
+
.t-step.ran b { background: color-mix(in srgb, var(--managed) 35%, var(--well)); color: var(--fg); }
|
|
37
|
+
.t-step.shown { border-color: var(--managed); background: var(--active); }
|
|
38
|
+
.t-step.next { border-style: dashed; color: var(--fg); }
|
|
39
|
+
.t-lead { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 24rem); gap: 14px 20px; background: var(--surface-pane-a); border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
|
|
40
|
+
.t-lead h2 { margin: 0 0 4px; font-size: 17px; }
|
|
41
|
+
.t-lead p { margin: 0 0 6px; }
|
|
42
|
+
.t-facts { color: var(--fg); font-weight: 550; }
|
|
43
|
+
.t-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; align-content: start; font-size: 13.5px; }
|
|
44
|
+
.t-legend li { display: grid; grid-template-columns: 16px auto; gap: 2px 8px; align-items: center; }
|
|
45
|
+
.t-legend span { color: var(--muted); grid-column: 2; font-size: 12.5px; }
|
|
46
|
+
.t-next { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 14px; padding: 10px 14px; border: 1px dashed var(--line); border-radius: 8px; background: var(--surface-box); }
|
|
47
|
+
.t-next[hidden], .t-notes[hidden] { display: none; }
|
|
48
|
+
.t-next code { font: 13.5px var(--font-mono); background: var(--well); padding: 4px 8px; border-radius: 5px; overflow-wrap: anywhere; }
|
|
49
|
+
.t-next .t-why { color: var(--muted); font-size: 13px; flex-basis: 100%; }
|
|
50
|
+
button.t-copy { font: 13px var(--font-ui); color: var(--fg); background: var(--active); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 4px 10px; cursor: pointer; }
|
|
51
|
+
.t-stage { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 14px; align-items: start; }
|
|
52
|
+
.t-box { background: var(--surface-pane-b); border: 1px solid var(--rule); border-radius: 10px; padding: 10px 10px 12px; }
|
|
53
|
+
.t-box.stock { border-style: dashed; }
|
|
54
|
+
.t-box.spawned { border-color: color-mix(in srgb, var(--managed) 70%, var(--rule)); }
|
|
55
|
+
.t-box-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 0 2px 8px; }
|
|
56
|
+
.t-box-head h3 { margin: 0; font-size: 15.5px; font: 600 15px var(--font-mono); }
|
|
57
|
+
.t-box-head span { color: var(--muted); font-size: 12.5px; }
|
|
58
|
+
.t-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.6rem, 1fr)); gap: 7px; }
|
|
59
|
+
.t-card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px 6px; min-width: 0; }
|
|
60
|
+
.t-card .k { font: 11.5px var(--font-mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
61
|
+
.t-card .n { font: 600 13.5px var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 1px 0 4px; }
|
|
62
|
+
.t-card .m { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
|
|
63
|
+
.t-card .m svg { flex: none; }
|
|
64
|
+
.t-card .m.solid { color: var(--managed); }
|
|
65
|
+
.t-card .m .w { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
|
|
66
|
+
.t-card .news { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
67
|
+
.t-card .news.drifted { color: var(--foreign); }
|
|
68
|
+
.t-card.moved { border-color: color-mix(in srgb, var(--managed) 55%, var(--line)); }
|
|
69
|
+
.t-empty { color: var(--muted); padding: 30px 0; }
|
|
70
|
+
.t-notes { color: var(--foreign); font-size: 13px; margin-top: 10px; }
|
|
71
|
+
.t-foot { color: var(--muted); font-size: 12.5px; margin-top: 18px; }
|
|
72
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
73
|
+
.t-box.spawning { animation: t-spawn 700ms cubic-bezier(.2,.7,.2,1) both; }
|
|
74
|
+
@keyframes t-spawn { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
|
|
75
|
+
}
|
|
76
|
+
@media (max-width: 720px) {
|
|
77
|
+
main { padding: 12px 12px 30px; }
|
|
78
|
+
.t-lead { grid-template-columns: 1fr; padding: 12px; }
|
|
79
|
+
.t-theme { margin-left: 0; }
|
|
80
|
+
.t-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
81
|
+
}
|
|
82
|
+
</style>
|
|
83
|
+
</head>
|
|
84
|
+
<body>
|
|
85
|
+
<main>
|
|
86
|
+
<header>
|
|
87
|
+
<h1>Terralith <small>behold demo terralith</small></h1>
|
|
88
|
+
<ol class="t-steps" id="t-steps" aria-label="Phases"></ol>
|
|
89
|
+
<div class="t-theme" id="t-theme"></div>
|
|
90
|
+
</header>
|
|
91
|
+
<section class="t-lead" id="t-lead" aria-live="polite"></section>
|
|
92
|
+
<section class="t-next" id="t-next" hidden></section>
|
|
93
|
+
<section class="t-stage" id="t-stage"></section>
|
|
94
|
+
<div class="t-notes" id="t-notes" hidden></div>
|
|
95
|
+
<p class="t-foot">The scripts save choudoufu's own documents under <code>snapshots/</code>, and each phase is drawn from them.</p>
|
|
96
|
+
</main>
|
|
97
|
+
<script type="module">
|
|
98
|
+
import { initTheme, mountThemePicker, KIOSK_THEME } from "/theme.js";
|
|
99
|
+
import { startTerralith } from "/terralith.js";
|
|
100
|
+
initTheme(KIOSK_THEME);
|
|
101
|
+
mountThemePicker(document.getElementById("t-theme"));
|
|
102
|
+
startTerralith(document);
|
|
103
|
+
</script>
|
|
104
|
+
</body>
|
|
105
|
+
</html>
|