Skip to content

Commit cb15489

Browse files
committed
chore: remove all development phase markers from code and tests
1 parent 457c41c commit cb15489

64 files changed

Lines changed: 187 additions & 211 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/hydraline/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
## 0.0.1
22

3-
- Initial package skeleton (Phase 0): pure-Dart core scaffolding, strict
4-
analysis, dependency-boundary enforcement (I1) and CI.
3+
- Initial package skeleton: pure-Dart core scaffolding, strict
4+
analysis, dependency-boundary enforcement and CI.

packages/hydraline/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,4 @@ Pure-Dart core of [Hydraline](../../README.md): the `DocumentNode` model, a
44
single-pass deterministic HTML serializer, contextual escaping/`SafeUrl`, SEO
55
metadata, JSON-LD, sitemap/robots and island/route manifests.
66

7-
No `package:flutter`, `dart:ui` or `dart:html` (invariant I1).
8-
9-
> Status: pre-MVP skeleton (Phase 0). Public API lands in Phase 1 — see
10-
> `specs/PHASE_1_PLAN.md`.
7+
No `package:flutter`, `dart:ui` or `dart:html`.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# hydraline example
22

3-
Runnable examples arrive with the public API in Phase 1
4-
(`specs/PHASE_1_PLAN.md`). This package currently exposes only skeleton scaffolding.
3+
Runnable examples arrive with the public API.
4+
This package currently exposes only skeleton scaffolding.

packages/hydraline/lib/hydraline.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
/// Hydraline core — pure-Dart document model, HTML serializer, escaping and SEO
22
/// artifacts.
33
///
4-
/// This package must not import `package:flutter/*`, `dart:ui` or `dart:html`
5-
/// (invariant I1); enforced by `melos run boundaries`.
4+
/// This package must not import `package:flutter/*`, `dart:ui` or `dart:html`.
65
library;
76

87
export 'src/assets/htmx_glue.dart' show htmxGlueJs;

packages/hydraline/lib/src/assets/vanilla_islands.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
/// Standalone vanilla-islands JavaScript bundle for level-1 interactivity
2-
/// (ARCHITECTURE.md §13; C-12).
1+
/// Standalone vanilla-islands JavaScript bundle for level-1 interactivity.
32
///
43
/// Enhances static HTML elements tagged with `data-island` attributes. Runs on
54
/// `DOMContentLoaded` and does not depend on Flutter or any other runtime.

packages/hydraline/lib/src/audit.dart

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// CLI audit: "what the crawler sees" (standalone) and the buffered↔chunked
2-
/// body-identity comparator (server-integration) (ARCHITECTURE.md §7; C-11).
2+
/// body-identity comparator (server-integration).
33
library;
44

55
import 'package:html/parser.dart' as html;
@@ -19,8 +19,8 @@ abstract final class Audit {
1919
static const int _titleMaxLength = 70;
2020
static const int _descriptionMaxLength = 160;
2121

22-
/// C-11(a) standalone: audits the raw HTML a crawler would see — title,
23-
/// meta description, Open Graph, canonical, headings and image alt (A1/A2).
22+
/// Standalone: audits the raw HTML a crawler would see — title,
23+
/// meta description, Open Graph, canonical, headings and image alt.
2424
static AuditReport auditHtml(String source) {
2525
final document = html.parse(source);
2626
final issues = <ValidationIssue>[];
@@ -31,7 +31,7 @@ abstract final class Audit {
3131
const ValidationIssue(
3232
severity: ValidationSeverity.error,
3333
code: 'title_missing',
34-
message: '<title> is missing or empty (SEO-1).',
34+
message: '<title> is missing or empty.',
3535
),
3636
);
3737
} else if (title.length > _titleMaxLength) {
@@ -52,7 +52,7 @@ abstract final class Audit {
5252
const ValidationIssue(
5353
severity: ValidationSeverity.warning,
5454
code: 'description_missing',
55-
message: 'meta description is missing (SEO-1).',
55+
message: 'meta description is missing.',
5656
),
5757
);
5858
} else if (description.length > _descriptionMaxLength) {
@@ -75,7 +75,7 @@ abstract final class Audit {
7575
const ValidationIssue(
7676
severity: ValidationSeverity.warning,
7777
code: 'og_missing',
78-
message: 'Open Graph og:title/og:image are recommended (SEO-2, A2).',
78+
message: 'Open Graph og:title/og:image are recommended.',
7979
),
8080
);
8181
}
@@ -85,7 +85,7 @@ abstract final class Audit {
8585
const ValidationIssue(
8686
severity: ValidationSeverity.warning,
8787
code: 'h1_missing',
88-
message: 'no <h1> found (SEO-11).',
88+
message: 'no <h1> found.',
8989
),
9090
);
9191
}
@@ -97,7 +97,7 @@ abstract final class Audit {
9797
const ValidationIssue(
9898
severity: ValidationSeverity.error,
9999
code: 'image_missing_alt',
100-
message: 'an <img> is missing alt text (SEO-11).',
100+
message: 'an <img> is missing alt text.',
101101
),
102102
);
103103
}
@@ -118,9 +118,9 @@ abstract final class Audit {
118118
return AuditReport(issues: issues, exitCode: _exitCode(issues));
119119
}
120120

