Skip to content

Introduce Harmonic Temporal Orientation system and validator - #189

Closed
safal207 wants to merge 47 commits into
mainfrom
docs/harmonic-temporal-orientation-whitepaper
Closed

Introduce Harmonic Temporal Orientation system and validator#189
safal207 wants to merge 47 commits into
mainfrom
docs/harmonic-temporal-orientation-whitepaper

Conversation

@safal207

@safal207 safal207 commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

Introduces Harmonic Temporal Orientation: whitepaper, canonical JSON contract, playbook, scorecard, validator, positive/negative fixtures, tests, and an inactive CI template.

Evidence

Current exact head: 35b3105eb08fc255bc1503e1263099ad91e9769d.

node scripts/validate-harmonic-orientation.mjs \
  docs/examples/harmonic-orientation-record.pr188-minify-reject.json \
  docs/examples/harmonic-orientation-record.pr188-baseline-allow.json \
  docs/examples/harmonic-orientation-record.pr186-d6-hold.json \
  docs/examples/harmonic-orientation-record.conflict-escalate.json
node scripts/test-harmonic-orientation.mjs
node --check scripts/validate-harmonic-orientation.mjs
node --check scripts/test-harmonic-orientation.mjs

Exact-head CI already green: Security, CodeQL, Feature Traceability, Reviewdog, iOS route gate, generated runtime, human approval, and review preflight. The Adversarial offline failure belongs to the existing runtime repair flow and is not changed by this documentation/validator PR.

AI review

Earlier CodeRabbit and Qodo findings were accepted and remediated. A fresh @coderabbitai review was requested for the current head; the bot acknowledged the request and is processing it.

Solo maintainer decision

Keep the PR in draft until the fresh exact-head review and remaining CI checks complete. Do not activate the CI template as a required check yet, and do not mix runtime repair changes into this branch.

Checklist

  • Canonical JSON record documented.
  • Required graph objects validated.
  • Both evidence snapshots and all buckets validated.
  • Score/decision ranges enforced.
  • Hard-blocker enum, inference, and precedence enforced.
  • Positive and negative fixture coverage expanded.
  • YAML/JSON contract clarified.
  • PR returned to draft while exact-head review is pending.
  • Fresh exact-head CodeRabbit review completes with no unresolved findings.
  • Remaining CI checks finish and are classified.
  • PR is marked ready only after evidence is complete.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: db7d44a6-1d03-48b4-86d1-d3ee358f11ec

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Добавлены спецификация и документация Harmonic Temporal Orientation, шаблоны orientation records, набор валидных и невалидных JSON-фикстур, Node.js-валидатор, fixture-тесты и шаблон GitHub Actions для их запуска.

Changes

Harmonic Temporal Orientation

Layer / File(s) Summary
Модель и машинный контракт
docs/harmonic-temporal-orientation-system.md, docs/harmonic-temporal-orientation-spec.yaml
Описаны семь графов HTO, состояния решений, структура записей, scorecard, hard blockers и правила их приоритета.
Карта внедрения и автоматизации
docs/harmonic-temporal-orientation-implementation-map.md
Определены GitHub-сигналы, фазы внедрения, JSON-контракт, advisory CI и границы первой автоматизации.
Руководства, scorecard и журналы
docs/harmonic-temporal-orientation-playbook.md, docs/harmonic-temporal-orientation-scorecard.md, docs/harmonic-temporal-orientation-decision-log.md
Добавлены операционные правила решений, scoring по пяти измерениям, классификация hard blockers и примеры decision log.
Шаблоны orientation records и evidence
docs/harmonic-temporal-orientation-templates.md
Добавлены шаблоны для PR records, комментариев, baseline, bot evidence, seal, merge readiness, Observer и Tuner.
Фикстуры, валидатор и запуск проверок
docs/examples/harmonic-orientation-record.*.json, scripts/validate-harmonic-orientation.mjs, scripts/test-harmonic-orientation.mjs, docs/harmonic-temporal-orientation-ci-workflow-template.md
Добавлены сценарии allow/reject/hold/escalate и ошибочных записей; валидатор проверяет структуру, evidence, scorecard и hard blockers, а fixture-тесты проверяют ожидаемые результаты.

Estimated code review effort: 4 (Complex) | ~45 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed Заголовок точно отражает основной смысл PR: добавление системы Harmonic Temporal Orientation и валидатора.
Description check ✅ Passed Описание соответствует шаблону: есть Summary, Evidence, AI review, Solo maintainer decision и checklist с актуальным статусом.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/harmonic-temporal-orientation-whitepaper

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

🚦 Roby’s Lighthouse contract

mobile

No summary artifact was produced. ❌

Desktop

Metric Current Baseline Delta Status
Performance 0.99 1.00 -0.50%
LCP 562 ms 460 ms +22.13%
TBT 0 ms 0 ms 0.00%
CLS 0.00 0.00 0.00%
FCP 514 ms
Speed Index 514 ms
Total JS 22 KB 21 KB +7.69%
Hero file 78 KB 78 KB -0.15%
Hero transfer 0 KB
Hero request 0 ms

Hard assertions: ✅ · Regression: ❌
· Public Lighthouse report

D.1 runs in observability mode. The final gate is enabled only after the reviewed baseline commit.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 14

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/harmonic-temporal-orientation-ci-workflow-template.md`:
- Around line 26-34: Фильтр paths workflow не охватывает все входы команды
проверки. Обновите секцию pull_request в
harmonic-temporal-orientation-ci-workflow-template, добавив
scripts/test-harmonic-orientation.mjs и используемый lockfile (например,
package-lock.json или npm-shrinkwrap.json), либо расширьте фильтр до всех
релевантных файлов validator package. Проверьте, что пути и команда npm run
verify:harmonic-orientation соответствуют фактическому CI-контракту.

In `@docs/harmonic-temporal-orientation-decision-log.md`:
- Around line 142-150: Update the Example 2 YAML entry’s actor value to conform
to the documented enum by replacing “orientation-center” with an allowed value
such as “bot”, or explicitly extend the entry template contract if
“orientation-center” is intended to be supported.

In `@docs/harmonic-temporal-orientation-implementation-map.md`:
- Around line 118-152: Синхронизируйте раздел “Minimal machine-readable
orientation shape” с фактическим каноническим контрактом валидатора: добавьте
обязательные поля id, time_utc, graph-поля и orientation_center, а также
скорректируйте несовпадающие поля. Если JSON намеренно остается предварительным
форматом, явно обозначьте его как будущий adapter shape и укажите, что он не
является валидируемым каноническим контрактом.
- Around line 210-230: Обновите раздел “First useful automation candidate”,
заменив несуществующий скрипт и каталог в примере команды на фактически
добавленные `scripts/validate-harmonic-orientation.mjs` и npm-команду
`verify:harmonic-orientation`; согласуйте описание начальных проверок с реальным
контрактом `validate-harmonic-orientation.mjs` и упомяните
`test-harmonic-orientation.mjs` только если это соответствует способу запуска
тестов.

In `@docs/harmonic-temporal-orientation-playbook.md`:
- Around line 23-48: Синхронизируйте YAML-пример `orientation_record` с
канонической схемой валидатора: замените устаревшие top-level поля `pr`, `head`,
`time`, `project_invariant`, `transition_candidate`, `real_evidence_before` и
`orientation_decision` на обязательные `id`, `time_utc`, `head_sha`,
`project_graph`, `transition_graph`, `real_graph` и `orientation_center`,
сохранив соответствующее содержимое и структуру контрактов. Проверьте все
шаблоны и примеры в документе на единообразное использование этой схемы.

In `@docs/harmonic-temporal-orientation-scorecard.md`:
- Around line 41-49: Уточните в разделе “Decision guide” правило для score 0–4:
выбирать reject только при наличии необходимого evidence, а при отсутствующих
prerequisite evidence — hold; синхронизируйте это правило с примером score 1 и
соответствующими fixtures, включая раздел около строк 127–154.

In `@docs/harmonic-temporal-orientation-spec.yaml`:
- Around line 184-201: Сделайте поле scorecard обязательным для записей,
принимающих решение: добавьте scorecard в required_fields схемы
orientation_record_schema, чтобы решения allow/reject/hold/escalate не проходили
без проверки порогов и hard blockers.
- Around line 175-182: Валидируйте значения hard_blockers по каноническому enum
вместо проверки только непустых строк: отклоняйте неизвестные идентификаторы и
выявляйте отсутствие обязательных ожидаемых blockers. Обновите соответствующий
валидатор в спецификации harmonic temporal orientation и добавьте тесты для
неизвестных значений и пропущенных канонических blockers.
- Around line 169-182: Уточните в спецификации precedence между hard_blockers и
решениями hold/escalate: добавьте явное правило выбора, определяющее итоговое
решение при наличии hard blocker независимо от score и других сигналов. Обновите
decision_thresholds или отдельный раздел policy, затем добавьте fixtures для
комбинаций hard blocker + hold и hard blocker + escalate, проверяющих это
правило.

In `@package.json`:
- Line 46: Добавьте команды `node --check android-download.js`, `node --check
pwa.js` и `node --check sw.js` в скрипт `check` в package.json, сохранив
существующую последовательность проверок.

In `@scripts/test-harmonic-orientation.mjs`:
- Around line 39-44: В testInvalidFixtures проверяется только наличие ошибок,
поэтому фикстура может пройти тест при отказе по неверной причине. Добавьте для
каждого элемента INVALID_FIXTURES ожидаемую причину отказа (hard blocker или
score mismatch) и проверяйте, что результат validateFixture содержит именно
соответствующую ошибку, сохранив проверку result.ok === false.

In `@scripts/validate-harmonic-orientation.mjs`:
- Around line 103-112: Update validateEvidenceShape to validate that
record.real_graph.evidence_before is a non-null object before using the in
operator; when it has an invalid type such as a string, add a structured
validation error via pushError and return without throwing, so the exported
validateRecord returns ok: false.
- Around line 74-76: Проверка валидации scorecard.total допускает значения
неверного типа. В функции, содержащей проверку `scorecard.total`, добавьте
ошибку через `pushError` для любого значения, чей тип не является `number`, а
для числовых значений сохраните проверку соответствия `computedTotal`; учтите
также корректность числового значения согласно существующим правилам валидации.
- Around line 29-30: Проверьте функцию asArray и связанные проверки
hard_blockers валидации: некорректные не-массивные значения не должны молча
заменяться на пустой список. Измените логику так, чтобы такие записи явно
отклонялись с ошибкой и не могли завершить проверку с ok: true, сохранив
корректную обработку настоящих массивов.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 51189df2-57bf-4add-8872-9e88e4875fff

📥 Commits

Reviewing files that changed from the base of the PR and between e26fb90 and 10c4017.

📒 Files selected for processing (17)
  • docs/examples/harmonic-orientation-record.conflict-escalate.json
  • docs/examples/harmonic-orientation-record.invalid-allow-hard-blocker.json
  • docs/examples/harmonic-orientation-record.invalid-score-mismatch.json
  • docs/examples/harmonic-orientation-record.pr186-d6-hold.json
  • docs/examples/harmonic-orientation-record.pr188-baseline-allow.json
  • docs/examples/harmonic-orientation-record.pr188-minify-reject.json
  • docs/harmonic-temporal-orientation-ci-workflow-template.md
  • docs/harmonic-temporal-orientation-decision-log.md
  • docs/harmonic-temporal-orientation-implementation-map.md
  • docs/harmonic-temporal-orientation-playbook.md
  • docs/harmonic-temporal-orientation-scorecard.md
  • docs/harmonic-temporal-orientation-spec.yaml
  • docs/harmonic-temporal-orientation-system.md
  • docs/harmonic-temporal-orientation-templates.md
  • package.json
  • scripts/test-harmonic-orientation.mjs
  • scripts/validate-harmonic-orientation.mjs
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: profiles / profile (mobile)
  • GitHub Check: profiles / profile (desktop)
  • GitHub Check: CodeRabbit / Review
  • GitHub Check: Verify exact-head independent review
  • GitHub Check: DAST-001 passive web scan
⚠️ CI failures not shown inline (6)

GitHub Actions: Bot review disposition contract / 0_REVIEW-LEDGER exact-head findings.txt: Introduce Harmonic Temporal Orientation system and validator

Conclusion: failure

View job details

##[group]Run actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b
 with:
   script: const owner = context.repo.owner;
const repo = context.repo.repo;
const payloadPr = context.payload.pull_request;
const issuePr = context.payload.issue?.pull_request;
const prNumber = payloadPr?.number ?? (issuePr ? context.payload.issue.number : null);
if (!prNumber) {
  core.notice('Event is not associated with a pull request.');
  return;
}
const pr = (await github.rest.pulls.get({ owner, repo, pull_number: prNumber })).data;
const head = pr.head.sha.toLowerCase();
const [reviewComments, reviews, issueComments, statuses] = await Promise.all([
  github.paginate(
    github.rest.pulls.listReviewComments,
    { owner, repo, pull_number: prNumber, per_page: 100 },
  ),
  github.paginate(
    github.rest.pulls.listReviews,
    { owner, repo, pull_number: prNumber, per_page: 100 },
  ),
  github.paginate(
    github.rest.issues.listComments,
    { owner, repo, issue_number: prNumber, per_page: 100 },
  ),
  github.paginate(
    github.rest.repos.listCommitStatusesForRef,
    { owner, repo, ref: head, per_page: 100 },
  ),
]);
const reviewHeads = new Map(
  reviews.map((review) => [review.id, review.commit_id?.toLowerCase()]),
);
const reviewBots = new Set([
  'chatgpt-codex-connector',
  'chatgpt-codex-connector[bot]',
  'coderabbitai',
  'coderabbitai[bot]',
  'github-advanced-security',
  'github-advanced-security[bot]',
]);
const trustedAssociations = new Set(['OWNER', 'MEMBER', 'COLLABORATOR']);
const exactHeadBody = (body) => new RegExp(`(^|[^0-9a-f])${head}([^0-9a-f]|$)`, 'i').test(body ?? '');
const timeOf = (item) => Math.max(
  0,
  ...[item.submitted_at, item.created_at, item.updated_at]
    .map((value) => Date.parse(value ?? 0))
    .filter(Number.isFinite),
);
const isDispositionReply = (reply) => {
  const body = (reply.body ?? '').replaceAll('`', '');
  const disposition = /^Disposition:\s*(accepted|rejected-with-evidence|superseded)\s*$/im.test(body);
  cons...

