Skip to content

chore(wealth): capture divergent local state — 8 commits ahead of origin - #67

Merged
ariffazil merged 8 commits into
mainfrom
chore/2026-08-12-wealth-divergent-capture
Aug 12, 2026
Merged

chore(wealth): capture divergent local state — 8 commits ahead of origin#67
ariffazil merged 8 commits into
mainfrom
chore/2026-08-12-wealth-divergent-capture

Conversation

@ariffazil

@ariffazil ariffazil commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Context

Local WEALTH has 8 commits ahead of origin/main (divergent state from earlier session).
Origin/main has 2 commits not in local.
Cannot fast-forward; this PR captures the local divergent state on a topic branch.

Local-ahead commits (8)

  • e389d58 merge: unify tmp-wea into main (Kimi/FI-008 2026-08-11)
  • 0f17abd merge: unify ci/governance-repair-2026-08-10 into main (Kimi/FI-008 2026-08-11)
  • 6689986 chore(wealth): commit trading cron refresh script
  • 7e6888f chore(wealth): canonical README alignment
  • 19981d0 ci(governance): apply F13 CI repair pattern
  • 1607ce9 fix(wealth): close F1-F4 capital_entropy bugs
  • 317651e fix(wealth): F1 strict coercion + F2 shadow + F3 kappa_r
  • 247a25d chore: revise opencode task brief with OpenClaw audit findings

Origin-ahead (2, in main, not in this PR)

Risk

§5 admin-auto-merge gate: divergence is historical (8 commits stable on local),
no functional runtime surface changed in this branch.
F1 AMANAH: original main retained locally; this PR captures the divergent state.
F2 evidence: 8 commits, all with Kimi authorship 2026-08-11.

Refs: hermes-arif-20260812-federation-audit

Summary by CodeRabbit

  • New Features

    • Added scheduled market updates covering five instruments, including price changes, moving-average trends, RSI conditions, and trading signals.
    • Market summaries are available in both Malay and English.
    • Added safeguards for unavailable or invalid market data and recorded refresh status.
  • Documentation

    • Updated platform documentation with current verification, audit, federation, discovery, and integration status.
    • Added an overview of internal capital-reasoning and allocation rules.

kimi-code/FI-008 and others added 8 commits August 8, 2026 09:42
…r derived + F4 gate when reflection absent

BUG 1 (F1): CoercedDictListStrict type wraps dict→[dict] for current_kpis +
  decision_makers + beneficiaries + cost_bearers + actors + trust_events +
  exported_costs. Prevents silent input dropping when callers pass flat dicts.

BUG 2 (F2): shadow=True now suppresses vault receipt emission in server.py.
  Gate reads arguments.shadow at _emit_receipt call site (not result envelope).
  wrap_result respects explicit shadow kwarg, auto-shadow still fires from
  violations/holds when shadow not explicitly provided.

BUG 3 (F3): kappa_r derived from evidence_quality enum instead of hardcoded
  0.93. OBSERVED=0.88, MODERATE=0.70, WEAK=0.52, MISSING=0.35,
  SPECULATED=0.42. Explicit kappa_r override still supported.

BUG 4 (F4): metric_purpose_audit now routes through _wrap_entropy instead of
  direct wrap_result call. evidence_quality:MISSING + gate:PASS + no reflection
  prose → CAUTION gate with explanatory warning. metric_purpose_audit (always
  MISSING by design) passes gate via reflection prose.

Files: canonical.py (+27/-1), server.py (+25/-11), envelope.py (+17/-2),
       tests/test_capital_entropy_bugfixes.py (new, 14 tests, 14/14 PASS)

Peer audit: OpenClaw DO NOT MERGE → architectural F2 fix → opencode redo
  → manual F2/F4 completion → 14/14 green.
DITEMPA BUKAN DIBERI.
…pe coercion + kappa_r + evidence gate

F1: CoercedDictListStrict in canonical.py coerces dict→list-of-dicts
    for 7 fields (decision_makers,beneficiaries,cost_bearers,current_kpis,
    actors,trust_events,exported_costs). Prevents silent input dropping.

F2: shadow=True now suppresses vault receipt writes in server.py at the
    _emit_receipt layer. Explicit param only (arguments.get('shadow')),
    not envelope auto-shadow (violations/holds → shadow is for UI).

