Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/inneros-branch-ledger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: InnerOS Branch and Production Ledger

on:
push:
branches: [main]
paths:
- ".github/workflows/inneros-branch-ledger.yml"
- "scripts/inneros_branch_ledger.py"
- "platform/tests/test_inneros_branch_ledger.py"
- "docs/INNEROS_RELEASE_ATTESTATION.json"
schedule:
# 12:00 UTC = 07:00 Ecuador, every day
- cron: "0 12 * * *"
workflow_dispatch:

permissions:
contents: write

concurrency:
group: inneros-canonical-branch-inventory
cancel-in-progress: true

jobs:
audit:
if: github.repository == 'Rafa-Innerchispa/innerops-agentic-platform'
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- name: Fetch trusted main only
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 1
- name: Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Run offline regression tests
env:
PYTHONDONTWRITEBYTECODE: "1"
run: |
python -m unittest discover -s platform/tests -p 'test_inneros_branch_ledger.py' -v
- name: Inventory every branch and update only the ledger in main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: Rafa-Innerchispa/innerops-agentic-platform
run: |
python scripts/inneros_branch_ledger.py --repo "$GITHUB_REPOSITORY" --workers 4 --publish
- name: Preserve full JSON and Markdown snapshot even if publication failed
if: always()
uses: actions/upload-artifact@v4
with:
name: inneros-branch-ledger
path: |
inneros-branch-ledger.md
inneros-branch-ledger.json
if-no-files-found: warn
retention-days: 90
11 changes: 11 additions & 0 deletions .github/workflows/inneros-runtime-gates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
- "platform/inneros_core_runtime/local_model_router.py"
- "platform/raphiia_openai/__init__.py"
- "platform/tests/test_local_model_router_fallback.py"
- "scripts/inneros_branch_ledger.py"
- "platform/tests/test_inneros_branch_ledger.py"
- ".github/workflows/inneros-branch-ledger.yml"
- "docs/INNEROS_RELEASE_ATTESTATION.json"
- "platform/inneros_core_runtime/execution_binding.py"
- "platform/inneros_core_runtime/capability_gateway.py"
- "platform/inneros_core_runtime/capability_gateway_peer.py"
Expand Down Expand Up @@ -41,6 +45,10 @@ on:
- "platform/inneros_core_runtime/local_model_router.py"
- "platform/raphiia_openai/__init__.py"
- "platform/tests/test_local_model_router_fallback.py"
- "scripts/inneros_branch_ledger.py"
- "platform/tests/test_inneros_branch_ledger.py"
- ".github/workflows/inneros-branch-ledger.yml"
- "docs/INNEROS_RELEASE_ATTESTATION.json"
- "platform/inneros_core_runtime/execution_binding.py"
- "platform/inneros_core_runtime/capability_gateway.py"
- "platform/inneros_core_runtime/capability_gateway_peer.py"
Expand Down Expand Up @@ -95,6 +103,8 @@ jobs:
platform/inneros_core_runtime/local_model_router.py \
platform/raphiia_openai/__init__.py \
platform/tests/test_local_model_router_fallback.py \
scripts/inneros_branch_ledger.py \
platform/tests/test_inneros_branch_ledger.py \
platform/inneros_core_runtime/execution_binding.py \
platform/inneros_core_runtime/capability_gateway.py \
platform/inneros_core_runtime/capability_gateway_peer.py \
Expand Down Expand Up @@ -123,6 +133,7 @@ jobs:
platform/tests/test_global_coordination_guards.py \
platform/tests/test_execution_binding.py \
platform/tests/test_local_model_router_fallback.py \
platform/tests/test_inneros_branch_ledger.py \
platform/tests/test_execution_receipts.py \
platform/tests/test_reconcile_ops_mongo_temporal.py \
platform/tests/test_governed_model_writes.py \
Expand Down
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

> Vigente desde el 12 de octubre de 2026. Aplica a Cursor, Codex, Antigravity y agentes locales que trabajen en este repositorio.

