-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
156 lines (144 loc) · 5.4 KB
/
Copy pathscript.js
File metadata and controls
156 lines (144 loc) · 5.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
document.documentElement.classList.add("js");
/* Pipeline data for the interactive switcher */
const pipelineData = {
"full-with-deep-audit": {
kicker: "7 phases",
title: "Full with deep audit",
description:
"Complete analysis with a two-pass defect scan. An early mechanical sweep catches surface-level issues; a later semantic pass re-examines defects with full contracts and protocols context before reimplementation planning.",
phases: [
"Architecture",
"Defect scan (mechanical)",
"Contracts",
"Protocols",
"Defect scan (semantic)",
"Porting",
"Reimplementation spec",
],
note: "The default pipeline. Best when you need the deepest defect analysis grounded in full behavioral understanding.",
},
"full-with-audit": {
kicker: "6 phases",
title: "Full with audit",
description:
"Complete reverse-engineering with a single defect scan phase before contracts, protocols, porting, and reimplementation planning.",
phases: [
"Architecture",
"Defect scan",
"Contracts",
"Protocols",
"Porting",
"Reimplementation spec",
],
note: "Best when the codebase has mostly mechanical defects and you do not need a second, context-grounded defect pass.",
},
full: {
kicker: "5 phases",
title: "Full",
description:
"A full understanding and reimplementation workflow without a dedicated defect-scan phase.",
phases: ["Architecture", "Contracts", "Protocols", "Porting", "Reimplementation spec"],
note: "A good fit when porting matters more than auditing existing bugs.",
},
"defect-scan": {
kicker: "2 phases",
title: "Defect scan",
description:
"A maintenance-oriented pass that maps the system and then hunts for correctness, reliability, security, and environment defects.",
phases: ["Architecture", "Defect scan"],
note: "Use this when the goal is triage and cleanup rather than a full rewrite plan.",
},
lite: {
kicker: "3 phases",
title: "Lite",
description:
"A focused behavior-recovery workflow for understanding how a system works without producing the porting bundle.",
phases: ["Architecture", "Contracts", "Protocols"],
note: "The fastest option that still leaves you with durable product and protocol knowledge.",
},
"architecture-only": {
kicker: "1 phase",
title: "Architecture only",
description:
"A quick structural pass that documents system intent, layers, public surfaces, and runtime shape.",
phases: ["Architecture"],
note: "Ideal as a low-cost first pass when you only need to orient yourself.",
},
synthesis: {
kicker: "4 phases · forward flow",
title: "Synthesis",
description:
"Combines a product vision with explicitly confirmed, versioned library specifications to create an implementation-ready plan without losing provenance.",
phases: ["Vision capture", "Candidate proposal + human confirmation", "Specification merge", "Project plan"],
note: "Pi/MCP only. Runtime preflight refuses to merge or finalize until a human confirms at least one version-pinned input.",
},
};
function initPipelineSwitcher() {
const tabs = document.querySelectorAll(".pipeline-tab");
const kicker = document.querySelector("#pipeline-kicker");
const title = document.querySelector("#pipeline-title");
const description = document.querySelector("#pipeline-description");
const phases = document.querySelector("#pipeline-phases");
const note = document.querySelector("#pipeline-note");
if (!tabs.length || !kicker || !title) return;
function update(key) {
const data = pipelineData[key];
if (!data) return;
kicker.textContent = data.kicker;
title.textContent = data.title;
description.textContent = data.description;
if (phases) {
phases.innerHTML = data.phases.map(function (p) { return "<li>" + p + "</li>"; }).join("");
}
if (note) note.textContent = data.note;
tabs.forEach(function (tab) {
var isActive = tab.dataset.pipeline === key;
tab.classList.toggle("is-active", isActive);
tab.setAttribute("aria-selected", String(isActive));
});
}
tabs.forEach(function (tab) {
tab.addEventListener("click", function () {
update(tab.dataset.pipeline);
});
});
update("full-with-deep-audit");
}
function initCopyButtons() {
document.querySelectorAll(".copy-button").forEach(function (button) {
var originalLabel = button.textContent.trim();
button.addEventListener("click", function () {
var text = button.dataset.copy;
if (!text) return;
navigator.clipboard.writeText(text).then(function () {
button.textContent = "Copied";
setTimeout(function () {
button.textContent = originalLabel;
}, 1600);
}).catch(function () {
/* clipboard unavailable; silently ignore */
});
});
});
}
function initScrollReveal() {
var observer = new IntersectionObserver(
function (entries) {
entries.forEach(function (entry) {
if (entry.isIntersecting) {
entry.target.classList.add("is-visible");
observer.unobserve(entry.target);
}
});
},
{ threshold: 0.15 }
);
document.querySelectorAll("[data-reveal]").forEach(function (node) {
observer.observe(node);
});
}
document.addEventListener("DOMContentLoaded", function () {
initPipelineSwitcher();
initCopyButtons();
initScrollReveal();
});