121-
/// C-11(b) server-integration comparator (A8/I3): the document body served
122-
/// buffered (to bots) must be byte-identical to the concatenation of the
123-
/// streamed chunks (to users).
121+
/// Server-integration comparator: the document body served buffered (to bots)
122+
/// must be byte-identical to the concatenation of the streamed chunks (to
123+
/// users).
124124
static AuditReport compareBodies(String buffered, List<String> chunks) {
125125
final concatenated = chunks.join();
126126
if (buffered == concatenated) {
@@ -131,8 +131,7 @@ abstract final class Audit {
131131
severity: ValidationSeverity.error,
132132
code: 'body_mismatch',
133133
message:
134-
'buffered body differs from concatenated chunks — cloaking risk '
135-
'(I3/A8).',
134+
'buffered body differs from concatenated chunks — cloaking risk.',
136135
),
137136
];
138137
return AuditReport(issues: issues, exitCode: _exitCode(issues));

packages/hydraline/lib/src/collector.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/// `SsgCollector`: pure-Dart collector for self-registering widgets (surface A)
2-
/// that seals into a [DocumentNode] tree (ARCHITECTURE.md §9; C-9, CO1-CO4).
2+
/// that seals into a [DocumentNode] tree.
33
library;
44

55
import 'document_node.dart';
66
import 'escaping.dart' show SafeUrl;
77
import 'island_manifest.dart' show IslandSpec;
88
import 'metadata.dart';
99

10-
/// Instance-scoped collector (CO1). Immutable after [seal] (CO4).
10+
/// Instance-scoped collector. Immutable after [seal].
1111
abstract interface class SsgCollector {
1212
factory SsgCollector(String route) = _SsgCollector;
1313

@@ -24,7 +24,7 @@ abstract interface class SsgCollector {
2424
void addNode(DocumentNode node, {String? key});
2525
void addMeta(SeoMeta meta);
2626

27-
/// Finalises: dedup by key, N5 (no cycles), immutable result.
27+
/// Finalises: dedup by key, no cycles, immutable result.
2828
DocumentNode seal();
2929
}
3030

@@ -39,7 +39,7 @@ class _SsgCollector implements SsgCollector {
3939

4040
void _add(DocumentNode node, String? key) {
4141
if (_sealed != null) {
42-
return; // CO4
42+
return;
4343
}
4444
if (key != null) {
4545
if (_keys.contains(key)) {
@@ -81,7 +81,7 @@ class _SsgCollector implements SsgCollector {
8181
@override
8282
void addMeta(SeoMeta meta) {
8383
if (_sealed != null) {
84-
return; // CO4
84+
return;
8585
}
8686
_meta = meta;
8787
}

packages/hydraline/lib/src/document_node.dart

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
/// The `DocumentNode` tree (ARCHITECTURE.md §4).
1+
/// The `DocumentNode` tree.
22
///
33
/// The hierarchy is `sealed`, so the serializer walks it with an exhaustive
4-
/// `switch` (no external visitor). Invariants: N1 (immutable), N2 (text stored
5-
/// raw, escaped only on serialization), N3 (URL fields are always [SafeUrl]),
6-
/// N4 (deterministic), N5 (tree without cycles).
4+
/// `switch` (no external visitor). Invariants: immutable, text stored raw (escaped only on serialization),
5+
/// URL fields are always [SafeUrl], deterministic, tree without cycles.
76
library;
87

98
import 'escaping.dart' show SafeUrl;
@@ -12,7 +11,7 @@ import 'escaping.dart' show SafeUrl;
1211
sealed class DocumentNode {
1312
const DocumentNode();
1413

15-
/// Child nodes (empty for leaves). N5: no cycles.
14+
/// Child nodes (empty for leaves). No cycles.
1615
List<DocumentNode> get children;
1716
}
1817

@@ -25,7 +24,7 @@ final class DocumentRootNode extends DocumentNode {
2524
final HeadNode? head;
2625
final List<DocumentNode> body;
2726

28-
/// Optional `lang` for the `<html>` element (SEO-8).
27+
/// Optional `lang` for the `<html>` element.
2928
final String? lang;
3029

3130
@override
@@ -44,7 +43,7 @@ final class HeadNode extends DocumentNode {
4443
final class TitleNode extends DocumentNode {
4544
const TitleNode(this.text);
4645

47-
/// Raw title text; escaped only on serialization (N2/S2).
46+
/// Raw title text; escaped only on serialization.
4847
final String text;
4948

5049
@override
@@ -158,7 +157,7 @@ final class CodeNode extends DocumentNode {
158157
List<DocumentNode> get children => const [];
159158
}
160159

161-
/// A `<time>` element carrying an ISO-8601 `dateTime` (determinism, DS3).
160+
/// A `<time>` element carrying an ISO-8601 `dateTime`.
162161
final class TimeNode extends DocumentNode {
163162
const TimeNode({required this.dateTime, required this.children});
164163

@@ -246,7 +245,7 @@ enum IslandRenderMode { ssr, skeletonOnly }
246245
/// How island styles are scoped.
247246
enum IslandStyleMode { shadow, scoped }
248247

249-
/// Reserved placeholder size in px (anti-CLS, I8).
248+
/// Reserved placeholder size in px to prevent layout shift.
250249
final class IslandSize {
251250
const IslandSize({required this.width, required this.height});
252251

@@ -321,7 +320,7 @@ final class VanillaIslandNode extends DocumentNode {
321320

322321
// ── Unsafe HTML (opt-in, the only raw-HTML escape hatch) ─────────────────────
323322

324-
/// The only path for raw HTML (S3). The name intentionally contains "Unsafe".
323+
/// The only path for raw HTML. The name intentionally contains "Unsafe".
325324
/// Without a [sanitizer] the `SeoValidator` emits a warning.
326325
final class UnsafeHtmlNode extends DocumentNode {
327326
const UnsafeHtmlNode(this.rawHtml, {this.sanitizer});
@@ -337,7 +336,7 @@ final class UnsafeHtmlNode extends DocumentNode {
337336
List<DocumentNode> get children => const [];
338337
}
339338

340-
/// A `<script type="application/ld+json">` structured-data block (SEO-4).
339+
/// A `<script type="application/ld+json">` structured-data block.
341340
///
342341
/// This is the only `<script>` the serializer emits; its content is JSON data
343342
/// (not executable code) and is escaped to prevent `</script>` breakout.
@@ -352,7 +351,7 @@ final class JsonLdNode extends DocumentNode {
352351

353352
// ── Inline ───────────────────────────────────────────────────────────────────
354353

355-
/// Text content. Stored raw (N2); always escaped on serialization (S2).
354+
/// Text content. Stored raw; always escaped on serialization.
356355
final class TextNode extends DocumentNode {
357356
const TextNode(this.text);
358357

@@ -362,7 +361,7 @@ final class TextNode extends DocumentNode {
362361
List<DocumentNode> get children => const [];
363362
}
364363

365-
/// An anchor `<a href>`; `href` is always a [SafeUrl] (N3).
364+
/// An anchor `<a href>`; `href` is always a [SafeUrl].
366365
final class AnchorNode extends DocumentNode {
367366
const AnchorNode({required this.href, required this.children, this.rel});
368367

@@ -373,7 +372,7 @@ final class AnchorNode extends DocumentNode {
373372
final List<DocumentNode> children;
374373
}
375374

376-
/// An image `<img src alt>`; `src` is always a [SafeUrl] (N3).
375+
/// An image `<img src alt>`; `src` is always a [SafeUrl].
377376
final class ImageNode extends DocumentNode {
378377
const ImageNode({
379378
required this.src,

packages/hydraline/lib/src/escaping.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/// Contextual HTML escaping and URL sanitisation (ARCHITECTURE.md §5).
1+
/// Contextual HTML escaping and URL sanitisation.
22
///
3-
/// Invariants: S1 (scheme allowlist), S2 (mandatory escaping),
4-
/// S4 (0 XSS on fuzzing), S5 (CSP helper).
3+
/// Invariants: scheme allowlist, mandatory escaping,
4+
/// zero XSS on fuzzing, CSP helper.
55
library;
66

7-
/// Escapes text content: `&`, `<`, `>` become entities (S2).
7+
/// Escapes text content: `&`, `<`, `>` become entities.
88
///
99
/// Quotes are intentionally left untouched — text and attribute contexts use
1010
/// different escapers so they can never be confused (see [escapeHtmlAttribute]).
@@ -28,7 +28,7 @@ String escapeHtmlText(String input) {
2828
return buffer.toString();
2929
}
3030

31-
/// Escapes an attribute value: `&`, `<`, `>`, `"`, `'` become entities (S2).
31+
/// Escapes an attribute value: `&`, `<`, `>`, `"`, `'` become entities.
3232
String escapeHtmlAttribute(String input) {
3333
if (!input.contains(RegExp('[&<>"\']'))) {
3434
return input;
@@ -55,7 +55,7 @@ String escapeHtmlAttribute(String input) {
5555

5656
/// A URL that has passed scheme sanitisation. There is **no** public
5757
/// constructor: instances come only from [SafeUrl.parse]/[SafeUrl.tryParse],
58-
/// so a node can never be built with an unchecked URL (N3/S1).
58+
/// so a node can never be built with an unchecked URL.
5959
abstract interface class SafeUrl {
6060
/// The sanitised string value.
6161
String get value;
@@ -64,7 +64,7 @@ abstract interface class SafeUrl {
6464
///
6565
/// Allowlist: `http`, `https`, `mailto`, `tel` and relative URLs
6666
/// (`/`, `./`, `#`, `?`, bare paths). Blocked: everything else, including
67-
/// `javascript:`, `data:`, `vbscript:` (S1).
67+
/// `javascript:`, `data:`, `vbscript:`.
6868
static SafeUrl? tryParse(String raw) {
6969
final cleaned = raw.replaceAll(RegExp('[\u0000-\u001F\u007F]'), '').trim();
7070
final scheme = RegExp(r'^([a-zA-Z][a-zA-Z0-9+.\-]*):').firstMatch(cleaned);
@@ -103,7 +103,7 @@ final class _SafeUrl implements SafeUrl {
103103
String toString() => 'SafeUrl($value)';
104104
}
105105

106-
/// Thrown by [SafeUrl.parse] when a URL's scheme is not allowed (S1).
106+
/// Thrown by [SafeUrl.parse] when a URL's scheme is not allowed.
107107
class UnsafeUrlException implements Exception {
108108
const UnsafeUrlException(this.raw, this.reason);
109109

@@ -114,7 +114,7 @@ class UnsafeUrlException implements Exception {
114114
String toString() => 'UnsafeUrlException: $reason ($raw)';
115115
}
116116

117-
/// Helper for the recommended Content-Security-Policy (S5):
117+
/// Helper for the recommended Content-Security-Policy:
118118
/// `script-src 'self' 'wasm-unsafe-eval'` (no `unsafe-inline`; CanvasKit needs
119119
/// `wasm-unsafe-eval`).
120120
abstract final class Csp {

packages/hydraline/lib/src/html_serializer.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
/// Single-pass HTML serializer (ARCHITECTURE.md §6).
1+
/// Single-pass HTML serializer.
22
///
3-
/// Invariants: SER1 (single pass into a [StringSink], no intermediate tree),
4-
/// SER2 (deterministic, stable attribute order), SER3 (O(nodes + text), no
5-
/// quadratic concatenation), SER4 (`serialize == concat(serializeToStream)`),
6-
/// SER5 (line endings are always `\n`).
3+
/// Invariants: single pass into a [StringSink] with no intermediate tree,
4+
/// deterministic with stable attribute order, O(nodes + text) with no quadratic
5+
/// concatenation, `serialize == concat(serializeToStream)`, line endings are
6+
/// always `\n`.
77
library;
88

99
import 'dart:convert';
@@ -24,10 +24,10 @@ abstract interface class HtmlSerializer {
2424
/// Default implementation.
2525
const factory HtmlSerializer([SerializerOptions options]) = _HtmlSerializer;
2626

27-
/// Buffered HTML (bots / SSG file). SER1/SER2.
27+
/// Buffered HTML (bots / SSG file).
2828
String serialize(DocumentNode root);
2929

30-
/// Progressive in-order stream (SSR). SER4: equals [serialize] concatenated.
30+
/// Progressive in-order stream (SSR). Equals [serialize] concatenated.
3131
Stream<String> serializeToStream(DocumentNode root);
3232

3333
/// A fragment without `<html>/<head>` (HTMX responses).
@@ -259,7 +259,7 @@ class _HtmlSerializer implements HtmlSerializer {
259259
}
260260

261261
/// Encodes JSON-LD, escaping `<`, `>` and `&` as `\uXXXX` so the payload can
262-
/// never break out of the surrounding `<script>` element (S2/S4).
262+
/// never break out of the surrounding `<script>` element.
263263
String _encodeJsonLd(Map<String, Object?> json) => jsonEncode(json)
264264
.replaceAll('<', r'\u003c')
265265
.replaceAll('>', r'\u003e')

0 commit comments

Comments
 (0)