mcp-web-validator 1.3.51 → 1.3.54
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/CHANGELOG.md +55 -0
- package/README.md +64 -4
- package/dist/audit-history.d.ts +9 -0
- package/dist/audit-history.js +27 -0
- package/dist/audit-history.js.map +1 -1
- package/dist/index.js +2508 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp-bounds.js +8 -3
- package/dist/mcp-bounds.js.map +1 -1
- package/dist/modules/browser-ux/lighthouse-lab-probe.d.ts +21 -0
- package/dist/modules/browser-ux/lighthouse-lab-probe.js +190 -0
- package/dist/modules/browser-ux/lighthouse-lab-probe.js.map +1 -0
- package/dist/modules/browser-ux/lighthouse-lab.d.ts +61 -0
- package/dist/modules/browser-ux/lighthouse-lab.js +98 -0
- package/dist/modules/browser-ux/lighthouse-lab.js.map +1 -0
- package/dist/modules/browser-ux/media-diagnostics.d.ts +41 -0
- package/dist/modules/browser-ux/media-diagnostics.js +183 -0
- package/dist/modules/browser-ux/media-diagnostics.js.map +1 -0
- package/dist/modules/browser-ux/raw-rendered-diff.d.ts +70 -0
- package/dist/modules/browser-ux/raw-rendered-diff.js +262 -0
- package/dist/modules/browser-ux/raw-rendered-diff.js.map +1 -0
- package/dist/modules/browser-ux/raw-rendered-probe.d.ts +17 -0
- package/dist/modules/browser-ux/raw-rendered-probe.js +163 -0
- package/dist/modules/browser-ux/raw-rendered-probe.js.map +1 -0
- package/dist/modules/browser-ux/resource-failures-probe.d.ts +11 -0
- package/dist/modules/browser-ux/resource-failures-probe.js +231 -0
- package/dist/modules/browser-ux/resource-failures-probe.js.map +1 -0
- package/dist/modules/browser-ux/resource-failures.d.ts +79 -0
- package/dist/modules/browser-ux/resource-failures.js +178 -0
- package/dist/modules/browser-ux/resource-failures.js.map +1 -0
- package/dist/modules/browser-ux/viewport-parity-probe.d.ts +5 -0
- package/dist/modules/browser-ux/viewport-parity-probe.js +316 -0
- package/dist/modules/browser-ux/viewport-parity-probe.js.map +1 -0
- package/dist/modules/browser-ux/viewport-parity.d.ts +112 -0
- package/dist/modules/browser-ux/viewport-parity.js +224 -0
- package/dist/modules/browser-ux/viewport-parity.js.map +1 -0
- package/dist/modules/browser-ux/wcag-interactions.d.ts +95 -0
- package/dist/modules/browser-ux/wcag-interactions.js +360 -0
- package/dist/modules/browser-ux/wcag-interactions.js.map +1 -0
- package/dist/modules/change-regression/availability-history-store.d.ts +18 -0
- package/dist/modules/change-regression/availability-history-store.js +168 -0
- package/dist/modules/change-regression/availability-history-store.js.map +1 -0
- package/dist/modules/change-regression/crawler-log-correlation.d.ts +111 -0
- package/dist/modules/change-regression/crawler-log-correlation.js +374 -0
- package/dist/modules/change-regression/crawler-log-correlation.js.map +1 -0
- package/dist/modules/change-regression/google-common-crawler-ip.d.ts +15 -0
- package/dist/modules/change-regression/google-common-crawler-ip.js +129 -0
- package/dist/modules/change-regression/google-common-crawler-ip.js.map +1 -0
- package/dist/modules/change-regression/historical-comparisons.d.ts +120 -0
- package/dist/modules/change-regression/historical-comparisons.js +330 -0
- package/dist/modules/change-regression/historical-comparisons.js.map +1 -0
- package/dist/modules/change-regression/production-change-comparison.d.ts +68 -0
- package/dist/modules/change-regression/production-change-comparison.js +214 -0
- package/dist/modules/change-regression/production-change-comparison.js.map +1 -0
- package/dist/modules/change-regression/regression-alerts.d.ts +73 -0
- package/dist/modules/change-regression/regression-alerts.js +183 -0
- package/dist/modules/change-regression/regression-alerts.js.map +1 -0
- package/dist/modules/change-regression/strict-observation-time.d.ts +7 -0
- package/dist/modules/change-regression/strict-observation-time.js +31 -0
- package/dist/modules/change-regression/strict-observation-time.js.map +1 -0
- package/dist/modules/content-schema/citation-methodology-consistency.d.ts +108 -0
- package/dist/modules/content-schema/citation-methodology-consistency.js +360 -0
- package/dist/modules/content-schema/citation-methodology-consistency.js.map +1 -0
- package/dist/modules/content-schema/competitor-intent-comparison.d.ts +74 -0
- package/dist/modules/content-schema/competitor-intent-comparison.js +185 -0
- package/dist/modules/content-schema/competitor-intent-comparison.js.map +1 -0
- package/dist/modules/content-schema/empty-boilerplate-content.d.ts +36 -0
- package/dist/modules/content-schema/empty-boilerplate-content.js +225 -0
- package/dist/modules/content-schema/empty-boilerplate-content.js.map +1 -0
- package/dist/modules/content-schema/extract-citation-methodology.d.ts +6 -0
- package/dist/modules/content-schema/extract-citation-methodology.js +201 -0
- package/dist/modules/content-schema/extract-citation-methodology.js.map +1 -0
- package/dist/modules/content-schema/extract-competitor-intent.d.ts +2 -0
- package/dist/modules/content-schema/extract-competitor-intent.js +140 -0
- package/dist/modules/content-schema/extract-competitor-intent.js.map +1 -0
- package/dist/modules/content-schema/extract-main-content.d.ts +6 -0
- package/dist/modules/content-schema/extract-main-content.js +33 -0
- package/dist/modules/content-schema/extract-main-content.js.map +1 -0
- package/dist/modules/content-schema/extract-metadata-consistency.d.ts +3 -0
- package/dist/modules/content-schema/extract-metadata-consistency.js +62 -0
- package/dist/modules/content-schema/extract-metadata-consistency.js.map +1 -0
- package/dist/modules/content-schema/extract-product-claims.d.ts +3 -0
- package/dist/modules/content-schema/extract-product-claims.js +58 -0
- package/dist/modules/content-schema/extract-product-claims.js.map +1 -0
- package/dist/modules/content-schema/extract-structured-data.d.ts +3 -0
- package/dist/modules/content-schema/extract-structured-data.js +25 -0
- package/dist/modules/content-schema/extract-structured-data.js.map +1 -0
- package/dist/modules/content-schema/metadata-consistency.d.ts +66 -0
- package/dist/modules/content-schema/metadata-consistency.js +282 -0
- package/dist/modules/content-schema/metadata-consistency.js.map +1 -0
- package/dist/modules/content-schema/product-claims.d.ts +73 -0
- package/dist/modules/content-schema/product-claims.js +195 -0
- package/dist/modules/content-schema/product-claims.js.map +1 -0
- package/dist/modules/content-schema/same-language-duplicates.d.ts +52 -0
- package/dist/modules/content-schema/same-language-duplicates.js +158 -0
- package/dist/modules/content-schema/same-language-duplicates.js.map +1 -0
- package/dist/modules/content-schema/structured-data-validation.d.ts +37 -0
- package/dist/modules/content-schema/structured-data-validation.js +385 -0
- package/dist/modules/content-schema/structured-data-validation.js.map +1 -0
- package/dist/modules/external-metrics/crux-field-probe.d.ts +10 -0
- package/dist/modules/external-metrics/crux-field-probe.js +113 -0
- package/dist/modules/external-metrics/crux-field-probe.js.map +1 -0
- package/dist/modules/external-metrics/crux-field.d.ts +61 -0
- package/dist/modules/external-metrics/crux-field.js +231 -0
- package/dist/modules/external-metrics/crux-field.js.map +1 -0
- package/dist/modules/http-crawl/availability-observations.d.ts +68 -0
- package/dist/modules/http-crawl/availability-observations.js +206 -0
- package/dist/modules/http-crawl/availability-observations.js.map +1 -0
- package/dist/modules/http-crawl/availability-probe.d.ts +8 -0
- package/dist/modules/http-crawl/availability-probe.js +46 -0
- package/dist/modules/http-crawl/availability-probe.js.map +1 -0
- package/dist/modules/http-crawl/crawler-access-probe.d.ts +6 -0
- package/dist/modules/http-crawl/crawler-access-probe.js +79 -0
- package/dist/modules/http-crawl/crawler-access-probe.js.map +1 -0
- package/dist/modules/http-crawl/crawler-access.d.ts +75 -0
- package/dist/modules/http-crawl/crawler-access.js +404 -0
- package/dist/modules/http-crawl/crawler-access.js.map +1 -0
- package/dist/modules/http-crawl/http-delivery-probe.d.ts +3 -0
- package/dist/modules/http-crawl/http-delivery-probe.js +44 -0
- package/dist/modules/http-crawl/http-delivery-probe.js.map +1 -0
- package/dist/modules/http-crawl/http-delivery.d.ts +64 -0
- package/dist/modules/http-crawl/http-delivery.js +273 -0
- package/dist/modules/http-crawl/http-delivery.js.map +1 -0
- package/dist/modules/http-crawl/https-security.d.ts +84 -0
- package/dist/modules/http-crawl/https-security.js +441 -0
- package/dist/modules/http-crawl/https-security.js.map +1 -0
- package/dist/modules/http-crawl/non-html-directives.d.ts +74 -0
- package/dist/modules/http-crawl/non-html-directives.js +353 -0
- package/dist/modules/http-crawl/non-html-directives.js.map +1 -0
- package/dist/modules/http-crawl/redirect-canonical-chains.d.ts +80 -0
- package/dist/modules/http-crawl/redirect-canonical-chains.js +459 -0
- package/dist/modules/http-crawl/redirect-canonical-chains.js.map +1 -0
- package/dist/modules/http-crawl/redirect-canonical-probe.d.ts +6 -0
- package/dist/modules/http-crawl/redirect-canonical-probe.js +83 -0
- package/dist/modules/http-crawl/redirect-canonical-probe.js.map +1 -0
- package/dist/modules/http-crawl/sitemap-inventory-probe.d.ts +8 -0
- package/dist/modules/http-crawl/sitemap-inventory-probe.js +155 -0
- package/dist/modules/http-crawl/sitemap-inventory-probe.js.map +1 -0
- package/dist/modules/http-crawl/sitemap-inventory.d.ts +107 -0
- package/dist/modules/http-crawl/sitemap-inventory.js +557 -0
- package/dist/modules/http-crawl/sitemap-inventory.js.map +1 -0
- package/dist/modules/http-crawl/url-variants.d.ts +86 -0
- package/dist/modules/http-crawl/url-variants.js +379 -0
- package/dist/modules/http-crawl/url-variants.js.map +1 -0
- package/dist/modules/site-architecture/extract-internal-links.d.ts +3 -0
- package/dist/modules/site-architecture/extract-internal-links.js +88 -0
- package/dist/modules/site-architecture/extract-internal-links.js.map +1 -0
- package/dist/modules/site-architecture/extract-multilingual-page.d.ts +2 -0
- package/dist/modules/site-architecture/extract-multilingual-page.js +29 -0
- package/dist/modules/site-architecture/extract-multilingual-page.js.map +1 -0
- package/dist/modules/site-architecture/internal-link-graph-probe.d.ts +7 -0
- package/dist/modules/site-architecture/internal-link-graph-probe.js +116 -0
- package/dist/modules/site-architecture/internal-link-graph-probe.js.map +1 -0
- package/dist/modules/site-architecture/internal-link-graph.d.ts +113 -0
- package/dist/modules/site-architecture/internal-link-graph.js +414 -0
- package/dist/modules/site-architecture/internal-link-graph.js.map +1 -0
- package/dist/modules/site-architecture/internal-link-quality.d.ts +77 -0
- package/dist/modules/site-architecture/internal-link-quality.js +260 -0
- package/dist/modules/site-architecture/internal-link-quality.js.map +1 -0
- package/dist/modules/site-architecture/multilingual-clusters.d.ts +82 -0
- package/dist/modules/site-architecture/multilingual-clusters.js +363 -0
- package/dist/modules/site-architecture/multilingual-clusters.js.map +1 -0
- package/dist/network.d.ts +4 -0
- package/dist/network.js +25 -8
- package/dist/network.js.map +1 -1
- package/dist/presentation.d.ts +53 -0
- package/dist/presentation.js +526 -0
- package/dist/presentation.js.map +1 -1
- package/dist/screenshot.d.ts +2 -1
- package/dist/screenshot.js +4 -2
- package/dist/screenshot.js.map +1 -1
- package/dist/seo-auditor.js +16 -6
- package/dist/seo-auditor.js.map +1 -1
- package/package.json +7 -4
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
export const MONITOR_RULES = [
|
|
2
|
+
"regressed_pages", "net_error_increase", "net_warning_increase",
|
|
3
|
+
"coverage_loss", "sitemap_drift",
|
|
4
|
+
];
|
|
5
|
+
export const MONITOR_DECISIONS = [
|
|
6
|
+
"preview_candidate", "review_only", "suppressed",
|
|
7
|
+
"below_threshold", "disabled",
|
|
8
|
+
];
|
|
9
|
+
export const MONITOR_STATUSES = [
|
|
10
|
+
"preview_ready", "review_only", "no_candidate", "insufficient_evidence",
|
|
11
|
+
];
|
|
12
|
+
export const MONITOR_REASON_CODES = [
|
|
13
|
+
"threshold_met", "threshold_not_met", "rule_disabled",
|
|
14
|
+
"incomplete_latest_pair", "ambiguous_version_order",
|
|
15
|
+
"insufficient_streak_history", "regression_streak_not_met",
|
|
16
|
+
"observed_validator_coverage_loss", "observed_sitemap_drift",
|
|
17
|
+
"not_enough_observed_comparisons",
|
|
18
|
+
];
|
|
19
|
+
export const DEFAULT_MONITOR_POLICY = Object.freeze({
|
|
20
|
+
min_regressed_pages: 1,
|
|
21
|
+
min_net_error_increase: 1,
|
|
22
|
+
min_net_warning_increase: 1,
|
|
23
|
+
min_coverage_lost_pages: 1,
|
|
24
|
+
consecutive_regressing_steps: 1,
|
|
25
|
+
review_coverage_loss: true,
|
|
26
|
+
review_sitemap_drift: true,
|
|
27
|
+
});
|
|
28
|
+
function intRange(value, min, max) {
|
|
29
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= min && value <= max;
|
|
30
|
+
}
|
|
31
|
+
/** Enforce a small, explicit policy with no arbitrary scripts, URLs or destinations. */
|
|
32
|
+
export function normalizeMonitorPolicy(input) {
|
|
33
|
+
if (input !== undefined && (input === null || typeof input !== "object" ||
|
|
34
|
+
Array.isArray(input))) {
|
|
35
|
+
throw new Error("Monitoring policy must be a bounded object");
|
|
36
|
+
}
|
|
37
|
+
const provided = input ?? {};
|
|
38
|
+
const allowed = new Set(Object.keys(DEFAULT_MONITOR_POLICY));
|
|
39
|
+
if (Object.keys(provided).some((key) => !allowed.has(key))) {
|
|
40
|
+
throw new Error("Monitoring policy contains unsupported options");
|
|
41
|
+
}
|
|
42
|
+
const merged = { ...DEFAULT_MONITOR_POLICY, ...provided };
|
|
43
|
+
if (!intRange(merged.min_regressed_pages, 1, 8) ||
|
|
44
|
+
!intRange(merged.min_net_error_increase, 1, 10_000) ||
|
|
45
|
+
!intRange(merged.min_net_warning_increase, 1, 10_000) ||
|
|
46
|
+
!intRange(merged.min_coverage_lost_pages, 1, 8) ||
|
|
47
|
+
!intRange(merged.consecutive_regressing_steps, 1, 4) ||
|
|
48
|
+
typeof merged.review_coverage_loss !== "boolean" ||
|
|
49
|
+
typeof merged.review_sitemap_drift !== "boolean") {
|
|
50
|
+
throw new Error("Monitoring thresholds or review toggles out of allowed range");
|
|
51
|
+
}
|
|
52
|
+
return merged;
|
|
53
|
+
}
|
|
54
|
+
export function emptyMonitorPreview(source, policy = { ...DEFAULT_MONITOR_POLICY }) {
|
|
55
|
+
return {
|
|
56
|
+
scope: "manual_sampled_regression_alert_preview_only",
|
|
57
|
+
source, status: "insufficient_evidence",
|
|
58
|
+
dry_run: true, manually_invoked: true,
|
|
59
|
+
scheduler_enabled: false, delivery_enabled: false,
|
|
60
|
+
notifications_sent: 0, external_integrations_used: false,
|
|
61
|
+
latest_baseline_version: 0, latest_current_version: 0,
|
|
62
|
+
latest_comparability: "not_comparable",
|
|
63
|
+
latest_compared_pages: 0, latest_completed_pairs: 0,
|
|
64
|
+
candidate_count: 0, review_only_count: 0, suppressed_count: 0,
|
|
65
|
+
coverage_limited: true, policy, rules: [],
|
|
66
|
+
limitations: ["No alerts or schedules were started; bounded historical source evidence was not sufficient for a monitoring preview."],
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function validateHistoricalReview(review) {
|
|
70
|
+
if (!review || review.scope !== "historical_compact_audit_versions_only" ||
|
|
71
|
+
!["local_saved_ids", "caller_supplied_snapshots"].includes(review.source) ||
|
|
72
|
+
!Number.isSafeInteger(review.versions_compared) ||
|
|
73
|
+
review.versions_compared < 2 || review.versions_compared > 10 ||
|
|
74
|
+
!Array.isArray(review.consecutive_changes) ||
|
|
75
|
+
review.consecutive_changes.length !== review.versions_compared - 1) {
|
|
76
|
+
throw new Error("Requires a bounded, validated P2-01 historical review");
|
|
77
|
+
}
|
|
78
|
+
const latest = review.consecutive_changes.at(-1);
|
|
79
|
+
if (!latest || latest.baseline_version !== review.versions_compared - 1 ||
|
|
80
|
+
latest.current_version !== review.versions_compared ||
|
|
81
|
+
!["comparable_sample", "partial", "not_comparable"].includes(latest.status) ||
|
|
82
|
+
![latest.shared_pages, latest.completely_checked_pairs, latest.regressed_pages,
|
|
83
|
+
latest.coverage_lost_pages, latest.errors_delta_checked,
|
|
84
|
+
latest.warnings_delta_checked].every((n) => Number.isSafeInteger(n))) {
|
|
85
|
+
throw new Error("Historical latest transition lacks validated evidence");
|
|
86
|
+
}
|
|
87
|
+
return latest;
|
|
88
|
+
}
|
|
89
|
+
const TEXTS = {
|
|
90
|
+
regressed_pages: "The latest comparable selected-page sample has enough pages with increased observed errors or warnings to preview a regression review.",
|
|
91
|
+
net_error_increase: "The latest fully checked matched-page sample has a positive net increase in observed error counts above the configured threshold.",
|
|
92
|
+
net_warning_increase: "The latest fully checked matched-page sample has a positive net increase in observed warning counts above the configured threshold.",
|
|
93
|
+
coverage_loss: "A formerly completed validator observation is now incomplete; review check availability separately from actual page quality.",
|
|
94
|
+
sitemap_drift: "The sampled site discovery fingerprint changed; verify selection and crawl coverage before interpreting historical trends.",
|
|
95
|
+
};
|
|
96
|
+
const BLOCKED = "Preview suppressed because the latest sample is incomplete/noncomparable or the source version order is ambiguous.";
|
|
97
|
+
const DISABLED = "This review rule is disabled for this manual evaluation only.";
|
|
98
|
+
const CLEAR = "The observed value did not meet this rule's configured preview threshold.";
|
|
99
|
+
const STREAK = "The configured number of consecutive comparable regression transitions was not established.";
|
|
100
|
+
export function previewRegressionAlerts(review, input) {
|
|
101
|
+
const policy = normalizeMonitorPolicy(input);
|
|
102
|
+
const step = validateHistoricalReview(review);
|
|
103
|
+
const completeLatest = step.status === "comparable_sample" &&
|
|
104
|
+
step.shared_pages > 0 &&
|
|
105
|
+
step.completely_checked_pairs === step.shared_pages &&
|
|
106
|
+
!review.time_order_ambiguous;
|
|
107
|
+
const result = emptyMonitorPreview(review.source, policy);
|
|
108
|
+
result.latest_baseline_version = step.baseline_version;
|
|
109
|
+
result.latest_current_version = step.current_version;
|
|
110
|
+
result.latest_comparability = step.status;
|
|
111
|
+
result.latest_compared_pages = step.shared_pages;
|
|
112
|
+
result.latest_completed_pairs = step.completely_checked_pairs;
|
|
113
|
+
result.limitations = [
|
|
114
|
+
"Manual dry-run only: no scheduled jobs, live website checks, email/webhook delivery, external data integrations or notifications of any kind.",
|
|
115
|
+
"Defect alert candidates are emitted only for the latest fully comparable selected-page pair with unambiguous timestamp order, never the full site or Google ranking/traffic behavior.",
|
|
116
|
+
"A coverage-loss or changed-sitemap rule produces a review-only observation, not a validated SEO defect or notification.",
|
|
117
|
+
"A threshold or regression streak concerns only already-observed completed checks; source snapshots and message content are never returned.",
|
|
118
|
+
];
|
|
119
|
+
const add = (rule, observed, threshold, decision, reason, message) => {
|
|
120
|
+
result.rules.push({
|
|
121
|
+
rule, decision, reason_code: reason,
|
|
122
|
+
latest_observed_value: observed,
|
|
123
|
+
threshold, review_required: decision === "preview_candidate" || decision === "review_only",
|
|
124
|
+
message,
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
const thresholdRules = [
|
|
128
|
+
{ rule: "regressed_pages", observed: step.regressed_pages, threshold: policy.min_regressed_pages },
|
|
129
|
+
{ rule: "net_error_increase", observed: step.errors_delta_checked, threshold: policy.min_net_error_increase },
|
|
130
|
+
{ rule: "net_warning_increase", observed: step.warnings_delta_checked, threshold: policy.min_net_warning_increase },
|
|
131
|
+
];
|
|
132
|
+
for (const rule of thresholdRules) {
|
|
133
|
+
if (!completeLatest) {
|
|
134
|
+
add(rule.rule, rule.observed, rule.threshold, "suppressed", review.time_order_ambiguous ? "ambiguous_version_order" : "incomplete_latest_pair", BLOCKED);
|
|
135
|
+
}
|
|
136
|
+
else if (rule.observed < rule.threshold) {
|
|
137
|
+
add(rule.rule, rule.observed, rule.threshold, "below_threshold", "threshold_not_met", CLEAR);
|
|
138
|
+
}
|
|
139
|
+
else if (rule.rule === "regressed_pages" &&
|
|
140
|
+
policy.consecutive_regressing_steps > 1) {
|
|
141
|
+
const required = policy.consecutive_regressing_steps;
|
|
142
|
+
const recent = review.consecutive_changes.slice(-required);
|
|
143
|
+
const tooShort = recent.length < required;
|
|
144
|
+
const validStreak = !tooShort && recent.every((s) => s.status === "comparable_sample" &&
|
|
145
|
+
s.regressed_pages >= policy.min_regressed_pages);
|
|
146
|
+
if (validStreak) {
|
|
147
|
+
add(rule.rule, rule.observed, rule.threshold, "preview_candidate", "threshold_met", TEXTS[rule.rule]);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
add(rule.rule, rule.observed, rule.threshold, "suppressed", tooShort ? "insufficient_streak_history" : "regression_streak_not_met", STREAK);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
add(rule.rule, rule.observed, rule.threshold, "preview_candidate", "threshold_met", TEXTS[rule.rule]);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
if (!policy.review_coverage_loss) {
|
|
158
|
+
add("coverage_loss", step.coverage_lost_pages, policy.min_coverage_lost_pages, "disabled", "rule_disabled", DISABLED);
|
|
159
|
+
}
|
|
160
|
+
else if (step.coverage_lost_pages >= policy.min_coverage_lost_pages) {
|
|
161
|
+
add("coverage_loss", step.coverage_lost_pages, policy.min_coverage_lost_pages, "review_only", "observed_validator_coverage_loss", TEXTS.coverage_loss);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
add("coverage_loss", step.coverage_lost_pages, policy.min_coverage_lost_pages, "below_threshold", "threshold_not_met", CLEAR);
|
|
165
|
+
}
|
|
166
|
+
if (!policy.review_sitemap_drift) {
|
|
167
|
+
add("sitemap_drift", step.sitemap_changed ? 1 : 0, 1, "disabled", "rule_disabled", DISABLED);
|
|
168
|
+
}
|
|
169
|
+
else if (step.sitemap_changed) {
|
|
170
|
+
add("sitemap_drift", 1, 1, "review_only", "observed_sitemap_drift", TEXTS.sitemap_drift);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
add("sitemap_drift", 0, 1, "below_threshold", "threshold_not_met", CLEAR);
|
|
174
|
+
}
|
|
175
|
+
result.candidate_count = result.rules.filter((r) => r.decision === "preview_candidate").length;
|
|
176
|
+
result.review_only_count = result.rules.filter((r) => r.decision === "review_only").length;
|
|
177
|
+
result.suppressed_count = result.rules.filter((r) => r.decision === "suppressed").length;
|
|
178
|
+
result.status = result.candidate_count > 0 ? "preview_ready" :
|
|
179
|
+
result.review_only_count > 0 ? "review_only" :
|
|
180
|
+
!completeLatest ? "insufficient_evidence" : "no_candidate";
|
|
181
|
+
return result;
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=regression-alerts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regression-alerts.js","sourceRoot":"","sources":["../../../src/modules/change-regression/regression-alerts.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,iBAAiB,EAAE,oBAAoB,EAAE,sBAAsB;IAC/D,eAAe,EAAE,eAAe;CACxB,CAAC;AAEX,MAAM,CAAC,MAAM,iBAAiB,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AAiB,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;IAC5E,CAAC;IACD,MAAM,CAAC,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,mBAAmB,CAAC,CAAC,MAAM,CAAC;IAC/F,MAAM,CAAC,iBAAiB,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,aAAa,CAAC,CAAC,MAAM,CAAC;IAC3F,MAAM,CAAC,gBAAgB,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAC,MAAM,CAAC;IACzF,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;QAC5D,MAAM,CAAC,iBAAiB,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;YAC5C,CAAC,cAAc,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,cAAc,CAAC;IAC/D,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/**\n * P2-02 manual-only dry-run regression monitoring and optional alert PREVIEWS.\n *\n * The caller obtains a validated historical audit review via P2-01 first.\n * This pure evaluator has no browser/network/storage/scheduler/notification API.\n * A candidate is advice to review a comparable sampled-page observation;\n * it is NEVER delivered or interpreted as a site-wide/Google metric signal.\n */\nimport type { HistoricalReview, HistoricalStep } from \"./historical-comparisons.js\";\n\nexport const MONITOR_RULES = [\n \"regressed_pages\", \"net_error_increase\", \"net_warning_increase\",\n \"coverage_loss\", \"sitemap_drift\",\n] as const;\nexport type MonitorRule = typeof MONITOR_RULES[number];\nexport const MONITOR_DECISIONS = [\n \"preview_candidate\", \"review_only\", \"suppressed\",\n \"below_threshold\", \"disabled\",\n] as const;\nexport type MonitorDecision = typeof MONITOR_DECISIONS[number];\nexport const MONITOR_STATUSES = [\n \"preview_ready\", \"review_only\", \"no_candidate\", \"insufficient_evidence\",\n] as const;\nexport type MonitorStatus = typeof MONITOR_STATUSES[number];\nexport const MONITOR_REASON_CODES = [\n \"threshold_met\", \"threshold_not_met\", \"rule_disabled\",\n \"incomplete_latest_pair\", \"ambiguous_version_order\",\n \"insufficient_streak_history\", \"regression_streak_not_met\",\n \"observed_validator_coverage_loss\", \"observed_sitemap_drift\",\n \"not_enough_observed_comparisons\",\n] as const;\nexport type MonitorReasonCode = typeof MONITOR_REASON_CODES[number];\n\nexport interface MonitorPolicyInput {\n min_regressed_pages?: number;\n min_net_error_increase?: number;\n min_net_warning_increase?: number;\n min_coverage_lost_pages?: number;\n consecutive_regressing_steps?: number;\n review_coverage_loss?: boolean;\n review_sitemap_drift?: boolean;\n}\nexport interface MonitorPolicy {\n min_regressed_pages: number;\n min_net_error_increase: number;\n min_net_warning_increase: number;\n min_coverage_lost_pages: number;\n consecutive_regressing_steps: number;\n review_coverage_loss: boolean;\n review_sitemap_drift: boolean;\n}\nexport const DEFAULT_MONITOR_POLICY: Readonly<MonitorPolicy> = Object.freeze({\n min_regressed_pages: 1,\n min_net_error_increase: 1,\n min_net_warning_increase: 1,\n min_coverage_lost_pages: 1,\n consecutive_regressing_steps: 1,\n review_coverage_loss: true,\n review_sitemap_drift: true,\n});\n\nexport interface MonitorRuleResult {\n rule: MonitorRule;\n decision: MonitorDecision;\n reason_code: MonitorReasonCode;\n latest_observed_value: number;\n threshold: number;\n review_required: boolean;\n message: string;\n}\nexport interface MonitorPreview {\n scope: \"manual_sampled_regression_alert_preview_only\";\n source: \"local_saved_ids\" | \"caller_supplied_snapshots\";\n status: MonitorStatus;\n dry_run: true;\n manually_invoked: true;\n scheduler_enabled: false;\n delivery_enabled: false;\n notifications_sent: 0;\n external_integrations_used: false;\n latest_baseline_version: number;\n latest_current_version: number;\n latest_comparability: \"comparable_sample\" | \"partial\" | \"not_comparable\";\n latest_compared_pages: number;\n latest_completed_pairs: number;\n candidate_count: number;\n review_only_count: number;\n suppressed_count: number;\n coverage_limited: true;\n policy: MonitorPolicy;\n rules: MonitorRuleResult[];\n limitations: string[];\n error?: string;\n}\n\nfunction intRange(value: unknown, min: number, max: number): boolean {\n return typeof value === \"number\" && Number.isSafeInteger(value) && value >= min && value <= max;\n}\n\n/** Enforce a small, explicit policy with no arbitrary scripts, URLs or destinations. */\nexport function normalizeMonitorPolicy(input?: MonitorPolicyInput): MonitorPolicy {\n if (input !== undefined && (input === null || typeof input !== \"object\" ||\n Array.isArray(input))) {\n throw new Error(\"Monitoring policy must be a bounded object\");\n }\n const provided = input ?? {};\n const allowed: ReadonlySet<string> = new Set(Object.keys(DEFAULT_MONITOR_POLICY));\n if (Object.keys(provided).some((key) => !allowed.has(key))) {\n throw new Error(\"Monitoring policy contains unsupported options\");\n }\n const merged: MonitorPolicy = { ...DEFAULT_MONITOR_POLICY, ...provided };\n if (!intRange(merged.min_regressed_pages, 1, 8) ||\n !intRange(merged.min_net_error_increase, 1, 10_000) ||\n !intRange(merged.min_net_warning_increase, 1, 10_000) ||\n !intRange(merged.min_coverage_lost_pages, 1, 8) ||\n !intRange(merged.consecutive_regressing_steps, 1, 4) ||\n typeof merged.review_coverage_loss !== \"boolean\" ||\n typeof merged.review_sitemap_drift !== \"boolean\") {\n throw new Error(\"Monitoring thresholds or review toggles out of allowed range\");\n }\n return merged;\n}\n\nexport function emptyMonitorPreview(\n source: MonitorPreview[\"source\"],\n policy: MonitorPolicy = { ...DEFAULT_MONITOR_POLICY },\n): MonitorPreview {\n return {\n scope: \"manual_sampled_regression_alert_preview_only\",\n source, status: \"insufficient_evidence\",\n dry_run: true, manually_invoked: true,\n scheduler_enabled: false, delivery_enabled: false,\n notifications_sent: 0, external_integrations_used: false,\n latest_baseline_version: 0, latest_current_version: 0,\n latest_comparability: \"not_comparable\",\n latest_compared_pages: 0, latest_completed_pairs: 0,\n candidate_count: 0, review_only_count: 0, suppressed_count: 0,\n coverage_limited: true, policy, rules: [],\n limitations: [\"No alerts or schedules were started; bounded historical source evidence was not sufficient for a monitoring preview.\"],\n };\n}\n\nfunction validateHistoricalReview(review: HistoricalReview): HistoricalStep {\n if (!review || review.scope !== \"historical_compact_audit_versions_only\" ||\n ![\"local_saved_ids\", \"caller_supplied_snapshots\"].includes(review.source) ||\n !Number.isSafeInteger(review.versions_compared) ||\n review.versions_compared < 2 || review.versions_compared > 10 ||\n !Array.isArray(review.consecutive_changes) ||\n review.consecutive_changes.length !== review.versions_compared - 1) {\n throw new Error(\"Requires a bounded, validated P2-01 historical review\");\n }\n const latest = review.consecutive_changes.at(-1)!;\n if (!latest || latest.baseline_version !== review.versions_compared - 1 ||\n latest.current_version !== review.versions_compared ||\n ![\"comparable_sample\", \"partial\", \"not_comparable\"].includes(latest.status) ||\n ![latest.shared_pages, latest.completely_checked_pairs, latest.regressed_pages,\n latest.coverage_lost_pages, latest.errors_delta_checked,\n latest.warnings_delta_checked].every((n) => Number.isSafeInteger(n))) {\n throw new Error(\"Historical latest transition lacks validated evidence\");\n }\n return latest;\n}\n\nconst TEXTS: Record<MonitorRule, string> = {\n regressed_pages: \"The latest comparable selected-page sample has enough pages with increased observed errors or warnings to preview a regression review.\",\n net_error_increase: \"The latest fully checked matched-page sample has a positive net increase in observed error counts above the configured threshold.\",\n net_warning_increase: \"The latest fully checked matched-page sample has a positive net increase in observed warning counts above the configured threshold.\",\n coverage_loss: \"A formerly completed validator observation is now incomplete; review check availability separately from actual page quality.\",\n sitemap_drift: \"The sampled site discovery fingerprint changed; verify selection and crawl coverage before interpreting historical trends.\",\n};\nconst BLOCKED =\n \"Preview suppressed because the latest sample is incomplete/noncomparable or the source version order is ambiguous.\";\nconst DISABLED = \"This review rule is disabled for this manual evaluation only.\";\nconst CLEAR = \"The observed value did not meet this rule's configured preview threshold.\";\nconst STREAK = \"The configured number of consecutive comparable regression transitions was not established.\";\n\nexport function previewRegressionAlerts(\n review: HistoricalReview, input?: MonitorPolicyInput,\n): MonitorPreview {\n const policy = normalizeMonitorPolicy(input);\n const step = validateHistoricalReview(review);\n const completeLatest = step.status === \"comparable_sample\" &&\n step.shared_pages > 0 &&\n step.completely_checked_pairs === step.shared_pages &&\n !review.time_order_ambiguous;\n const result = emptyMonitorPreview(review.source, policy);\n result.latest_baseline_version = step.baseline_version;\n result.latest_current_version = step.current_version;\n result.latest_comparability = step.status;\n result.latest_compared_pages = step.shared_pages;\n result.latest_completed_pairs = step.completely_checked_pairs;\n result.limitations = [\n \"Manual dry-run only: no scheduled jobs, live website checks, email/webhook delivery, external data integrations or notifications of any kind.\",\n \"Defect alert candidates are emitted only for the latest fully comparable selected-page pair with unambiguous timestamp order, never the full site or Google ranking/traffic behavior.\",\n \"A coverage-loss or changed-sitemap rule produces a review-only observation, not a validated SEO defect or notification.\",\n \"A threshold or regression streak concerns only already-observed completed checks; source snapshots and message content are never returned.\",\n ];\n const add = (rule: MonitorRule, observed: number, threshold: number,\n decision: MonitorDecision, reason: MonitorReasonCode, message: string) => {\n result.rules.push({\n rule, decision, reason_code: reason,\n latest_observed_value: observed,\n threshold, review_required: decision === \"preview_candidate\" || decision === \"review_only\",\n message,\n });\n };\n\n const thresholdRules = [\n { rule: \"regressed_pages\" as const, observed: step.regressed_pages, threshold: policy.min_regressed_pages },\n { rule: \"net_error_increase\" as const, observed: step.errors_delta_checked, threshold: policy.min_net_error_increase },\n { rule: \"net_warning_increase\" as const, observed: step.warnings_delta_checked, threshold: policy.min_net_warning_increase },\n ];\n for (const rule of thresholdRules) {\n if (!completeLatest) {\n add(rule.rule, rule.observed, rule.threshold, \"suppressed\",\n review.time_order_ambiguous ? \"ambiguous_version_order\" : \"incomplete_latest_pair\",\n BLOCKED);\n } else if (rule.observed < rule.threshold) {\n add(rule.rule, rule.observed, rule.threshold, \"below_threshold\", \"threshold_not_met\", CLEAR);\n } else if (rule.rule === \"regressed_pages\" &&\n policy.consecutive_regressing_steps > 1) {\n const required = policy.consecutive_regressing_steps;\n const recent = review.consecutive_changes.slice(-required);\n const tooShort = recent.length < required;\n const validStreak = !tooShort && recent.every((s) =>\n s.status === \"comparable_sample\" &&\n s.regressed_pages >= policy.min_regressed_pages);\n if (validStreak) {\n add(rule.rule, rule.observed, rule.threshold, \"preview_candidate\", \"threshold_met\", TEXTS[rule.rule]);\n } else {\n add(rule.rule, rule.observed, rule.threshold, \"suppressed\",\n tooShort ? \"insufficient_streak_history\" : \"regression_streak_not_met\",\n STREAK);\n }\n } else {\n add(rule.rule, rule.observed, rule.threshold, \"preview_candidate\", \"threshold_met\", TEXTS[rule.rule]);\n }\n }\n if (!policy.review_coverage_loss) {\n add(\"coverage_loss\", step.coverage_lost_pages, policy.min_coverage_lost_pages,\n \"disabled\", \"rule_disabled\", DISABLED);\n } else if (step.coverage_lost_pages >= policy.min_coverage_lost_pages) {\n add(\"coverage_loss\", step.coverage_lost_pages, policy.min_coverage_lost_pages,\n \"review_only\", \"observed_validator_coverage_loss\", TEXTS.coverage_loss);\n } else {\n add(\"coverage_loss\", step.coverage_lost_pages, policy.min_coverage_lost_pages,\n \"below_threshold\", \"threshold_not_met\", CLEAR);\n }\n if (!policy.review_sitemap_drift) {\n add(\"sitemap_drift\", step.sitemap_changed ? 1 : 0, 1,\n \"disabled\", \"rule_disabled\", DISABLED);\n } else if (step.sitemap_changed) {\n add(\"sitemap_drift\", 1, 1, \"review_only\", \"observed_sitemap_drift\", TEXTS.sitemap_drift);\n } else {\n add(\"sitemap_drift\", 0, 1, \"below_threshold\", \"threshold_not_met\", CLEAR);\n }\n result.candidate_count = result.rules.filter((r) => r.decision === \"preview_candidate\").length;\n result.review_only_count = result.rules.filter((r) => r.decision === \"review_only\").length;\n result.suppressed_count = result.rules.filter((r) => r.decision === \"suppressed\").length;\n result.status = result.candidate_count > 0 ? \"preview_ready\" :\n result.review_only_count > 0 ? \"review_only\" :\n !completeLatest ? \"insufficient_evidence\" : \"no_candidate\";\n return result;\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate caller-supplied, timezone-qualified timestamps before Date.parse.
|
|
3
|
+
* Date.parse normalizes impossible calendar dates (e.g. February 30), which
|
|
4
|
+
* must not be allowed to define the chronology of audit evidence.
|
|
5
|
+
* Shared by local and hosted comparison modules; no I/O or dependencies.
|
|
6
|
+
*/
|
|
7
|
+
export declare function strictObservationTime(value: unknown): number | undefined;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate caller-supplied, timezone-qualified timestamps before Date.parse.
|
|
3
|
+
* Date.parse normalizes impossible calendar dates (e.g. February 30), which
|
|
4
|
+
* must not be allowed to define the chronology of audit evidence.
|
|
5
|
+
* Shared by local and hosted comparison modules; no I/O or dependencies.
|
|
6
|
+
*/
|
|
7
|
+
export function strictObservationTime(value) {
|
|
8
|
+
if (typeof value !== "string" || value.length > 40)
|
|
9
|
+
return undefined;
|
|
10
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.\d{1,3})?(?:Z|[+-](\d{2}):(\d{2}))$/u.exec(value);
|
|
11
|
+
if (!match)
|
|
12
|
+
return undefined;
|
|
13
|
+
const [, yearRaw, monthRaw, dayRaw, hourRaw, minuteRaw, secondRaw, offsetHourRaw, offsetMinuteRaw] = match;
|
|
14
|
+
const year = Number(yearRaw);
|
|
15
|
+
const month = Number(monthRaw);
|
|
16
|
+
const day = Number(dayRaw);
|
|
17
|
+
const hour = Number(hourRaw);
|
|
18
|
+
const minute = Number(minuteRaw);
|
|
19
|
+
const second = Number(secondRaw);
|
|
20
|
+
const offsetHour = offsetHourRaw === undefined ? 0 : Number(offsetHourRaw);
|
|
21
|
+
const offsetMinute = offsetMinuteRaw === undefined ? 0 : Number(offsetMinuteRaw);
|
|
22
|
+
const leap = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
23
|
+
const maxDays = [31, leap ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
24
|
+
if (month < 1 || month > 12 || day < 1 || day > maxDays[month - 1] ||
|
|
25
|
+
hour > 23 || minute > 59 || second > 59 || offsetHour > 23 || offsetMinute > 59) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
const time = Date.parse(value);
|
|
29
|
+
return Number.isFinite(time) ? time : undefined;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=strict-observation-time.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strict-observation-time.js","sourceRoot":"","sources":["../../../src/modules/change-regression/strict-observation-time.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAc;IAClD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,EAAE;QAAE,OAAO,SAAS,CAAC;IACrE,MAAM,KAAK,GACT,2FAA2F,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1G,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAC7B,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC;IAC3G,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC/B,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAC3B,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAC7B,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IACjC,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IACjC,MAAM,UAAU,GAAG,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAC3E,MAAM,YAAY,GAAG,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;IACjF,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,KAAK,CAAC,IAAI,IAAI,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC;IACtE,MAAM,OAAO,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7E,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,GAAG,EAAE,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC;QAChE,IAAI,GAAG,EAAE,IAAI,MAAM,GAAG,EAAE,IAAI,MAAM,GAAG,EAAE,IAAI,UAAU,GAAG,EAAE,IAAI,YAAY,GAAG,EAAE,EAAE,CAAC;QAClF,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AAClD,CAAC","sourcesContent":["/**\n * Validate caller-supplied, timezone-qualified timestamps before Date.parse.\n * Date.parse normalizes impossible calendar dates (e.g. February 30), which\n * must not be allowed to define the chronology of audit evidence.\n * Shared by local and hosted comparison modules; no I/O or dependencies.\n */\nexport function strictObservationTime(value: unknown): number | undefined {\n if (typeof value !== \"string\" || value.length > 40) return undefined;\n const match =\n /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.\\d{1,3})?(?:Z|[+-](\\d{2}):(\\d{2}))$/u.exec(value);\n if (!match) return undefined;\n const [, yearRaw, monthRaw, dayRaw, hourRaw, minuteRaw, secondRaw, offsetHourRaw, offsetMinuteRaw] = match;\n const year = Number(yearRaw);\n const month = Number(monthRaw);\n const day = Number(dayRaw);\n const hour = Number(hourRaw);\n const minute = Number(minuteRaw);\n const second = Number(secondRaw);\n const offsetHour = offsetHourRaw === undefined ? 0 : Number(offsetHourRaw);\n const offsetMinute = offsetMinuteRaw === undefined ? 0 : Number(offsetMinuteRaw);\n const leap = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n const maxDays = [31, leap ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n if (month < 1 || month > 12 || day < 1 || day > maxDays[month - 1] ||\n hour > 23 || minute > 59 || second > 59 || offsetHour > 23 || offsetMinute > 59) {\n return undefined;\n }\n const time = Date.parse(value);\n return Number.isFinite(time) ? time : undefined;\n}\n"]}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* P1-05 citation / dataset / freshness / methodology consistency.
|
|
3
|
+
*
|
|
4
|
+
* Pure comparisons of supplied static HTML observations and caller-supplied
|
|
5
|
+
* evidence. Nothing here fetches a citation, validates scientific claims,
|
|
6
|
+
* measures search ranking or treats an incomplete manifest as exhaustive.
|
|
7
|
+
*/
|
|
8
|
+
export declare const MAX_PROVENANCE_PAGES = 8;
|
|
9
|
+
export declare const MAX_PROVENANCE_SOURCES = 24;
|
|
10
|
+
export declare const MAX_PROVENANCE_DATASETS = 16;
|
|
11
|
+
export declare const MAX_PROVENANCE_METHODS = 16;
|
|
12
|
+
export declare const MAX_PROVENANCE_FINDINGS = 12;
|
|
13
|
+
export declare const MAX_PROVENANCE_HTML_BYTES = 200000;
|
|
14
|
+
export declare const MAX_PROVENANCE_INPUT_BYTES = 1000000;
|
|
15
|
+
export declare const MAX_PROVENANCE_DECLARATIONS = 48;
|
|
16
|
+
export interface ReferenceEvidence {
|
|
17
|
+
id: string;
|
|
18
|
+
url: string;
|
|
19
|
+
}
|
|
20
|
+
export interface DatasetEvidence {
|
|
21
|
+
id: string;
|
|
22
|
+
version?: string;
|
|
23
|
+
as_of?: string;
|
|
24
|
+
max_age_days?: number;
|
|
25
|
+
methodology_id?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface MethodologyEvidence {
|
|
28
|
+
id: string;
|
|
29
|
+
url: string;
|
|
30
|
+
}
|
|
31
|
+
export interface ProvenanceManifest {
|
|
32
|
+
/** The caller's reference date, not an independently checked wall clock. */
|
|
33
|
+
as_of?: string;
|
|
34
|
+
sources?: ReferenceEvidence[];
|
|
35
|
+
datasets?: DatasetEvidence[];
|
|
36
|
+
methodologies?: MethodologyEvidence[];
|
|
37
|
+
}
|
|
38
|
+
export interface CitationDeclaration {
|
|
39
|
+
id?: string;
|
|
40
|
+
url?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface DatasetDeclaration {
|
|
43
|
+
id?: string;
|
|
44
|
+
version?: string;
|
|
45
|
+
as_of?: string;
|
|
46
|
+
methodology_id?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface MethodologyDeclaration {
|
|
49
|
+
id?: string;
|
|
50
|
+
url?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface ProvenanceObservation {
|
|
53
|
+
url: string;
|
|
54
|
+
citations: CitationDeclaration[];
|
|
55
|
+
datasets: DatasetDeclaration[];
|
|
56
|
+
methodologies: MethodologyDeclaration[];
|
|
57
|
+
published_dates: string[];
|
|
58
|
+
modified_dates: string[];
|
|
59
|
+
invalid_dates: number;
|
|
60
|
+
declarations_truncated: boolean;
|
|
61
|
+
eligible: boolean;
|
|
62
|
+
}
|
|
63
|
+
export type ProvenanceCode = "citation_id_target_conflict" | "citation_target_differs_from_supplied_evidence" | "citation_reference_unverified" | "dataset_version_conflict" | "dataset_as_of_conflict" | "dataset_reference_unverified" | "dataset_snapshot_in_future" | "dataset_freshness_window_exceeded" | "methodology_link_conflict" | "methodology_id_conflict" | "methodology_reference_unverified" | "invalid_date_declarations" | "published_dates_inconsistent" | "modified_dates_inconsistent" | "modified_before_published" | "publication_after_reference_date";
|
|
64
|
+
export interface ProvenanceFinding {
|
|
65
|
+
code: ProvenanceCode;
|
|
66
|
+
severity: "warning" | "info";
|
|
67
|
+
evidence: "observed_html" | "supplied_manifest" | "reference_date";
|
|
68
|
+
page_url: string;
|
|
69
|
+
reference_id?: string;
|
|
70
|
+
message: string;
|
|
71
|
+
}
|
|
72
|
+
export interface ProvenanceResult {
|
|
73
|
+
scope: "supplied_static_html_and_evidence";
|
|
74
|
+
pages_sampled: number;
|
|
75
|
+
pages_eligible: number;
|
|
76
|
+
citations_observed: number;
|
|
77
|
+
datasets_observed: number;
|
|
78
|
+
methodologies_observed: number;
|
|
79
|
+
checked_declarations: number;
|
|
80
|
+
consistent_declarations: number;
|
|
81
|
+
conflicting_declarations: number;
|
|
82
|
+
unverified_declarations: number;
|
|
83
|
+
invalid_date_declarations: number;
|
|
84
|
+
evidence_supplied: boolean;
|
|
85
|
+
coverage_limited: boolean;
|
|
86
|
+
limitations: string[];
|
|
87
|
+
total_findings: number;
|
|
88
|
+
findings: ProvenanceFinding[];
|
|
89
|
+
findings_truncated: boolean;
|
|
90
|
+
}
|
|
91
|
+
/** Strict safe labels for references, no query, fragment or credential leakage. */
|
|
92
|
+
export declare function safeProvenanceUrl(raw: string): string | undefined;
|
|
93
|
+
export declare function safeProvenanceId(raw: string): string | undefined;
|
|
94
|
+
export declare function safeDatasetVersion(raw: string): string | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* Calendar-valid YYYY-MM-DD or a timezone-qualified ISO timestamp. Dates from
|
|
97
|
+
* timestamps are compared by UTC day to avoid local machine timezone drift.
|
|
98
|
+
*/
|
|
99
|
+
export declare function normalizedEvidenceDate(raw: string): string | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* Supports incomplete evidence. An unknown identifier remains unverified;
|
|
102
|
+
* disagreement against an explicitly supplied entry is a disagreement with
|
|
103
|
+
* that entry, not proof that the underlying publication is untruthful.
|
|
104
|
+
*/
|
|
105
|
+
export declare function analyzeProvenance(observations: readonly ProvenanceObservation[], manifest?: ProvenanceManifest, options?: {
|
|
106
|
+
sampledPages?: number;
|
|
107
|
+
coverageLimited?: boolean;
|
|
108
|
+
}): ProvenanceResult;
|