**Inventario vivo de ramas y producción:** leer [docs/INNEROS_BRANCH_LEDGER.md](docs/INNEROS_BRANCH_LEDGER.md) (actualizado diariamente por GitHub Actions) y [docs/INNEROS_RELEASE_ATTESTATION.json](docs/INNEROS_RELEASE_ATTESTATION.json). Nunca considerar que main o CI implica despliegue. El auditor conserva ramas y NO las fusiona ni borra.

## Al iniciar una sesión o reclamar trabajo

1. Leer **[platform/docs/INNEROS_COORDINATION_CONTINUITY_20261012.md](platform/docs/INNEROS_COORDINATION_CONTINUITY_20261012.md)**. Es el handoff actual; referencias de septiembre y manuales antiguos siguen como material histórico, no como autoridad de estado vivo.
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@

## Recovery and cross-agent continuity

**GitHub branch debt and production proof:** [automatic branch ledger](docs/INNEROS_BRANCH_LEDGER.md) and [per-host runtime attestation](docs/INNEROS_RELEASE_ATTESTATION.json). Updated by the daily InnerOS Branch and Production Ledger workflow. A merged branch is NOT evidence that AMD/Intel services imported that code. No auto-delete or blind merge.


**Current active continuity (12 Oct 2026):** [`platform/docs/INNEROS_COORDINATION_CONTINUITY_20261012.md`](platform/docs/INNEROS_COORDINATION_CONTINUITY_20261012.md) and repository-wide [`AGENTS.md`](AGENTS.md). Agents must read this current handoff and verify live Mongo/Temporal/task leases/GitHub/runtime before accepting work. The [30 Sep handoff](docs/CANONICAL_CONTINUITY_HANDOFF_20260930.md) remains historical context, not current dispatch instructions.

---
Expand Down
29 changes: 29 additions & 0 deletions docs/INNEROS_RELEASE_ATTESTATION.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"schema": "inneros-runtime-host-attestation-v1",
"intent": "GitHub main does NOT mean AMD/Intel runtime deployed. Update only after an independent on-host executable code hash, commit version and E2E probe.",
"recorded_at_utc": "2026-10-12T15:00:00Z",
"hosts": {
"amd": {
"verified": false,
"runtime_git_sha": null,
"evidence_path": null,
"runtime_root": "/home/rlopez/inneros/inneros_core/platform",
"note": "LEP workspace HEAD bf43c6a5 observed; Cursor reported a7553157 at runtime earlier, source/process mapping not independently certified."
},
"intel": {
"verified": false,
"runtime_git_sha": null,
"evidence_path": null,
"runtime_root": "/home/rlopez/inneros/inneros_core/platform",
"note": "Peer observability RC126 and workspace venv absence; no independently verified SHA for production import."
}
},
"verification_contract": [
"read-only actual process module paths and SHA256",
"exact main SHA pinned",
"compile and test suite exit codes",
"Temporal/Mongo task terminal",
"AMD and Intel canaries",
"backup and rollback provenance"
]
}
2 changes: 2 additions & 0 deletions platform/docs/INNEROS_COORDINATION_CONTINUITY_20261012.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
**Destino:** documentación persistente en `main` de `Rafa-Innerchispa/innerops-agentic-platform`.
**IMPORTANTE:** estados en este archivo son una instantánea, no certificación de que la situación seguirá igual. Recuperar telemetría viva antes de actuar. **No contiene credenciales.**

**Inventario vivo de código pendiente:** [docs/INNEROS_BRANCH_LEDGER.md](../../docs/INNEROS_BRANCH_LEDGER.md), actualizado automáticamente cada día por GitHub Actions, y [docs/INNEROS_RELEASE_ATTESTATION.json](../../docs/INNEROS_RELEASE_ATTESTATION.json), inicialmente NO_CERTIFICADO por nodo hasta evidencia host. El registro preserva todas las ramas; no debe confundirse CI/merge con producción.

## 1. Objetivo del propietario (no perder)
InnerOS debe tomar una orden en ChatGPT, voz o WhatsApp y **ejecutarla** usando el agente adecuado, interno o externo, sin intervención manual en una laptop, con cambios de código reales, verificación, posibilidad de rollback y cierre durable. No son suficientes mensajes ACK, modelos cargados, servicios activos, IDs `claimed` ni un PR fusionado. El propietario quiere un *único sistema* y no un router v2 ni otra instancia de Temporal.

Expand Down
64 changes: 64 additions & 0 deletions platform/tests/test_inneros_branch_ledger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
"""Offline regression tests for branch preservation and truthful release flags."""
import importlib.util
from pathlib import Path
import unittest
from unittest.mock import patch

FILE = Path(__file__).resolve().parents[2] / "scripts" / "inneros_branch_ledger.py"
SPEC = importlib.util.spec_from_file_location("inneros_branch_ledger_under_test", FILE)
assert SPEC and SPEC.loader
mod = importlib.util.module_from_spec(SPEC)
SPEC.loader.exec_module(mod)


class InnerOSBranchLedgerTests(unittest.TestCase):
def test_unmerged_commits_are_not_considered_safe_to_merge(self):
candidate = {"name": "fix/valuable", "sha": "a" * 40, "ahead": 5, "behind": 50, "prs": []}
self.assertEqual(mod.classification(candidate), "REVISAR_SIN_PR")
candidate["prs"] = [119]
self.assertEqual(mod.classification(candidate), "PR_ABIERTO")
candidate["bulk_risk"] = True
self.assertEqual(mod.classification(candidate), "RIESGO_ALTO")
candidate["error"] = "API unavailable"
self.assertEqual(mod.classification(candidate), "ERROR")

def test_branch_in_main_history_is_not_marked_as_missing(self):
self.assertEqual(mod.classification({"ahead": 0, "prs": [], "behind": 6}), "EN_HISTORIA_MAIN")

def test_dangerous_bulk_deletion_is_flagged(self):
result = mod.summarize_compare({"ahead_by": 43, "behind_by": 337,
"files": [{"filename": "backups/deleted.py", "deletions": 216026, "additions": 0}]})
self.assertEqual(result["ahead"], 43)
self.assertTrue(result["bulk_risk"])

def test_without_runtime_attestation_production_is_unknown(self):
result = mod.production_status("a" * 40, {
"hosts": {"amd": {"verified": False, "runtime_git_sha": "a" * 40},
"intel": {"verified": False}}})
self.assertEqual([r["status"] for r in result], ["NO_CERTIFICADO", "NO_CERTIFICADO"])

def test_attestation_mismatch_is_drift_not_deployed(self):
result = mod.production_status("a" * 40, {
"hosts": {"amd": {"verified": True, "runtime_git_sha": "b" * 40,
"evidence_path": "var/evidence/amd.json"}}})
self.assertEqual(result[0]["status"], "DESFASADO")

def test_report_enumerates_every_branch_including_legacy(self):
rows = [{"name": "chatgpt/r" + str(i), "sha": "a" * 40,
"prs": [], "ahead": 1, "behind": 7, "changed_files": 2,
"classification": "REVISAR_SIN_PR"} for i in range(263)]
report = {"repo": "Rafa-Innerchispa/innerops-agentic-platform",
"main_sha": "b" * 40, "generated_at": "2026-10-12T15:00:00Z",
"branches_total": 264, "prs": [],
"production": mod.production_status("b" * 40, {"hosts": {}}),
"rows": rows}
text = mod.render(report)
self.assertIn("chatgpt/r0", text)
self.assertIn("chatgpt/r262", text)
self.assertEqual(text.count("REVISAR_SIN_PR |"), 263)
self.assertIn("NO_CERTIFICADO", text)
self.assertNotIn("rm -rf", text)


if __name__ == "__main__":
unittest.main()
Loading
Loading