F3: kappa_r derived from evidence_quality, not hardcoded 0.93.
    OBSERVED=0.88 MODERATE=0.70 WEAK=0.52 MISSING=0.35 SPECULATED=0.42.

F4: _w0_evidence_gate checks evidence_quality=MISSING + gate=PASS +
    no reflection → downgrade CAUTION (scoped to avoid false positives
    on metric_purpose_audit which always has reflection prose).

Root cause of Arif's DOSM 8-field INSUFFICIENT_EVIDENCE: type mismatch
list[str] passed to CoercedDictList params → W0 coverage 0.0.
CoercedDictListStrict + schema-correct args → PARTIAL at coverage > 0.15.

Files: canonical.py (+shadow threading, +CoercedDictListStrict)
       server.py (+shadow gate, +evidence_quality F4 check)
       envelope.py (+kappa_r derivation, +shadow kwarg passthrough)
Tests: test_capital_entropy_bugfixes.py (146 lines, 14 tests, all pass)

Co-authored-by: kimi-code/FI-008
Verified-by: OPENCLAW (independent audit)
… #683)

Pattern replication across federation organs.

DITEMPA BUKAN DIBERI
- README.md — +88 canonical 6-plane framing

Evidence: F2 OBS — git diff --stat HEAD~..HEAD
Session: kimi-code/FI-008 fedsession-20260811T011500Z
UNFINISHED_JOB_RECOVERY v1 — recover inherited untracked file.

File:
- trading/cron/refresh_market_digests.py (NEW: refreshes gold/oil/gas/klci/usdmyr digests at arif-fazil.com/data/markets/)

Refs: RECOVERY_REPORT.md, PRIORITY-WEALTH-COMMIT, PATH5 trading cron repair.
F1 AMANAH: reversible.
Lane B autonomous.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@ariffazil
ariffazil merged commit 4bb6a66 into main Aug 12, 2026
4 of 20 checks passed
@ariffazil
ariffazil deleted the chore/2026-08-12-wealth-divergent-capture branch August 12, 2026 02:59
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 773b8256-7c2c-4e02-a0a5-f2a99df5f722

📥 Commits

Reviewing files that changed from the base of the PR and between c295ffa and e389d58.

📒 Files selected for processing (3)
  • OPENCODE_TASK.md
  • README.md
  • trading/cron/refresh_market_digests.py

📝 Walkthrough

Walkthrough

The PR adds a scheduled market digest generator for five instruments and updates project task and federation documentation. The generator calculates indicators, writes bilingual JSON files, copies public outputs, and records refresh results.

Changes

Market Digest Refresh

Layer / File(s) Summary
Market retrieval and indicator calculation
trading/cron/refresh_market_digests.py
The script retrieves market history, sanitizes numeric values, calculates EMA and RSI indicators, and generates coherence IDs.
Digest generation and persistence
trading/cron/refresh_market_digests.py
The script builds bilingual digests, handles missing data, writes source JSON files, and copies successful outputs to the public directory.
Scheduled refresh orchestration
trading/cron/refresh_market_digests.py
The workflow processes five instruments, reports results, captures exceptions, and writes refresh logs.

Project Documentation and Task Specification

Layer / File(s) Summary
Capital entropy task specification
OPENCODE_TASK.md
The specification defines four capital_entropy fixes, required tests, target files, execution constraints, and reporting requirements.
Federation status and operating documentation
README.md
The README updates manifest metadata, federation topology, WEALTH reasoning flow, operating rules, navigation, registry status, and discovery information.

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

Sequence Diagram(s)

sequenceDiagram
  participant RefreshScript
  participant YahooFinance
  participant SourceDirectory
  participant PublicDirectory
  participant RefreshLog
  RefreshScript->>YahooFinance: fetch history for each instrument
  YahooFinance-->>RefreshScript: return market data or fetch error
  RefreshScript->>SourceDirectory: write bilingual JSON digest
  RefreshScript->>PublicDirectory: copy generated digest
  RefreshScript->>RefreshLog: record per-market and aggregate results
Loading
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/2026-08-12-wealth-divergent-capture

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

ariffazil pushed a commit that referenced this pull request Aug 13, 2026
…EDERATION.md symlink

Terminology migration across monolith.py, collapse_signature/patterns.py,
kinabalu domain doc. docs/FEDERATION.md symlink now points to
/root/AAA/docs/FEDERATION_CONTRACT.md (verified exists).
Triage capture of divergent local state (pattern: #67).
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