GitHub Actions: Bot review disposition contract / REVIEW-LEDGER exact-head findings: Introduce Harmonic Temporal Orientation system and validator

Conclusion: failure

View job details

##[group]Run actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b
 with:
   script: const owner = context.repo.owner;
const repo = context.repo.repo;
const payloadPr = context.payload.pull_request;
const issuePr = context.payload.issue?.pull_request;
const prNumber = payloadPr?.number ?? (issuePr ? context.payload.issue.number : null);
if (!prNumber) {
  core.notice('Event is not associated with a pull request.');
  return;
}
const pr = (await github.rest.pulls.get({ owner, repo, pull_number: prNumber })).data;
const head = pr.head.sha.toLowerCase();
const [reviewComments, reviews, issueComments, statuses] = await Promise.all([
  github.paginate(
    github.rest.pulls.listReviewComments,
    { owner, repo, pull_number: prNumber, per_page: 100 },
  ),
  github.paginate(
    github.rest.pulls.listReviews,
    { owner, repo, pull_number: prNumber, per_page: 100 },
  ),
  github.paginate(
    github.rest.issues.listComments,
    { owner, repo, issue_number: prNumber, per_page: 100 },
  ),
  github.paginate(
    github.rest.repos.listCommitStatusesForRef,
    { owner, repo, ref: head, per_page: 100 },
  ),
]);
const reviewHeads = new Map(
  reviews.map((review) => [review.id, review.commit_id?.toLowerCase()]),
);
const reviewBots = new Set([
  'chatgpt-codex-connector',
  'chatgpt-codex-connector[bot]',
  'coderabbitai',
  'coderabbitai[bot]',
  'github-advanced-security',
  'github-advanced-security[bot]',
]);
const trustedAssociations = new Set(['OWNER', 'MEMBER', 'COLLABORATOR']);
const exactHeadBody = (body) => new RegExp(`(^|[^0-9a-f])${head}([^0-9a-f]|$)`, 'i').test(body ?? '');
const timeOf = (item) => Math.max(
  0,
  ...[item.submitted_at, item.created_at, item.updated_at]
    .map((value) => Date.parse(value ?? 0))
    .filter(Number.isFinite),
);
const isDispositionReply = (reply) => {
  const body = (reply.body ?? '').replaceAll('`', '');
  const disposition = /^Disposition:\s*(accepted|rejected-with-evidence|superseded)\s*$/im.test(body);
  cons...

GitHub Actions: Adversarial browser contract / ADV-001 browser probes: Introduce Harmonic Temporal Orientation system and validator

Conclusion: failure

View job details

##[group]Run python3 -m http.server 4173 --bind 127.0.0.1 > .artifacts/offline-server.log 2>&1 &
 �[36;1mpython3 -m http.server 4173 --bind 127.0.0.1 > .artifacts/offline-server.log 2>&1 &�[0m
 �[36;1mfor attempt in {1..30}; do�[0m
 �[36;1m  if curl --fail --silent http://127.0.0.1:4173/index.html > /dev/null; then�[0m
 �[36;1m    break�[0m
 �[36;1m  fi�[0m
 �[36;1m  sleep 1�[0m
 �[36;1mdone�[0m
 �[36;1mset -o pipefail�[0m
 �[36;1mnode scripts/verify-offline-browser.mjs 2>&1 | tee .artifacts/offline-android.log�[0m
 shell: /usr/bin/bash -e {0}
 env:
   BASE_URL: http://127.0.0.1:4173
 ##[endgroup]
 node:internal/modules/run_main:123
     triggerUncaughtException(
     ^
 locator.waitFor: Timeout 15000ms exceeded.
 Call log:
   - waiting for locator('html[data-offline-ready=\'true\']')
     at /home/runner/work/robys-coffee-house-demo/robys-coffee-house-demo/scripts/verify-offline-browser.mjs:51:57 {
   name: 'TimeoutError'
 }
 Node.js v22.23.1
 ##[error]Process completed with exit code 1.

GitHub Actions: Adversarial browser contract / 0_ADV-001 browser probes.txt: Introduce Harmonic Temporal Orientation system and validator

Conclusion: failure

View job details

##[group]Run python3 -m http.server 4173 --bind 127.0.0.1 > .artifacts/offline-server.log 2>&1 &
 �[36;1mpython3 -m http.server 4173 --bind 127.0.0.1 > .artifacts/offline-server.log 2>&1 &�[0m
 �[36;1mfor attempt in {1..30}; do�[0m
 �[36;1m  if curl --fail --silent http://127.0.0.1:4173/index.html > /dev/null; then�[0m
 �[36;1m    break�[0m
 �[36;1m  fi�[0m
 �[36;1m  sleep 1�[0m
 �[36;1mdone�[0m
 �[36;1mset -o pipefail�[0m
 �[36;1mnode scripts/verify-offline-browser.mjs 2>&1 | tee .artifacts/offline-android.log�[0m
 shell: /usr/bin/bash -e {0}
 env:
   BASE_URL: http://127.0.0.1:4173
 ##[endgroup]
 node:internal/modules/run_main:123
     triggerUncaughtException(
     ^
 locator.waitFor: Timeout 15000ms exceeded.
 Call log:
   - waiting for locator('html[data-offline-ready=\'true\']')
     at /home/runner/work/robys-coffee-house-demo/robys-coffee-house-demo/scripts/verify-offline-browser.mjs:51:57 {
   name: 'TimeoutError'
 }
 Node.js v22.23.1
 ##[error]Process completed with exit code 1.

GitHub Actions: Taste Journey poster contract / TASTE-POSTER-001 full poster gate: Introduce Harmonic Temporal Orientation system and validator

Conclusion: failure

View job details

##[group]Run git diff --exit-code -- discover-rotation.js discover-rotation-v2.js discover-rotation-v3.js discover.html sw.js integrity-manifest.json
 �[36;1mgit diff --exit-code -- discover-rotation.js discover-rotation-v2.js discover-rotation-v3.js discover.html sw.js integrity-manifest.json�[0m
 shell: /usr/bin/bash -e {0}
 ##[endgroup]
 diff --git a/integrity-manifest.json b/integrity-manifest.json
 index 8f1b2c4..d6f3b00 100644
 --- a/integrity-manifest.json
 +++ b/integrity-manifest.json
 @@ -1 +1 @@
 -{"version":1,"algorithm":"sha256","build":"20260626-8","files":[{"path":"404.html","bytes":1199,"sha256":"***REDACTED***"},{"path":"analytics.js","bytes":2920,"sha256":"***REDACTED***"},{"path":"android-app.css","bytes":6328,"sha256":"***REDACTED***"},{"path":"android-download.js","bytes":4870,"sha256":"***REDACTED***"},{"path":"app.js","bytes":32801,"sha256":"***REDACTED***"},{"path":"apple-touch-icon.png","bytes":8499,"sha256":"***REDACTED***"},{"path":"bootstrap.js","bytes":1427,"sha256":"***REDACTED***"},{"path":"community-reel.css","bytes":2970,"sha256":"***REDACTED***"},{"path":"conversion.css","bytes":2973,"sha256":"***REDACTED***"},{"path":"conversion.js","bytes":14441,"sha256":"***REDACTED***"},{"path":"data/featured-products.json","bytes":4027,"sha256":"***REDACTED***"},{"path":"discover-copy.js","bytes":5736,"sha256":"***REDACTED***"},{"path":"discover-journeys-v2.js","bytes":5611,"sha256":"***REDACTED***"},{"path":"discover-journeys.js","bytes":2654,"sha256":"***REDACTED***"},{"path":"discover-rotation-v2.js","bytes":7333,"sha256":"***REDACTED***"},{"path":"discover-rotation-v3.js","bytes":7333,"sha256":"***REDACTED***"},{"path":"discover-rotation.css","bytes":1237,"sha256":"***REDACTED***"},{"path":"discover-rotation.js","bytes":7333,"sha256":"***REDACTED***"},{"path":"discover-v2.js","bytes":7408,"sha256":"***REDACTED***"},{"path":"discover-weather-guard.js","bytes":606,"sha256":"***REDACTED***"},{"path":"discover.css","bytes":7686,"sha256":"***...

GitHub Actions: Taste Journey poster contract / 0_TASTE-POSTER-001 full poster gate.txt: Introduce Harmonic Temporal Orientation system and validator

Conclusion: failure

View job details

##[group]Run git diff --exit-code -- discover-rotation.js discover-rotation-v2.js discover-rotation-v3.js discover.html sw.js integrity-manifest.json
 �[36;1mgit diff --exit-code -- discover-rotation.js discover-rotation-v2.js discover-rotation-v3.js discover.html sw.js integrity-manifest.json�[0m
 shell: /usr/bin/bash -e {0}
 ##[endgroup]
 diff --git a/integrity-manifest.json b/integrity-manifest.json
 index 8f1b2c4..d6f3b00 100644
 --- a/integrity-manifest.json
 +++ b/integrity-manifest.json
 @@ -1 +1 @@
 -{"version":1,"algorithm":"sha256","build":"20260626-8","files":[{"path":"404.html","bytes":1199,"sha256":"***REDACTED***"},{"path":"analytics.js","bytes":2920,"sha256":"***REDACTED***"},{"path":"android-app.css","bytes":6328,"sha256":"***REDACTED***"},{"path":"android-download.js","bytes":4870,"sha256":"***REDACTED***"},{"path":"app.js","bytes":32801,"sha256":"***REDACTED***"},{"path":"apple-touch-icon.png","bytes":8499,"sha256":"***REDACTED***"},{"path":"bootstrap.js","bytes":1427,"sha256":"***REDACTED***"},{"path":"community-reel.css","bytes":2970,"sha256":"***REDACTED***"},{"path":"conversion.css","bytes":2973,"sha256":"***REDACTED***"},{"path":"conversion.js","bytes":14441,"sha256":"***REDACTED***"},{"path":"data/featured-products.json","bytes":4027,"sha256":"***REDACTED***"},{"path":"discover-copy.js","bytes":5736,"sha256":"***REDACTED***"},{"path":"discover-journeys-v2.js","bytes":5611,"sha256":"***REDACTED***"},{"path":"discover-journeys.js","bytes":2654,"sha256":"***REDACTED***"},{"path":"discover-rotation-v2.js","bytes":7333,"sha256":"***REDACTED***"},{"path":"discover-rotation-v3.js","bytes":7333,"sha256":"***REDACTED***"},{"path":"discover-rotation.css","bytes":1237,"sha256":"***REDACTED***"},{"path":"discover-rotation.js","bytes":7333,"sha256":"***REDACTED***"},{"path":"discover-v2.js","bytes":7408,"sha256":"***REDACTED***"},{"path":"discover-weather-guard.js","bytes":606,"sha256":"***REDACTED***"},{"path":"discover.css","bytes":7686,"sha256":"***...
🧰 Additional context used
📓 Path-based instructions (2)
**/*.md

⚙️ CodeRabbit configuration file

**/*.md: Проверяй техническую достоверность команд и контрактов. Не оставляй
косметические замечания, если они не влияют на понимание или выполнение.

Files:

  • docs/harmonic-temporal-orientation-scorecard.md
  • docs/harmonic-temporal-orientation-ci-workflow-template.md
  • docs/harmonic-temporal-orientation-decision-log.md
  • docs/harmonic-temporal-orientation-templates.md
  • docs/harmonic-temporal-orientation-playbook.md
  • docs/harmonic-temporal-orientation-implementation-map.md
  • docs/harmonic-temporal-orientation-system.md
scripts/**

⚙️ CodeRabbit configuration file

scripts/**: Ищи недетерминированность, небезопасную работу с путями и shell quoting,
скрытое ослабление проверок, сетевые зависимости, утечки секретов и случаи,
когда проверка может ложно завершиться успешно.

Files:

  • scripts/test-harmonic-orientation.mjs
  • scripts/validate-harmonic-orientation.mjs
🪛 LanguageTool
docs/harmonic-temporal-orientation-implementation-map.md

[style] ~193-~193: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...t start by mutating active repair PRs. Do not replace human protocol decisions. ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~195-~195: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... not replace human protocol decisions. Do not treat the scorecard as truth. The ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🔇 Additional comments (10)
docs/examples/harmonic-orientation-record.pr188-baseline-allow.json (1)

1-38: LGTM!

docs/examples/harmonic-orientation-record.invalid-score-mismatch.json (1)

1-25: LGTM!

scripts/validate-harmonic-orientation.mjs (1)

1-27: LGTM!

Also applies to: 33-53, 55-73, 85-100, 117-147, 149-200

scripts/test-harmonic-orientation.mjs (1)

1-37: LGTM!

Also applies to: 47-56

package.json (1)

51-52: LGTM!

docs/examples/harmonic-orientation-record.pr188-minify-reject.json (1)

1-100: LGTM!

docs/examples/harmonic-orientation-record.pr186-d6-hold.json (1)

1-39: LGTM!

docs/examples/harmonic-orientation-record.invalid-allow-hard-blocker.json (1)

1-26: LGTM!

docs/examples/harmonic-orientation-record.conflict-escalate.json (1)

5-6: 🎯 Functional Correctness

Замечание неактуально: pr/head_sha не валидируются

scripts/validate-harmonic-orientation.mjs проверяет только наличие этих полей, а не их формат. Для этой фикстуры decision: "escalate" при score 7 также соответствует правилам.

			> Likely an incorrect or invalid review comment.
docs/harmonic-temporal-orientation-system.md (1)

1-427: LGTM!

Comment thread docs/harmonic-temporal-orientation-ci-workflow-template.md
Comment thread docs/harmonic-temporal-orientation-decision-log.md Outdated
Comment thread docs/harmonic-temporal-orientation-implementation-map.md Outdated
Comment thread docs/harmonic-temporal-orientation-implementation-map.md Outdated
Comment thread docs/harmonic-temporal-orientation-playbook.md Outdated
Comment thread package.json Outdated
Comment thread scripts/test-harmonic-orientation.mjs
Comment thread scripts/validate-harmonic-orientation.mjs Outdated
Comment thread scripts/validate-harmonic-orientation.mjs Outdated
Comment thread scripts/validate-harmonic-orientation.mjs Outdated

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Owner Author

@coderabbitai review

Exact head: ebb383b

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

@safal207 Triggering a review against head ebb383b298f2. If this commit was already reviewed, the system will note that; otherwise a fresh review will run.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Owner Author

@coderabbitai review

Exact head: 5d4d3f2

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

@safal207 Triggering a review against head 5d4d3f21b103c.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Owner Author

@coderabbitai review

Current exact head: 670ce733e877c1e60cb9f46761c6f322d8005c02.

Please review the current head after the resolved documentation, validator, blocker-precedence, and negative-fixture changes.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

@safal207 Triggering a review against head 670ce733e877c.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@safal207
safal207 marked this pull request as ready for review July 10, 2026 04:37

Copy link
Copy Markdown
Owner Author

@coderabbitai review

Exact head: 670ce73

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

@safal207 Triggering a review against head 670ce733e877c.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Add Harmonic Temporal Orientation docs, canonical records, and Node validator

✨ Enhancement 📝 Documentation 🧪 Tests 🕐 40+ Minutes

Grey Divider

AI Description

• Add Harmonic Temporal Orientation (HTO) whitepaper, playbook, scorecard, and adoption guidance.
• Define canonical machine-readable orientation record shape and hard-blocker precedence rules.
• Introduce a zero-dependency Node validator with positive/negative fixtures and tests.
Diagram

graph TD
  A["Developer / CI"] --> B["validate-harmonic-orientation.mjs"] --> C["Validation JSON output"]
  A --> D["test-harmonic-orientation.mjs"] --> B --> E[("Orientation record fixtures")]
  B --> F[/"HTO spec & docs"/]

  subgraph Legend
    direction LR
    _actor["Actor"] ~~~ _script["Script"] ~~~ _data[("Data/Fixtures")] ~~~ _doc[/"Docs/Spec"/]
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Adopt JSON Schema + off-the-shelf validator (Ajv)
  • ➕ Formal schema enables broader tooling (editors, CI integrations, auto-generated docs).
  • ➕ Validation coverage can expand with less custom code (types, formats, required/optional fields).
  • ➖ Adds dependencies and lockfile management, which this PR explicitly avoids.
  • ➖ Hard-blocker inference/precedence rules still require custom logic beyond pure schema validation.
2. Use TypeScript with a runtime schema library (zod/valibot)
  • ➕ Strong typing for validator logic; easier refactors as the record evolves.
  • ➕ Clear composition of structural validation and semantic rules.
  • ➖ Build/compile step and dependency footprint increase complexity for a docs-first phase.
  • ➖ Still requires a distribution strategy for running in CI without extra setup.
3. Split validation into (1) structural checks and (2) policy checks
  • ➕ Clearer mental model: schema errors vs governance-rule violations.
  • ➕ Easier to reuse structural validator in other contexts (e.g., editor/PR comment bot).
  • ➖ More moving parts and potentially more files/commands to run.
  • ➖ May be premature until the contract stabilizes.

Recommendation: Keep the current zero-dependency Node implementation for Phase 0/1 adoption (docs-first, easy local execution). If/when the record format stabilizes and more producers/consumers appear, consider layering a JSON Schema for structural validation while retaining the existing custom logic for inferred blockers and decision precedence.

Files changed (23) +2608 / -0

Enhancement (1) +260 / -0
validate-harmonic-orientation.mjsAdd zero-dependency validator CLI + exported validateRecord() API +260/-0

Add zero-dependency validator CLI + exported validateRecord() API

• Introduces the core validator enforcing required top-level fields, decision enum, evidence bucket shapes, score dimension constraints, and total recomputation. Implements hard-blocker enum validation, infers required blockers from objective missing evidence, and enforces precedence rules (blockers override allow/escalate, reject/hold class requirements). Provides a CLI that validates one or more JSON records and prints structured JSON results.

scripts/validate-harmonic-orientation.mjs

Tests (14) +491 / -0
harmonic-orientation-record.conflict-escalate.jsonAdd escalation example record for invariant conflicts +38/-0

Add escalation example record for invariant conflicts

• Introduces a valid canonical record demonstrating an 'escalate' decision when two valid invariants conflict. Includes a full scorecard with no hard blockers and a mid-range total to illustrate escalation as a human tie-break.

docs/examples/harmonic-orientation-record.conflict-escalate.json

harmonic-orientation-record.invalid-allow-hard-blocker.jsonAdd invalid fixture: allow decision with hard blocker present +25/-0

Add invalid fixture: allow decision with hard blocker present

• Adds a negative fixture where the decision is 'allow' despite a declared hard blocker. Intended to assert validator precedence rules: any hard blocker forbids 'allow'.

docs/examples/harmonic-orientation-record.invalid-allow-hard-blocker.json

harmonic-orientation-record.invalid-escalate-hard-blocker.jsonAdd invalid fixture: escalate decision with deterministic hard blocker +24/-0

Add invalid fixture: escalate decision with deterministic hard blocker

• Adds a negative fixture that attempts 'escalate' while a hold-class hard blocker exists. Used to assert the rule that escalation requires zero hard blockers and blockers must be classified first.

docs/examples/harmonic-orientation-record.invalid-escalate-hard-blocker.json

harmonic-orientation-record.invalid-evidence-type.jsonAdd invalid fixture: malformed evidence_before type +24/-0

Add invalid fixture: malformed evidence_before type

• Adds a negative fixture where 'real_graph.evidence_before' is a string instead of an object. Ensures the validator rejects structurally invalid evidence containers.

docs/examples/harmonic-orientation-record.invalid-evidence-type.json

harmonic-orientation-record.invalid-hard-blocker-type.jsonAdd invalid fixture: hard_blockers is not an array +24/-0

Add invalid fixture: hard_blockers is not an array

• Adds a negative fixture where 'scorecard.hard_blockers' is a string rather than an array. Ensures the validator enforces container type correctness for blockers.

docs/examples/harmonic-orientation-record.invalid-hard-blocker-type.json

harmonic-orientation-record.invalid-missing-required-hard-blocker.jsonAdd invalid fixture: missing inferred required hard blocker +24/-0

Add invalid fixture: missing inferred required hard blocker

• Adds a negative fixture where evidence indicates missing trusted exact-head proof, but the required blocker is omitted. Validates that inferred objective blockers must be explicitly listed.

docs/examples/harmonic-orientation-record.invalid-missing-required-hard-blocker.json

harmonic-orientation-record.invalid-missing-scorecard.jsonAdd invalid fixture: missing required scorecard section +13/-0

Add invalid fixture: missing required scorecard section

• Adds a negative fixture that omits the 'scorecard' top-level field. Ensures the validator enforces required top-level canonical fields.

docs/examples/harmonic-orientation-record.invalid-missing-scorecard.json

harmonic-orientation-record.invalid-score-mismatch.jsonAdd invalid fixture: score total does not match dimension sum +25/-0

Add invalid fixture: score total does not match dimension sum

• Adds a negative fixture where score dimension values sum to 10 but 'total' is 9. Ensures validator recomputes totals and rejects mismatches.

docs/examples/harmonic-orientation-record.invalid-score-mismatch.json

harmonic-orientation-record.invalid-total-type.jsonAdd invalid fixture: scorecard total is wrong type +24/-0

Add invalid fixture: scorecard total is wrong type

• Adds a negative fixture where 'scorecard.total' is a string. Asserts that totals must be integers and match the computed dimension sum.

docs/examples/harmonic-orientation-record.invalid-total-type.json

harmonic-orientation-record.invalid-unknown-hard-blocker.jsonAdd invalid fixture: unknown hard blocker enum value +24/-0

Add invalid fixture: unknown hard blocker enum value

• Adds a negative fixture using a non-canonical blocker identifier. Ensures the validator enforces the hard-blocker enum.

docs/examples/harmonic-orientation-record.invalid-unknown-hard-blocker.json

harmonic-orientation-record.pr186-d6-hold.jsonAdd hold example record for missing exact-head prerequisite evidence +38/-0

Add hold example record for missing exact-head prerequisite evidence

• Introduces a valid canonical record demonstrating a 'hold' decision due to missing trusted exact-head bot evidence. Includes a scorecard with the required hold-class blocker and a low total.

docs/examples/harmonic-orientation-record.pr186-d6-hold.json

harmonic-orientation-record.pr188-baseline-allow.jsonAdd allow example record for evidence-backed baseline refresh +38/-0

Add allow example record for evidence-backed baseline refresh

• Introduces a valid canonical record demonstrating an 'allow' decision for a baseline refresh when CI evidence is direct and no hard blockers exist. Provides a full 10/10 scorecard example.

docs/examples/harmonic-orientation-record.pr188-baseline-allow.json

harmonic-orientation-record.pr188-minify-reject.jsonAdd reject example record for unsafe minification transition +100/-0

Add reject example record for unsafe minification transition

• Introduces a valid canonical record demonstrating a 'reject' decision where a local optimization breaks higher-priority invariants. Includes a reject-class hard blocker and detailed before/after evidence buckets.

docs/examples/harmonic-orientation-record.pr188-minify-reject.json

test-harmonic-orientation.mjsAdd fixture-based validator test runner +70/-0

Add fixture-based validator test runner

• Implements a Node script that loads valid/invalid JSON fixtures, runs 'validateRecord', and asserts expected decisions or error substrings. Outputs a compact JSON summary and exits non-zero on any failure.

scripts/test-harmonic-orientation.mjs

Documentation (8) +1857 / -0
harmonic-temporal-orientation-ci-workflow-template.mdDocument an optional GitHub Actions workflow template (inactive) +98/-0

Document an optional GitHub Actions workflow template (inactive)

• Adds a copy-paste workflow template to run the validator and fixture tests on PRs that touch HTO-related files. Explicitly documents why this check is isolated from global 'npm run check' and not yet required.

docs/harmonic-temporal-orientation-ci-workflow-template.md

harmonic-temporal-orientation-decision-log.mdAdd append-only decision log template with examples +207/-0

Add append-only decision log template with examples

• Provides a YAML template for recording real orientation decisions over time and includes worked examples (reject minification, hold seal until evidence). Emphasizes auditability and append-only operational practice.

docs/harmonic-temporal-orientation-decision-log.md

harmonic-temporal-orientation-implementation-map.mdAdd adoption phases and mapping from model to GitHub artifacts +272/-0

Add adoption phases and mapping from model to GitHub artifacts

• Explains how HTO concepts map to PRs, checks, artifacts, and future automation. Defines phased adoption (docs-only through blocking gates) and documents the canonical record structure and validator scope.

docs/harmonic-temporal-orientation-implementation-map.md

harmonic-temporal-orientation-playbook.mdAdd operational playbook for using HTO on PRs and CI repairs +305/-0

Add operational playbook for using HTO on PRs and CI repairs

• Adds practical guidance for constructing records, interpreting decision states, using the scorecard, and handling common transition types. Defines hard-blocker precedence and includes example repair/readiness flows.

docs/harmonic-temporal-orientation-playbook.md

harmonic-temporal-orientation-scorecard.mdDefine scoring dimensions, thresholds, and canonical hard blockers +194/-0

Define scoring dimensions, thresholds, and canonical hard blockers

• Documents the 0–2 scoring model, decision thresholds, and the hard-blocker enum split into hold vs reject classes. Clarifies precedence rules: blockers override score; escalation requires zero blockers.

docs/harmonic-temporal-orientation-scorecard.md

harmonic-temporal-orientation-spec.yamlAdd machine-readable HTO spec including schema and blocker policy +115/-0

Add machine-readable HTO spec including schema and blocker policy

• Defines a YAML specification for the canonical orientation record shape, allowed enum values, score rules, and hard-blocker inference/precedence policy. Serves as a reference contract for tooling and future automation.

docs/harmonic-temporal-orientation-spec.yaml

harmonic-temporal-orientation-system.mdAdd HTO whitepaper describing the 7-graph model and decision loop +426/-0

Add HTO whitepaper describing the 7-graph model and decision loop

• Introduces the conceptual model (Project/Transition/Real/Orientation/Traitjectory/Observer/Tuner graphs) and explains how it prevents shallow fixes. Includes mermaid diagrams for the full model and state machine.

docs/harmonic-temporal-orientation-system.md

harmonic-temporal-orientation-templates.mdAdd copy/paste templates for PR comments, seals, baselines, and evidence +240/-0

Add copy/paste templates for PR comments, seals, baselines, and evidence

• Provides reusable YAML/Markdown templates for recording orientation decisions, baseline refreshes, bot evidence checks, seal readiness, merge readiness, observer notes, and tuner rules. Designed for consistent human practice before automation.

docs/harmonic-temporal-orientation-templates.md

@qodo-code-review

qodo-code-review Bot commented Jul 10, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 11 rules

Grey Divider


Remediation recommended

1. Evidence shape under-validated ✓ Resolved 🐞 Bug ≡ Correctness
Description
validateEvidenceShape() treats real_graph.evidence_after as optional and does not require
green/red/missing buckets to exist, so records can validate while violating the documented
canonical record structure.
Code

scripts/validate-harmonic-orientation.mjs[R78-98]

+function validateEvidenceObject(value, errors, fieldName, required = false) {
+  if (value == null) {
+    if (required) pushError(errors, `${fieldName} is required.`);
+    return;
+  }
+  if (typeof value !== "object" || Array.isArray(value)) {
+    pushError(errors, `${fieldName} must be an object when present.`);
+    return;
+  }
+  for (const bucket of ["green", "red", "missing"]) {
+    if (bucket in value && !Array.isArray(value[bucket])) {
+      pushError(errors, `${fieldName}.${bucket} must be an array when present.`);
+    }
+  }
+}
+
+/** Validate before/after evidence containers. */
+function validateEvidenceShape(record, errors) {
+  validateEvidenceObject(record.real_graph?.evidence_before, errors, "real_graph.evidence_before", true);
+  validateEvidenceObject(record.real_graph?.evidence_after, errors, "real_graph.evidence_after");
+}
Relevance

⭐⭐⭐ High

Team frequently tightens validators to fail-closed vs spec (accepted similar “tighten validation”
changes in PRs #148/#132).

PR-#148
PR-#132

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The implementation map defines real_graph.evidence_before and real_graph.evidence_after with
explicit green/red/missing arrays, but the validator only requires evidence_before and only
validates buckets if present.

scripts/validate-harmonic-orientation.mjs[78-98]
docs/harmonic-temporal-orientation-implementation-map.md[118-177]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The canonical record shape documents both `real_graph.evidence_before` and `real_graph.evidence_after` with required `green`, `red`, and `missing` array buckets. The validator currently:
- requires `evidence_before` only to be an object
- allows `evidence_after` to be absent
- only type-checks buckets if the keys are present

This can allow incomplete or structurally divergent records to pass.

## Issue Context
The docs present the canonical JSON contract as the current schema (not a future adapter). The validator should enforce that shape if the goal is structural completeness.

## Fix Focus Areas
- scripts/validate-harmonic-orientation.mjs[78-98]
- docs/harmonic-temporal-orientation-implementation-map.md[118-177]

## Suggested fix
1. Make `real_graph.evidence_after` required (pass `required=true`).
2. In `validateEvidenceObject`, require that `green`, `red`, and `missing` keys exist (not just validate them when present) and that each is an array.
3. Add/update a negative fixture that omits `evidence_after` or omits one bucket to ensure the validator fails deterministically.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. High-score allow not enforced ✓ Resolved 🐞 Bug ≡ Correctness
Description
validateScorecard() blocks allow for scores ≤7 (when no hard blockers exist) but does not enforce
the documented policy that scores 8–10 with zero hard blockers must be allow, so policy-mismatched
decisions can pass validation.
Code

scripts/validate-harmonic-orientation.mjs[R181-186]

+  if (knownBlockers.length === 0 && computedTotal >= 5 && computedTotal <= 7 && !["hold", "reject", "escalate"].includes(decision)) {
+    pushError(errors, `Score is ${computedTotal}; expected hold/reject/escalate, got ${decision}.`);
+  }
+  if (knownBlockers.length === 0 && computedTotal <= 4 && !["reject", "hold", "escalate"].includes(decision)) {
+    pushError(errors, `Score is ${computedTotal}; expected reject/hold/escalate, got ${decision}.`);
+  }
Relevance

⭐⭐⭐ High

Repo history shows adding stricter policy enforcement to validators is accepted (e.g.,
capacity/policy validation accepted in PR #151).

PR-#151

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The validator only restricts allow for scores ≤7, while the spec explicitly defines that allow
corresponds to score 8–10 with no hard blockers.

scripts/validate-harmonic-orientation.mjs[181-186]
docs/harmonic-temporal-orientation-spec.yaml[95-106]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The validator currently enforces that low/medium scores cannot be `allow`, but it does not enforce the corresponding high-score rule. This allows records with `computedTotal >= 8` and zero hard blockers to validate even if `orientation_center.decision` is `hold`, `reject`, or `escalate`, which contradicts the documented `score_policy`.

## Issue Context
The spec defines `allow: score_8_to_10_and_no_hard_blocker`, but the implementation only checks the ≤7 cases.

## Fix Focus Areas
- scripts/validate-harmonic-orientation.mjs[181-186]
- docs/harmonic-temporal-orientation-spec.yaml[95-106]

## Suggested fix
Add a check similar to the existing ones:
- If `knownBlockers.length === 0 && computedTotal >= 8` then require `decision === "allow"` (and emit a deterministic error otherwise).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

3. Validator CLI strings not localized 📘 Rule violation ≡ Correctness
Description
The new Harmonic Orientation validator emits hard-coded English usage/errors (e.g., Usage: ...,
Scorecard total mismatch ...) with no tr/ru variants via the project’s localization mechanism.
This violates the requirement that new user-facing text support Turkish, English, and Russian.
Code

scripts/validate-harmonic-orientation.mjs[R126-234]

+    pushError(errors, "scorecard must be an object.");
+    return null;
+  }
+
+  const scorecard = record.scorecard;
+  const scores = scorecard.scores;
+  if (!scores || typeof scores !== "object" || Array.isArray(scores)) {
+    pushError(errors, "scorecard.scores must be an object.");
+    return null;
+  }
+
+  let computedTotal = 0;
+  for (const dimension of SCORE_DIMENSIONS) {
+    const value = scores[dimension]?.value;
+    if (!Number.isInteger(value) || value < 0 || value > 2) {
+      pushError(errors, `Invalid scorecard.scores.${dimension}.value: expected integer 0..2.`);
+      continue;
+    }
+    computedTotal += value;
+  }
+
+  if (!Number.isInteger(scorecard.total) || scorecard.total !== computedTotal) {
+    pushError(errors, `Scorecard total mismatch: declared ${JSON.stringify(scorecard.total)}, computed ${computedTotal}.`);
+  }
+
+  const hardBlockers = asArray(scorecard.hard_blockers, errors, "scorecard.hard_blockers");
+  const knownBlockers = [];
+  for (const blocker of hardBlockers) {
+    if (typeof blocker !== "string" || !HARD_BLOCKERS.has(blocker)) {
+      pushError(errors, `Unknown hard blocker: ${JSON.stringify(blocker)}.`);
+    } else {
+      knownBlockers.push(blocker);
+    }
+  }
+
+  for (const expected of expectedHardBlockers(record)) {
+    if (!knownBlockers.includes(expected)) pushError(errors, `Missing required hard blocker: ${expected}.`);
+  }
+
+  const decision = record.orientation_center?.decision;
+  const hasRejectBlocker = knownBlockers.some((blocker) => REJECT_BLOCKERS.has(blocker));
+  const hasHoldBlocker = knownBlockers.some((blocker) => HOLD_BLOCKERS.has(blocker));
+
+  if (knownBlockers.length > 0 && decision === "allow") {
+    pushError(errors, "Hard blockers are present, but decision is allow.");
+  }
+  if (knownBlockers.length > 0 && decision === "escalate") {
+    pushError(errors, "Hard blockers are present, but decision is escalate; classify them as hold or reject first.");
+  }
+  if (hasRejectBlocker && decision !== "reject") {
+    pushError(errors, "Reject-class hard blocker requires decision reject.");
+  } else if (!hasRejectBlocker && hasHoldBlocker && decision !== "hold") {
+    pushError(errors, "Hold-class hard blocker requires decision hold.");
+  }
+
+  if (knownBlockers.length === 0 && computedTotal >= 5 && computedTotal <= 7 && !["hold", "reject", "escalate"].includes(decision)) {
+    pushError(errors, `Score is ${computedTotal}; expected hold/reject/escalate, got ${decision}.`);
+  }
+  if (knownBlockers.length === 0 && computedTotal <= 4 && !["reject", "hold", "escalate"].includes(decision)) {
+    pushError(errors, `Score is ${computedTotal}; expected reject/hold/escalate, got ${decision}.`);
+  }
+
+  return { computed_total: computedTotal, hard_blockers: knownBlockers };
+}
+
+/** Validate one in-memory orientation record and return a structured result. */
+export function validateRecord(record, source = "<memory>") {
+  const errors = [];
+  const warnings = [];
+
+  if (!record || typeof record !== "object" || Array.isArray(record)) {
+    return { source, ok: false, errors: ["Record must be a JSON object."], warnings };
+  }
+
+  validateRequiredFields(record, errors);
+  validateDecision(record, errors);
+  validateEvidenceShape(record, errors);
+  const scoreSummary = validateScorecard(record, errors);
+
+  return {
+    source,
+    id: record.id,
+    pr: record.pr,
+    head_sha: record.head_sha,
+    decision: record.orientation_center?.decision,
+    score: scoreSummary?.computed_total ?? null,
+    hard_blockers: scoreSummary?.hard_blockers ?? [],
+    ok: errors.length === 0,
+    errors,
+    warnings,
+  };
+}
+
+/** Read and parse one JSON fixture. */
+async function readJson(filePath) {
+  const raw = await readFile(filePath, "utf8");
+  try {
+    return JSON.parse(raw);
+  } catch (error) {
+    throw new Error(`Failed to parse JSON in ${filePath}: ${error.message}`);
+  }
+}
+
+/** Run the CLI validator for one or more JSON records. */
+async function main() {
+  const inputs = process.argv.slice(2);
+  if (inputs.length === 0) {
+    console.error("Usage: node scripts/validate-harmonic-orientation.mjs <orientation-record.json> [...more.json]");
+    process.exit(2);
Relevance

⭐ Low

Similar “remove hard-coded user-facing strings for i18n” feedback was rejected in PR #173; scripts
aren’t consistently localized.

PR-#173

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 1540302 requires all newly introduced user-facing text to have tr/en/ru
support and to avoid hard-coded strings. The new validator script introduces multiple hard-coded
English usage and error messages, while the repo’s i18n model explicitly targets tr, en, and
ru locales.

Rule 1540302: User-facing content must support three specified languages
scripts/validate-harmonic-orientation.mjs[126-234]
src/i18n.ts[1-3]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
New user-facing CLI strings were introduced in `scripts/validate-harmonic-orientation.mjs` (usage text and validation errors), but they are hard-coded in English. Compliance requires Turkish (`tr`), English (`en`), and Russian (`ru`) variants via the project i18n approach.

## Issue Context
The repo already uses a `tr`/`en`/`ru` localization model (e.g., `src/i18n.ts` defines `Lang = "tr" | "en" | "ru"`). The validator should either:
- accept a `--lang tr|en|ru` flag (or infer from `LANG`/`LC_ALL`) and
- source all user-facing messages from a translation table that includes `tr`, `en`, and `ru`.

## Fix Focus Areas
- scripts/validate-harmonic-orientation.mjs[42-234]
- scripts/test-harmonic-orientation.mjs[29-56]
- src/i18n.ts[1-3]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment thread scripts/validate-harmonic-orientation.mjs Outdated
Comment thread scripts/validate-harmonic-orientation.mjs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/harmonic-temporal-orientation-playbook.md`:
- Around line 17-19: Уточните в документации, что приведённый YAML-блок является
человекочитаемым шаблоном и перед передачей в validate-harmonic-orientation.mjs
его необходимо сериализовать в canonical JSON, либо замените пример на
корректный JSON. Обновите формулировку рядом с разделом о canonical orientation
record, чтобы не утверждать, что валидатор напрямую принимает YAML.

In `@docs/harmonic-temporal-orientation-spec.yaml`:
- Around line 102-106: Сделайте score policy исполняемой в validateScorecard:
после проверки суммы и hard-blocker precedence сопоставляйте scorecard.total с
orientation_center.decision согласно score_policy (allow только для 8–10, hold
для 0–7 при prerequisite/hold blocker, reject при reject blocker, escalate при
конфликтующих инвариантах без hard blocker). Добавьте негативные fixtures и
тесты для недопустимых сочетаний score и decision, включая total: 0 с decision:
allow.

In `@scripts/validate-harmonic-orientation.mjs`:
- Around line 59-64: Обновите `validateRequiredFields`, чтобы помимо наличия
проверять, что `project_graph`, `transition_graph`, `observer_graph` и
`tuner_graph` являются непустыми объектами, не массивами и не `null`; добавляйте
ошибку через `pushError` при неверном типе, сохранив существующую проверку
отсутствующих полей.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a3058287-db6f-44bc-9554-4936a5596cbf

📥 Commits

Reviewing files that changed from the base of the PR and between 10c4017 and 670ce73.

📒 Files selected for processing (15)
  • docs/examples/harmonic-orientation-record.invalid-escalate-hard-blocker.json
  • docs/examples/harmonic-orientation-record.invalid-evidence-type.json
  • docs/examples/harmonic-orientation-record.invalid-hard-blocker-type.json
  • docs/examples/harmonic-orientation-record.invalid-missing-required-hard-blocker.json
  • docs/examples/harmonic-orientation-record.invalid-missing-scorecard.json
  • docs/examples/harmonic-orientation-record.invalid-total-type.json
  • docs/examples/harmonic-orientation-record.invalid-unknown-hard-blocker.json
  • docs/harmonic-temporal-orientation-ci-workflow-template.md
  • docs/harmonic-temporal-orientation-decision-log.md
  • docs/harmonic-temporal-orientation-implementation-map.md
  • docs/harmonic-temporal-orientation-playbook.md
  • docs/harmonic-temporal-orientation-scorecard.md
  • docs/harmonic-temporal-orientation-spec.yaml
  • scripts/test-harmonic-orientation.mjs
  • scripts/validate-harmonic-orientation.mjs
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
  • GitHub Check: CodeRabbit / Review
  • GitHub Check: CodeRabbit / Review
  • GitHub Check: CodeRabbit / Review
  • GitHub Check: VISUAL-001 screenshot diff
⚠️ CI failures not shown inline (2)

GitHub Actions: Adversarial browser contract / ADV-001 browser probes: Introduce Harmonic Temporal Orientation system and validator

Conclusion: failure

View job details

##[group]Run python3 -m http.server 4173 --bind 127.0.0.1 > .artifacts/offline-server.log 2>&1 &
 �[36;1mpython3 -m http.server 4173 --bind 127.0.0.1 > .artifacts/offline-server.log 2>&1 &�[0m
 �[36;1mfor attempt in {1..30}; do�[0m
 �[36;1m  if curl --fail --silent http://127.0.0.1:4173/index.html > /dev/null; then�[0m
 �[36;1m    break�[0m
 �[36;1m  fi�[0m
 �[36;1m  sleep 1�[0m
 �[36;1mdone�[0m
 �[36;1mset -o pipefail�[0m
 �[36;1mnode scripts/verify-offline-browser.mjs 2>&1 | tee .artifacts/offline-android.log�[0m
 shell: /usr/bin/bash -e {0}
 env:
   BASE_URL: http://127.0.0.1:4173
 ##[endgroup]
 node:internal/modules/run_main:123
     triggerUncaughtException(
     ^
 locator.waitFor: Timeout 15000ms exceeded.
 Call log:
   - waiting for locator('html[data-offline-ready=\'true\']')
     at /home/runner/work/robys-coffee-house-demo/robys-coffee-house-demo/scripts/verify-offline-browser.mjs:51:57 {
   name: 'TimeoutError'
 }
 Node.js v22.23.1
 ##[error]Process completed with exit code 1.

GitHub Actions: Adversarial browser contract / 1_ADV-001 browser probes.txt: Introduce Harmonic Temporal Orientation system and validator

Conclusion: failure

View job details

##[group]Run python3 -m http.server 4173 --bind 127.0.0.1 > .artifacts/offline-server.log 2>&1 &
 �[36;1mpython3 -m http.server 4173 --bind 127.0.0.1 > .artifacts/offline-server.log 2>&1 &�[0m
 �[36;1mfor attempt in {1..30}; do�[0m
 �[36;1m  if curl --fail --silent http://127.0.0.1:4173/index.html > /dev/null; then�[0m
 �[36;1m    break�[0m
 �[36;1m  fi�[0m
 �[36;1m  sleep 1�[0m
 �[36;1mdone�[0m
 �[36;1mset -o pipefail�[0m
 �[36;1mnode scripts/verify-offline-browser.mjs 2>&1 | tee .artifacts/offline-android.log�[0m
 shell: /usr/bin/bash -e {0}
 env:
   BASE_URL: http://127.0.0.1:4173
 ##[endgroup]
 node:internal/modules/run_main:123
     triggerUncaughtException(
     ^
 locator.waitFor: Timeout 15000ms exceeded.
 Call log:
   - waiting for locator('html[data-offline-ready=\'true\']')
     at /home/runner/work/robys-coffee-house-demo/robys-coffee-house-demo/scripts/verify-offline-browser.mjs:51:57 {
   name: 'TimeoutError'
 }
 Node.js v22.23.1
 ##[error]Process completed with exit code 1.
🧰 Additional context used
📓 Path-based instructions (2)
**/*.md

⚙️ CodeRabbit configuration file

**/*.md: Проверяй техническую достоверность команд и контрактов. Не оставляй
косметические замечания, если они не влияют на понимание или выполнение.

Files:

  • docs/harmonic-temporal-orientation-ci-workflow-template.md
  • docs/harmonic-temporal-orientation-decision-log.md
  • docs/harmonic-temporal-orientation-scorecard.md
  • docs/harmonic-temporal-orientation-playbook.md
  • docs/harmonic-temporal-orientation-implementation-map.md
scripts/**

⚙️ CodeRabbit configuration file

scripts/**: Ищи недетерминированность, небезопасную работу с путями и shell quoting,
скрытое ослабление проверок, сетевые зависимости, утечки секретов и случаи,
когда проверка может ложно завершиться успешно.

Files:

  • scripts/test-harmonic-orientation.mjs
  • scripts/validate-harmonic-orientation.mjs
🔇 Additional comments (15)
docs/harmonic-temporal-orientation-spec.yaml (1)

8-100: LGTM!

Also applies to: 108-112

docs/harmonic-temporal-orientation-implementation-map.md (1)

42-262: LGTM!

docs/harmonic-temporal-orientation-playbook.md (1)

77-280: LGTM!

docs/harmonic-temporal-orientation-scorecard.md (1)

3-194: LGTM!

docs/harmonic-temporal-orientation-decision-log.md (1)

150-150: LGTM!

docs/examples/harmonic-orientation-record.invalid-evidence-type.json (1)

1-24: LGTM!

docs/examples/harmonic-orientation-record.invalid-hard-blocker-type.json (1)

1-24: LGTM!

docs/examples/harmonic-orientation-record.invalid-escalate-hard-blocker.json (1)

1-24: LGTM!

docs/examples/harmonic-orientation-record.invalid-missing-required-hard-blocker.json (1)

1-24: LGTM!

docs/examples/harmonic-orientation-record.invalid-missing-scorecard.json (1)

1-13: LGTM!

docs/examples/harmonic-orientation-record.invalid-total-type.json (1)

1-24: LGTM!

docs/examples/harmonic-orientation-record.invalid-unknown-hard-blocker.json (1)

1-24: LGTM!

scripts/validate-harmonic-orientation.mjs (1)

7-18: LGTM!

Also applies to: 31-31, 41-57, 66-76, 77-121, 123-189, 191-217, 219-253

scripts/test-harmonic-orientation.mjs (1)

6-22: LGTM!

Also applies to: 24-37, 39-58, 60-70

docs/harmonic-temporal-orientation-ci-workflow-template.md (1)

7-20: LGTM!

Also applies to: 30-75, 77-98

Comment thread docs/harmonic-temporal-orientation-playbook.md Outdated
Comment thread docs/harmonic-temporal-orientation-spec.yaml Outdated
Comment thread scripts/validate-harmonic-orientation.mjs Outdated
@safal207
safal207 marked this pull request as draft July 10, 2026 06:27

Copy link
Copy Markdown
Owner Author

Disposition: accepted
Head: 35b3105

Exact-head remediation summary:

  • Playbook now states that the validator accepts canonical JSON only; YAML is drafting-only.
  • Score policy is executable: score 8..10 with zero blockers requires allow; score 0..7 forbids allow.
  • Required graph containers must be non-empty objects.
  • Both evidence snapshots and all green/red/missing buckets are required.
  • Negative tests cover low-score allow, high-score hold, invalid graph shape, missing evidence snapshot, and missing evidence bucket.
  • orientation-center is now an explicit actor enum value used by the existing canonical examples.

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

@safal207 Triggering review against head 35b3105eb08fc2.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Owner Author

@coderabbitai review

Exact head remains 35b3105eb08fc255bc1503e1263099ad91e9769d. The AI review contract is waiting specifically for native exact-head CodeRabbit evidence; no new commits were added after this request.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

@safal207: Head 35b3105eb08fc2 unchanged since the last trigger (invocation dcfe3cb8) — this run will hit the same incremental-review path and return the same "already reviewed" note, not new evidence. There is no CodeRabbit mechanism that produces distinct "native exact-head" attestation beyond that finished-review response.

To get a fresh review pass on this exact head, either:

  1. @coderabbitai pause then @coderabbitai review (forces re-review even on already-seen commits), or
  2. push a new commit (even trivial, e.g. whitespace) to get a genuinely new head to review.

Triggering as requested below.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Owner Author

Disposition: rejected-with-evidence
Head: 35b3105
Finding: Lighthouse regression on Total JS.

Evidence:

  • Mobile and desktop report Total JS 22 KB vs baseline 21 KB (+7.69%).
  • Performance, LCP, TBT, CLS, hero metrics, and all hard assertions pass.
  • The exact PR diff contains only docs/** and scripts/{validate,test}-harmonic-orientation.mjs; it changes no runtime JS, CSS, HTML, service worker, or Lighthouse baseline file.

Conclusion: the Lighthouse red is a pre-existing runtime/baseline condition and is not attributable to PR #189. This PR will not minify runtime or weaken the baseline to hide that debt.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/harmonic-temporal-orientation-spec.yaml`:
- Around line 49-54: Поле actor_values в схеме не enforced: добавьте в
scripts/validate-harmonic-orientation.mjs проверку наличия record.actor и его
соответствия enum actor_values, либо удалите actor_values из схемы;
синхронизируйте схему и валидатор, чтобы значение orientation-center проверялось
единообразно.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 53f6a367-fdbd-4608-bfd4-8fa45b7676a6

📥 Commits

Reviewing files that changed from the base of the PR and between 670ce73 and 35b3105.

📒 Files selected for processing (7)
  • docs/examples/harmonic-orientation-record.invalid-high-score-hold.json
  • docs/examples/harmonic-orientation-record.invalid-low-score-allow.json
  • docs/examples/harmonic-orientation-record.invalid-top-level-object-type.json
  • docs/harmonic-temporal-orientation-playbook.md
  • docs/harmonic-temporal-orientation-spec.yaml
  • scripts/test-harmonic-orientation.mjs
  • scripts/validate-harmonic-orientation.mjs
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: profiles / profile (desktop)
  • GitHub Check: profiles / profile (mobile)
  • GitHub Check: CodeRabbit / Review
  • GitHub Check: Verify exact-head independent review
  • GitHub Check: DAST-001 passive web scan
⚠️ CI failures not shown inline (4)

GitHub Actions: Bot review disposition contract / 0_REVIEW-LEDGER exact-head findings.txt: Introduce Harmonic Temporal Orientation system and validator

Conclusion: failure

View job details

##[group]Run actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b
 with:
   script: const owner = context.repo.owner;
const repo = context.repo.repo;
const payloadPr = context.payload.pull_request;
const issuePr = context.payload.issue?.pull_request;
const prNumber = payloadPr?.number ?? (issuePr ? context.payload.issue.number : null);
if (!prNumber) {
  core.notice('Event is not associated with a pull request.');
  return;
}
const pr = (await github.rest.pulls.get({ owner, repo, pull_number: prNumber })).data;
const head = pr.head.sha.toLowerCase();
const [reviewComments, reviews, issueComments, statuses] = await Promise.all([
  github.paginate(
    github.rest.pulls.listReviewComments,
    { owner, repo, pull_number: prNumber, per_page: 100 },
  ),
  github.paginate(
    github.rest.pulls.listReviews,
    { owner, repo, pull_number: prNumber, per_page: 100 },
  ),
  github.paginate(
    github.rest.issues.listComments,
    { owner, repo, issue_number: prNumber, per_page: 100 },
  ),
  github.paginate(
    github.rest.repos.listCommitStatusesForRef,
    { owner, repo, ref: head, per_page: 100 },
  ),
]);
const reviewHeads = new Map(
  reviews.map((review) => [review.id, review.commit_id?.toLowerCase()]),
);
const reviewBots = new Set([
  'chatgpt-codex-connector',
  'chatgpt-codex-connector[bot]',
  'coderabbitai',
  'coderabbitai[bot]',
  'github-advanced-security',
  'github-advanced-security[bot]',
]);
const trustedAssociations = new Set(['OWNER', 'MEMBER', 'COLLABORATOR']);
const exactHeadBody = (body) => new RegExp(`(^|[^0-9a-f])${head}([^0-9a-f]|$)`, 'i').test(body ?? '');
const timeOf = (item) => Math.max(
  0,
  ...[item.submitted_at, item.created_at, item.updated_at]
    .map((value) => Date.parse(value ?? 0))
    .filter(Number.isFinite),
);
const isDispositionReply = (reply) => {
  const body = (reply.body ?? '').replaceAll('`', '');
  const disposition = /^Disposition:\s*(accepted|rejected-with-evidence|superseded)\s*$/im.test(body);
  cons...

GitHub Actions: Bot review disposition contract / REVIEW-LEDGER exact-head findings: Introduce Harmonic Temporal Orientation system and validator

Conclusion: failure

View job details

##[group]Run actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b
 with:
   script: const owner = context.repo.owner;
const repo = context.repo.repo;
const payloadPr = context.payload.pull_request;
const issuePr = context.payload.issue?.pull_request;
const prNumber = payloadPr?.number ?? (issuePr ? context.payload.issue.number : null);
if (!prNumber) {
  core.notice('Event is not associated with a pull request.');
  return;
}
const pr = (await github.rest.pulls.get({ owner, repo, pull_number: prNumber })).data;
const head = pr.head.sha.toLowerCase();
const [reviewComments, reviews, issueComments, statuses] = await Promise.all([
  github.paginate(
    github.rest.pulls.listReviewComments,
    { owner, repo, pull_number: prNumber, per_page: 100 },
  ),
  github.paginate(
    github.rest.pulls.listReviews,
    { owner, repo, pull_number: prNumber, per_page: 100 },
  ),
  github.paginate(
    github.rest.issues.listComments,
    { owner, repo, issue_number: prNumber, per_page: 100 },
  ),
  github.paginate(
    github.rest.repos.listCommitStatusesForRef,
    { owner, repo, ref: head, per_page: 100 },
  ),
]);
const reviewHeads = new Map(
  reviews.map((review) => [review.id, review.commit_id?.toLowerCase()]),
);
const reviewBots = new Set([
  'chatgpt-codex-connector',
  'chatgpt-codex-connector[bot]',
  'coderabbitai',
  'coderabbitai[bot]',
  'github-advanced-security',
  'github-advanced-security[bot]',
]);
const trustedAssociations = new Set(['OWNER', 'MEMBER', 'COLLABORATOR']);
const exactHeadBody = (body) => new RegExp(`(^|[^0-9a-f])${head}([^0-9a-f]|$)`, 'i').test(body ?? '');
const timeOf = (item) => Math.max(
  0,
  ...[item.submitted_at, item.created_at, item.updated_at]
    .map((value) => Date.parse(value ?? 0))
    .filter(Number.isFinite),
);
const isDispositionReply = (reply) => {
  const body = (reply.body ?? '').replaceAll('`', '');
  const disposition = /^Disposition:\s*(accepted|rejected-with-evidence|superseded)\s*$/im.test(body);
  cons...

GitHub Actions: Adversarial browser contract / 0_ADV-001 browser probes.txt: Introduce Harmonic Temporal Orientation system and validator

Conclusion: failure

View job details

##[group]Run python3 -m http.server 4173 --bind 127.0.0.1 > .artifacts/offline-server.log 2>&1 &
 �[36;1mpython3 -m http.server 4173 --bind 127.0.0.1 > .artifacts/offline-server.log 2>&1 &�[0m
 �[36;1mfor attempt in {1..30}; do�[0m
 �[36;1m  if curl --fail --silent http://127.0.0.1:4173/index.html > /dev/null; then�[0m
 �[36;1m    break�[0m
 �[36;1m  fi�[0m
 �[36;1m  sleep 1�[0m
 �[36;1mdone�[0m
 �[36;1mset -o pipefail�[0m
 �[36;1mnode scripts/verify-offline-browser.mjs 2>&1 | tee .artifacts/offline-android.log�[0m
 shell: /usr/bin/bash -e {0}
 env:
   BASE_URL: http://127.0.0.1:4173
 ##[endgroup]
 node:internal/modules/run_main:123
     triggerUncaughtException(
     ^
 locator.waitFor: Timeout 15000ms exceeded.
 Call log:
   - waiting for locator('html[data-offline-ready=\'true\']')
     at /home/runner/work/robys-coffee-house-demo/robys-coffee-house-demo/scripts/verify-offline-browser.mjs:51:57 {
   name: 'TimeoutError'
 }
 Node.js v22.23.1
 ##[error]Process completed with exit code 1.

GitHub Actions: Adversarial browser contract / ADV-001 browser probes: Introduce Harmonic Temporal Orientation system and validator

Conclusion: failure

View job details

##[group]Run python3 -m http.server 4173 --bind 127.0.0.1 > .artifacts/offline-server.log 2>&1 &
 �[36;1mpython3 -m http.server 4173 --bind 127.0.0.1 > .artifacts/offline-server.log 2>&1 &�[0m
 �[36;1mfor attempt in {1..30}; do�[0m
 �[36;1m  if curl --fail --silent http://127.0.0.1:4173/index.html > /dev/null; then�[0m
 �[36;1m    break�[0m
 �[36;1m  fi�[0m
 �[36;1m  sleep 1�[0m
 �[36;1mdone�[0m
 �[36;1mset -o pipefail�[0m
 �[36;1mnode scripts/verify-offline-browser.mjs 2>&1 | tee .artifacts/offline-android.log�[0m
 shell: /usr/bin/bash -e {0}
 env:
   BASE_URL: http://127.0.0.1:4173
 ##[endgroup]
 node:internal/modules/run_main:123
     triggerUncaughtException(
     ^
 locator.waitFor: Timeout 15000ms exceeded.
 Call log:
   - waiting for locator('html[data-offline-ready=\'true\']')
     at /home/runner/work/robys-coffee-house-demo/robys-coffee-house-demo/scripts/verify-offline-browser.mjs:51:57 {
   name: 'TimeoutError'
 }
 Node.js v22.23.1
 ##[error]Process completed with exit code 1.
🧰 Additional context used
📓 Path-based instructions (2)
scripts/**

⚙️ CodeRabbit configuration file

scripts/**: Ищи недетерминированность, небезопасную работу с путями и shell quoting,
скрытое ослабление проверок, сетевые зависимости, утечки секретов и случаи,
когда проверка может ложно завершиться успешно.

Files:

  • scripts/test-harmonic-orientation.mjs
  • scripts/validate-harmonic-orientation.mjs
**/*.md

⚙️ CodeRabbit configuration file

**/*.md: Проверяй техническую достоверность команд и контрактов. Не оставляй
косметические замечания, если они не влияют на понимание или выполнение.

Files:

  • docs/harmonic-temporal-orientation-playbook.md
🔇 Additional comments (19)
docs/harmonic-temporal-orientation-spec.yaml (5)

27-60: Все три прошлых major-замечания по этому блоку устранены.

scorecard теперь в required_fields (line 41), required_non_empty_objects соответствует OBJECT_TOP_LEVEL_FIELDS в валидаторе. Хорошо синхронизировано.


61-70: LGTM!


87-120: Precedence-правило для hard_blockers теперь явно зафиксировано.

Добавлены any_hard_blocker_forbids_allow/escalate, any_reject_class_blocker_requires_reject, otherwise_any_hold_class_blocker_requires_hold, score_policy_applies_only_when_no_hard_blocker_exists — соответствует реализации в validateScorecard (lines 191-201 валидатора). Прошлое major-замечание устранено.


121-135: Score policy теперь исполняема и соответствует валидатору.

Диапазоны score_8_to_10/score_0_to_7 совпадают с проверками computedTotal >= 8/<= 7 в validateScorecard (lines 203-208 валидатора). Прошлое major-замечание устранено.


136-146: LGTM!

docs/harmonic-temporal-orientation-playbook.md (4)

15-79: Каноническая схема синхронизирована, YAML/JSON разграничение явное.

Пример теперь использует top-level поля, совпадающие с валидатором (id, time_utc, head_sha, project_graph, transition_graph, real_graph, orientation_center, observer_graph, tuner_graph, scorecard), а строка 17 явно указывает, что валидатор принимает только JSON и YAML требует сериализации. Оба прошлых major-замечания устранены.


93-106: Score policy в тексте точно отражает реализацию валидатора.

Текстовое правило (score 8-10 with zero blockers -> allow is required, score 0-7 with zero blockers -> allow is forbidden) технически совпадает с validateScorecard. As per path instructions: **/*.md: «Проверяй техническую достоверность команд и контрактов.»


152-179: Команды и пути к фикстурам корректны.

Все перечисленные скрипты (scripts/validate-harmonic-orientation.mjs, scripts/test-harmonic-orientation.mjs) и JSON-фикстуры присутствуют в PR. As per path instructions: **/*.md: «Проверяй техническую достоверность команд и контрактов.»


109-203: LGTM!

docs/examples/harmonic-orientation-record.invalid-high-score-hold.json (1)

1-27: Фикстура корректно провоцирует ожидаемую ошибку.

Score 10, hard_blockers: [], decision: "hold" → должно триггерить "Score is 10; expected allow, got hold.", что содержит ожидаемую в тесте подстроку "expected allow". Согласуется с scripts/test-harmonic-orientation.mjs (INVALID_FIXTURES).

docs/examples/harmonic-orientation-record.invalid-low-score-allow.json (1)

1-27: LGTM!

docs/examples/harmonic-orientation-record.invalid-top-level-object-type.json (1)

1-27: Фикстура изолирует именно тип-ошибку project_graph.

project_graph: null при прочих валидных графах и score в допустимом для hold диапазоне (6, 0-7) не триггерит побочных score/blocker ошибок — тест проверяет ровно "project_graph must be a non-empty object".

scripts/test-harmonic-orientation.mjs (3)

12-25: Прошлый nitpick устранён.

Каждая запись INVALID_FIXTURES теперь несёт своё expectedError, а assertValidationError проверяет конкретную причину отказа вместо простого errors.length > 0. As per path instructions: scripts/**: «Ищи... случаи, когда проверка может ложно завершиться успешно.»


65-91: LGTM!


93-104: LGTM!

scripts/validate-harmonic-orientation.mjs (4)

33-58: Прошлое major-замечание об object-типе top-level полей устранено.

OBJECT_TOP_LEVEL_FIELDS + isNonEmptyObject теперь ловят null/строку/массив на месте объектных графов. As per path instructions: scripts/**: «Ищи... случаи, когда проверка может ложно завершиться успешно.»


73-83: LGTM!


97-120: Прошлый minor-issue про TypeError на evidence_before/evidence_after устранён.

validateEvidenceObject теперь явно проверяет null/тип объекта до bucket in value, отказ идёт через pushError, а не через исключение.


145-211: Все три прошлых major-замечания в этой функции устранены.

scorecard.total теперь строго проверяется как integer (line 169), asArray принимает errors/fieldName и не молча превращает невалидный тип в [] (line 173), а диапазонные score-правила (203-208) реализуют executable score_policy из спецификации. As per path instructions: scripts/**: «Ищи... случаи, когда проверка может ложно завершиться успешно.»

Comment on lines +49 to +54
actor_values:
- human
- assistant
- ci
- bot
- orientation-center

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n 'actor' scripts/validate-harmonic-orientation.mjs docs/examples/*.json

Repository: safal207/robys-coffee-house-demo

Length of output: 748


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n## actor_values references\n'
rg -n 'actor_values|orientation-center|required_fields|actor' \
  docs/harmonic-temporal-orientation-spec.yaml \
  scripts/validate-harmonic-orientation.mjs \
  docs/examples \
  -g '!*.map'

printf '\n## validate script outline\n'
ast-grep outline scripts/validate-harmonic-orientation.mjs --view expanded || true

printf '\n## spec excerpt\n'
sed -n '1,140p' docs/harmonic-temporal-orientation-spec.yaml

Repository: safal207/robys-coffee-house-demo

Length of output: 5756


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n --hidden --glob '!**/.git/**' 'actor_values|validate.*actor|actor\s*[:=]|orientation-center' .

Repository: safal207/robys-coffee-house-demo

Length of output: 2603


🏁 Script executed:

#!/bin/bash
set -euo pipefail

sed -n '1,120p' scripts/validate-harmonic-orientation.mjs

Repository: safal207/robys-coffee-house-demo

Length of output: 3850


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n 'actor' scripts/validate-harmonic-orientation.mjs

Repository: safal207/robys-coffee-house-demo

Length of output: 170


actor_values нужно либо валидировать, либо убрать из схемы.
record.actor сейчас нигде не проверяется по этому enum, а в scripts/validate-harmonic-orientation.mjs нет даже проверки самого поля. В итоге orientation-center объявлен, но контракт фактически не enforced.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/harmonic-temporal-orientation-spec.yaml` around lines 49 - 54, Поле
actor_values в схеме не enforced: добавьте в
scripts/validate-harmonic-orientation.mjs проверку наличия record.actor и его
соответствия enum actor_values, либо удалите actor_values из схемы;
синхронизируйте схему и валидатор, чтобы значение orientation-center проверялось
единообразно.

safal207 commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

Archived during Roby's v1 consolidation. Harmonic Temporal Orientation remains preserved as a research artifact, but it is not consumed by a current product or required release decision. It should not remain an active PR unless rebuilt around a concrete current-main use case.

@safal207 safal207 closed this Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant