Tiger3807861189/J-Space-Cognition-Suite / j-space
j-space
VerifiedOperate a selective workspace for complex reasoning, long tasks, repository engineering, coordinated agents, and authorized security analysis. Use when work requires durable state, evidence, cross-file consistency, or recovery; keep direct answers lightweight.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 11.7 KB |
| modules/broadcast.md | markdown | 9.8 KB |
| modules/capacity.md | markdown | 14.0 KB |
| modules/cyber.md | markdown | 8.6 KB |
| modules/deep-reasoning.md | markdown | 11.7 KB |
| modules/directed-focus.md | markdown | 9.3 KB |
| modules/empirics.md | markdown | 10.2 KB |
| modules/epistemics.md | markdown | 6.1 KB |
| modules/introspection.md | markdown | 9.8 KB |
| modules/markers.md | markdown | 12.8 KB |
| modules/orchestration.md | markdown | 8.4 KB |
| modules/repository.md | markdown | 7.8 KB |
| modules/self-monitoring.md | markdown | 14.9 KB |
| modules/shorthand.md | markdown | 14.3 KB |
| references/controller.md | markdown | 22.2 KB |
| references/engineering-evidence.md | markdown | 8.4 KB |
| references/exemplars.md | markdown | 18.5 KB |
| references/host-integration.md | markdown | 5.9 KB |
| references/induction-playbook.md | markdown | 21.5 KB |
| references/j-space-science.md | markdown | 36.5 KB |
| references/problem-model.md | markdown | 2.8 KB |
| scripts/control.py | script | 49.2 KB |
| scripts/host_bridge.py | script | 3.2 KB |
| scripts/jspace.py | script | 35.9 KB |
| scripts/verify_suite.py | script | 12.3 KB |
| scripts/workspace-ledger.md | markdown | 4.0 KB |
scripts/host_bridge.py
View on GitHub#!/usr/bin/env python3
"""Translate one host event from JSON stdin into context and an allow decision.
This is a portable adapter, not automatic registration with any vendor's hooks.
The host forwards context to the agent and honors allow=false before dependent work.
"""
import argparse
import json
import math
from pathlib import Path
import subprocess
import sys
CONTROL = Path(__file__).with_name('control.py')
EVENTS = {
'before_work': ('tool', 'work'),
'after_tool': ('tool', None),
'before_ship': ('checkpoint', 'ship'),
'handoff': ('handoff', None),
'failure': ('failure', None),
'resume': ('resume', None),
'compact': ('compact', None),
}
def invoke(root, *args, timeout=45):
result = subprocess.run(
[sys.executable, str(CONTROL), '--root', str(root), *args],
capture_output=True, encoding='utf-8', errors='strict', timeout=timeout,
check=False,
)
return result.returncode, '\n'.join(x.strip() for x in (result.stdout, result.stderr) if x.strip())
def handle(root, message, timeout=45):
if not math.isfinite(timeout) or timeout <= 0:
raise ValueError('Controller timeout must be finite and positive.')
if not isinstance(message, dict) or set(message) - {'event', 'agent'}:
raise ValueError('Expected an object containing only event and optional agent.')
event, agent = message.get('event'), message.get('agent', 'root')
if not isinstance(event, str) or event not in EVENTS:
raise ValueError('Unknown host event.')
if not isinstance(agent, str) or not agent.strip() or agent.startswith('-'):
raise ValueError('Expected a nonempty agent ID.')
pulse, stage = EVENTS[event]
code, context = invoke(root, 'pulse', '--event', pulse, '--agent', agent, timeout=timeout)
if code == 0 and stage:
code, checked = invoke(root, 'check', '--stage', stage, '--agent', agent, timeout=timeout)
context = '\n\n'.join((context, checked))
return {'allow': code == 0, 'context': context, 'event': event, 'agent': agent}
def main(argv=None):
for stream in (sys.stdout, sys.stderr):
if hasattr(stream, 'reconfigure'):
stream.reconfigure(encoding='utf-8', errors='strict')
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--root', default='.', help='Trusted task root selected by the host.')
parser.add_argument('--timeout-seconds', type=float, default=45,
help='Positive timeout per controller subprocess (default: 45); trusted host setting.')
args = parser.parse_args(argv)
try:
raw = sys.stdin.buffer.read(65537)
if len(raw) > 65536:
raise ValueError('Host event exceeds 64 KiB.')
message = json.loads(raw.decode('utf-8-sig'))
root = Path(args.root).resolve()
if not root.is_dir():
raise ValueError('Task root must be an existing directory.')
response = handle(root, message, timeout=args.timeout_seconds)
except (ValueError, OSError, subprocess.SubprocessError) as exc:
response = {'allow': False, 'context': 'BLOCK: ' + str(exc)}
print(json.dumps(response, ensure_ascii=False))
return 0 if response['allow'] else 2
if __name__ == '__main__':
sys.exit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |