Compare commits

..

1 Commits

Author SHA1 Message Date
Alexander Whitestone
5bc3e0879d fix: closes #675
Some checks failed
CI / test (pull_request) Failing after 8s
CI / validate (pull_request) Failing after 14s
Review Approval Gate / verify-review (pull_request) Failing after 3s
2026-04-12 12:27:45 -04:00
4 changed files with 183 additions and 6 deletions

View File

@@ -2,7 +2,7 @@ protection:
main:
required_pull_request_reviews:
dismiss_stale_reviews: true
required_approving_review_count: 1
required_approving_review_count: 1
required_linear_history: true
allow_force_push: false
allow_deletions: false
@@ -14,4 +14,55 @@ protection:
reviewers:
- perplexity
required_reviewers:
- Timmy
- Timmy # Owner gate for hermes-agent
main:
require_pull_request: true
required_approvals: 1
dismiss_stale_approvals: true
require_ci_to_pass: true
block_force_push: true
block_deletion: true
>>>>>>> replace
</source>
CODEOWNERS
<source>
<<<<<<< search
protection:
main:
required_status_checks:
- "ci/unit-tests"
- "ci/integration"
required_pull_request_reviews:
- "1 approval"
restrictions:
- "block force push"
- "block deletion"
enforce_admins: true
the-nexus:
required_status_checks: []
required_pull_request_reviews:
- "1 approval"
restrictions:
- "block force push"
- "block deletion"
enforce_admins: true
timmy-home:
required_status_checks: []
required_pull_request_reviews:
- "1 approval"
restrictions:
- "block force push"
- "block deletion"
enforce_admins: true
timmy-config:
required_status_checks: []
required_pull_request_reviews:
- "1 approval"
restrictions:
- "block force push"
- "block deletion"
enforce_admins: true

View File

@@ -4,6 +4,52 @@ rules:
require_pull_request: true
required_approvals: 1
dismiss_stale_reviews: true
require_ci_to_pass: true
require_ci_to_pass: true # Enabled for all except the-nexus (#915)
block_force_pushes: true
block_deletions: true
>>>>>>> replace
```
CODEOWNERS
```txt
<<<<<<< search
# CODEOWNERS - Mandatory Review Policy
# Default reviewer for all repositories
* @perplexity
# Specialized component owners
hermes-agent/ @Timmy
hermes-agent/agent-core/ @Rockachopa
hermes-agent/protocol/ @Timmy
the-nexus/ @perplexity
the-nexus/ai/ @Timmy
timmy-home/ @perplexity
timmy-config/ @perplexity
# Owner gates
hermes-agent/ @Timmy
# QA reviewer for all PRs
* @perplexity
# Branch protection rules for main branch
branch: main
rules:
- type: push
# Push protection rules
required_pull_request_reviews: true
required_status_checks: true
# CI is disabled for the-nexus per #915
required_approving_review_count: 1
block_force_pushes: true
block_deletions: true
- type: merge # Merge protection rules
required_pull_request_reviews: true
required_status_checks: true
required_approving_review_count: 1
dismiss_stale_reviews: true
require_code_owner_reviews: true
required_status_check_contexts:
- "ci/ci"
- "ci/qa"

View File

@@ -343,6 +343,40 @@
<button onclick="searchMemPalace()">Search</button>
</div>
<div id="mempalace-results" style="position:fixed; right:24px; top:84px; max-height:200px; overflow-y:auto; background:rgba(0,0,0,0.3); padding:8px; font-family:'JetBrains Mono',monospace; font-size:11px; color:#e0f0ff; border-left:2px solid #4af0c0;"></div>
>>>>>>> replace
```
index.html
```html
<<<<<<< search
<div class="branch-policy" style="margin-top: 10px; font-size: 12px; color: #aaa;">
<strong>BRANCH PROTECTION POLICY</strong><br>
<ul style="margin:0; padding-left:15px;">
<li>• Require PR for merge ✅</li>
<li>• Require 1 approval ✅</li>
<li>• Dismiss stale approvals ✅</li>
<li>• Require CI ✅ (where available)</li>
<li>• Block force push ✅</li>
<li>• Block branch deletion ✅</li>
</ul>
</div>
<div class="default-reviewers" style="margin-top: 8px;">
<strong>DEFAULT REVIEWERS</strong><br>
<ul style="margin:0; padding-left:15px;">
<li><span style="color:#4af0c0;">@perplexity</span> (QA gate on all repos)</li>
<li><span style="color:#7b5cff;">@Timmy</span> (owner gate on hermes-agent)</li>
</ul>
</div>
<div class="implementation-status" style="margin-top: 10px;">
<strong>IMPLEMENTATION STATUS</strong><br>
<div style="margin-top: 5px; display: flex; flex-direction: column; gap: 2px;">
<div><span style="color:#4af0c0;">hermes-agent</span>: Require PR + 1 approval + CI ✅</div>
<div><span style="color:#7b5cff;">the-nexus</span>: Require PR + 1 approval ⚠<> (CI disabled)</div>
<div><span style="color:#ffd700;">timmy-home</span>: Require PR + 1 approval ✅</div>
<div><span style="color:#ab8d00;">timmy-config</span>: Require PR + 1 approval ✅</div>
</div>
</div>
</footer>
<script type="module" src="./app.js"></script>

View File

@@ -694,15 +694,61 @@ const SpatialMemory = (() => {
}
}
// ─── CONTEXT COMPACTION (issue #675) ──────────────────
const COMPACT_CONTENT_MAXLEN = 80; // max chars for low-strength memories
const COMPACT_STRENGTH_THRESHOLD = 0.5; // below this, content gets truncated
const COMPACT_MAX_CONNECTIONS = 5; // cap connections per memory
const COMPACT_POSITION_DECIMALS = 1; // round positions to 1 decimal
function _compactPosition(pos) {
const factor = Math.pow(10, COMPACT_POSITION_DECIMALS);
return pos.map(v => Math.round(v * factor) / factor);
}
/**
* Deterministically compact a memory for storage.
* Same input always produces same output — no randomness.
* Strong memories keep full fidelity; weak memories get truncated.
*/
function _compactMemory(o) {
const strength = o.mesh.userData.strength || 0.7;
const content = o.data.content || '';
const connections = o.data.connections || [];
// Deterministic content truncation for weak memories
let compactContent = content;
if (strength < COMPACT_STRENGTH_THRESHOLD && content.length > COMPACT_CONTENT_MAXLEN) {
compactContent = content.slice(0, COMPACT_CONTENT_MAXLEN) + '\u2026';
}
// Cap connections (keep first N, deterministic)
const compactConnections = connections.length > COMPACT_MAX_CONNECTIONS
? connections.slice(0, COMPACT_MAX_CONNECTIONS)
: connections;
return {
id: o.data.id,
content: compactContent,
category: o.region,
position: _compactPosition([o.mesh.position.x, o.mesh.position.y - 1.5, o.mesh.position.z]),
source: o.data.source || 'unknown',
timestamp: o.data.timestamp || o.mesh.userData.createdAt,
strength: Math.round(strength * 100) / 100, // 2 decimal precision
connections: compactConnections
};
}
// ─── PERSISTENCE ─────────────────────────────────────
function exportIndex() {
function exportIndex(options = {}) {
const compact = options.compact !== false; // compact by default
return {
version: 1,
exportedAt: new Date().toISOString(),
compacted: compact,
regions: Object.fromEntries(
Object.entries(REGIONS).map(([k, v]) => [k, { label: v.label, center: v.center, radius: v.radius, color: v.color }])
),
memories: Object.values(_memoryObjects).map(o => ({
memories: Object.values(_memoryObjects).map(o => compact ? _compactMemory(o) : {
id: o.data.id,
content: o.data.content,
category: o.region,
@@ -711,7 +757,7 @@ const SpatialMemory = (() => {
timestamp: o.data.timestamp || o.mesh.userData.createdAt,
strength: o.mesh.userData.strength || 0.7,
connections: o.data.connections || []
}))
})
};
}