CtrlK
BlogDocsLog inGet started
Tessl Logo
PluginPublic

adobe/stardust

Redesign an existing website to make it better. Built on top of impeccable.

Quality

88%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Low

Low-risk findings worth noting

Overview
Quality
Evals
Security
Files

dynamics.mjsskills/qa/scripts/checks/

/**
 * qa/checks/dynamics.mjs — category H: dynamic parity (browser).
 *
 * Replays `stardust/dynamics/parity.json` (written by stardust:dynamics Phase 5)
 * against the live base through the dynamics replay engine — flows, not
 * presence. When `stardust/martech-contract.json` exists its martech checks
 * (consent gate + tag routing) are replayed too. Findings:
 *   - parity-missing      info   no parity file → the migration never ran dynamics; nothing to replay
 *   - parity-failed       error  a replayed flow did not complete
 *   - parity-env-limit    warn   a failed flow whose feature records an environment limit
 *   - parity-unchecked    info   a feature with a non-final status and no checks (owner item)
 * The site secret (--auth-header / --token-env) rides an origin-scoped route
 * filter only — never context-wide.
 */
import { existsSync } from 'node:fs';
import { join, dirname } from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url';
import { finding, readJSON } from '../lib.mjs';

const CONTRACT = 'stardust/martech-contract.json';

export async function run(ctx) {
  const { base, opts } = ctx;
  const file = opts.parity || 'stardust/dynamics/parity.json';
  const missing = finding('dynamics', 'parity-missing', 'info', '', `no dynamic parity file at ${file} — run stardust:dynamics (Phases 1–5) if this site was migrated with dynamic features`);
  const hasParity = existsSync(file);
  const contract = existsSync(CONTRACT) ? readJSON(CONTRACT) : null;
  if (!hasParity && !contract) return [missing];
  const parity = hasParity ? readJSON(file) : { features: [] };
  const here = dirname(fileURLToPath(import.meta.url));
  const { replay } = await import(pathToFileURL(join(here, '../../../dynamics/scripts/dynamics-check.mjs')).href);
  const results = await replay({ origin: base, parity, contract, authHeader: opts.authHeader || null });
  const out = hasParity ? [] : [missing];
  for (const r of results) {
    if (r.pass) continue;
    const ev = { check: r.type, detail: r.detail, thirdParty: r.thirdParty };
    if (r.environmentLimit) out.push(finding('dynamics', 'parity-env-limit', 'warn', '', `${r.feature}: ${r.type} failed under a recorded environment limit — ${r.environmentLimit}`, ev));
    else out.push(finding('dynamics', 'parity-failed', 'error', '', `${r.feature} (${r.class}): ${r.type} — ${r.detail}`, ev));
  }
  for (const f of parity.features || []) {
    if ((f.checks || []).length) continue;
    if (['decided-out', 'delivered-by-capture', 'skipped-source-broken'].includes(f.status)) continue;
    out.push(finding('dynamics', 'parity-unchecked', 'info', '', `${f.feature} (${f.class}): status "${f.status}" with no replayable check${f.owner ? ` — owner: ${f.owner}` : ''}`));
  }
  return out;
}

skills

README.md

tile.json