Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
116c6d8
docs: optimize root README as technical landing hub
SystemAdmin01 Nov 8, 2026
2da07c2
fix: add safe LINGHOS block boundary scanner
SystemAdmin01 Nov 8, 2026
3acf435
fix: guard parser block boundaries and quoted input
SystemAdmin01 Nov 8, 2026
c624dac
fix: clean parser normalization integration
SystemAdmin01 Nov 8, 2026
269b1d3
fix: prevent compiler block overrun on malformed scripts
SystemAdmin01 Nov 8, 2026
8d98e17
test: cover malformed and quoted LINGHOS blocks
SystemAdmin01 Nov 8, 2026
5975324
fix: align package metadata with project license
SystemAdmin01 Nov 8, 2026
78295a4
docs: align README claims with shipped project metadata
SystemAdmin01 Nov 8, 2026
5297bc1
docs: correct README version and license badges
SystemAdmin01 Nov 8, 2026
e7101f4
docs: replace stale English index with verified navigation
SystemAdmin01 Nov 8, 2026
8472681
docs: replace stale Italian index with verified navigation
SystemAdmin01 Nov 8, 2026
4a12f83
fix: share quote-aware LINGHOS lexical helpers
SystemAdmin01 Nov 8, 2026
9ff265a
fix: use quote-aware comment handling consistently
SystemAdmin01 Nov 8, 2026
777df72
docs: clarify package and specification versions
SystemAdmin01 Nov 8, 2026
4b188fb
fix: add package readme for reproducible build metadata
SystemAdmin01 Nov 8, 2026
bc1ba36
security: restrict Cockpit API origins and request bodies
SystemAdmin01 Nov 8, 2026
9b0aa23
docs: clarify implemented versus specified LINGHOS features
SystemAdmin01 Nov 8, 2026
80a71ee
docs: documentare stato implementazione LINGHOS
SystemAdmin01 Nov 8, 2026
8837aa2
docs: remove unsupported benchmark claims from English guide
SystemAdmin01 Nov 8, 2026
abc18a7
docs: rimuovere benchmark non supportati dalla guida italiana
SystemAdmin01 Nov 8, 2026
fc71c88
security: document actual protection boundaries and reporting channel
SystemAdmin01 Nov 8, 2026
05bf2d4
security: allineare policy italiana ai controlli effettivi
SystemAdmin01 Nov 8, 2026
3df6be9
docs: align contribution rules with implemented runtime and tests
SystemAdmin01 Nov 8, 2026
8d21471
docs: allineare linee guida italiane al runtime implementato e ai test
SystemAdmin01 Nov 8, 2026
338abd3
docs: align English LINGHOS manual with tooling and license
SystemAdmin01 Nov 8, 2026
0616966
docs: allineare manuale LINGHOS italiano a tooling e licenza
SystemAdmin01 Nov 8, 2026
101ab2a
refactor: describe current compiler implementation accurately
SystemAdmin01 Nov 8, 2026
687848a
fix: validate VM block before learning compiler symbols
SystemAdmin01 Nov 8, 2026
d98e7b0
test: cover compiler diagnostics for malformed blocks
SystemAdmin01 Nov 8, 2026
751f9f9
docs: link canonical English governance files
SystemAdmin01 Nov 8, 2026
b27430f
docs: link canonical Italian governance files
SystemAdmin01 Nov 8, 2026
6a05cf3
docs: fix contribution examples and test commands
SystemAdmin01 Nov 8, 2026
fce481e
docs: correct contribution test command and scope example
SystemAdmin01 Nov 8, 2026
d3a5907
docs: add regression test command to Italian contributor guide
SystemAdmin01 Nov 8, 2026
ff0c752
docs: distinguish target architecture from shipped runtime
SystemAdmin01 Nov 8, 2026
12cb4eb
ci: run tests across supported Python versions and build package
SystemAdmin01 Nov 8, 2026
5d85838
test: add smoke coverage for shipped LINGHOS examples
SystemAdmin01 Nov 8, 2026
c41085a
docs: make repository tree match actual package files
SystemAdmin01 Nov 8, 2026
307ef73
docs: qualify current parser, state and memory capabilities
SystemAdmin01 Nov 8, 2026
a960f73
docs: rewrite English guide around shipped runtime
SystemAdmin01 Nov 8, 2026
1dab166
docs: riscrivere guida italiana sul runtime distribuito
SystemAdmin01 Nov 8, 2026
bc78124
docs: use canonical GAP-001 protocol name
SystemAdmin01 Nov 8, 2026
126c014
security: align G.A.P. policy with protocol and runtime boundary
SystemAdmin01 Nov 8, 2026
be0ec89
security: allineare policy G.A.P. italiana a protocollo e runtime
SystemAdmin01 Nov 8, 2026
cea92b7
docs: standardize English expansion of LINGHOS
SystemAdmin01 Nov 8, 2026
be0e0d4
docs: standardizzare il nome esteso LINGHOS
SystemAdmin01 Nov 8, 2026
7d60d48
test: cover Cockpit API origin and body-size protections
SystemAdmin01 Nov 8, 2026
55558d8
spec: distinguish architectural goals from runtime guarantees
SystemAdmin01 Nov 8, 2026
622262d
spec: distinguere obiettivi architetturali e garanzie runtime
SystemAdmin01 Nov 8, 2026
43d4341
docs: use canonical G.A.P. protocol naming
SystemAdmin01 Nov 8, 2026
a1253fe
security: convert proposed abort behavior into explicit design intent
SystemAdmin01 Nov 8, 2026
3c1530a
security: esplicitare le azioni proposte nella policy italiana
SystemAdmin01 Nov 8, 2026
48b8a2c
test: make oversized-body HTTP test non-blocking
SystemAdmin01 Nov 8, 2026
05d2bdc
docs: qualify determinism claims for runtime state
SystemAdmin01 Nov 8, 2026
b546a12
docs: precisare le affermazioni di determinismo del runtime
SystemAdmin01 Nov 8, 2026
1efab69
docs: clarify signal conditioning and G.A.P. runtime limits
SystemAdmin01 Nov 8, 2026
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
53 changes: 53 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: HumOS CI

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
tests:
name: Tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.11", "3.13"]
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Compile Python sources
run: python -m compileall -q src tests

- name: Run regression tests
env:
PYTHONPATH: src
run: python -m unittest discover -s tests -v

package:
name: Build Python package
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install build frontend
run: python -m pip install --upgrade build

- name: Build wheel and source distribution
run: python -m build src
51 changes: 27 additions & 24 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@

## 1. Code of Technical Conduct & Architectural Philosophy

The HumOS project enforces strict deterministic engineering standards. Unlike conventional conversational agent frameworks, HumOS and its Domain-Specific Language (LINGHOS) operate as an intermediate deterministic representation (IR) between biological cognitive volatility and downstream Large Language Model (LLM) execution kernels.
HumOS aims for predictable, testable behavior in its implemented compiler and state model. LINGHOS can serve as a compact intermediate representation for downstream Large Language Model (LLM) applications, but the current repository does not enforce deterministic LLM inference.

Every contribution—whether a parser patch, visual cockpit enhancement, or documentation revision—must strictly preserve:
1. **Zero Hallucination Tolerance:** The compiler and runtime must never output non-deterministic or speculative state parameters.
2. **Strict Context Budgeting:** Token overhead must be minimized at all serialization boundaries.
3. **Formal Invariant Guarantees:** Core Self isolation (`CS_SECURE`), spatial proximity mathematics, and thermodynamic accounting (`RAM`, `BPM`) cannot be bypassed or weakened.
1. **Deterministic compiler behavior:** For a fixed source and runtime state, supported parsing and serialization paths must be repeatable and covered by tests.
2. **Measured context budgeting:** Token-efficiency claims must identify the tokenizer, corpus, and measurement method; do not publish unverified reduction percentages.
3. **Explicit simulation boundaries:** State that VM, RAM, BPM, and defense values are application-level models unless real host-level enforcement or sensor integration exists.

---

## 2. Primitive Proposal Protocol (PPP)

Any addition to the LINGHOS standard library, language grammar, or execution primitives must follow the **Primitive Proposal Protocol**. Unchecked keyword proliferation bloats the AST, consumes token budget, and introduces downstream reasoning ambiguities.
Any addition to the LINGHOS language, documented primitives, or execution behavior must follow the **Primitive Proposal Protocol**. Keep proposed syntax clearly distinguished from runtime-supported commands; the current parser is line-oriented and does not construct a formal AST.

### 2.1 Criteria for Primitive Acceptance
Before submitting a proposal for a new primitive (e.g., `MEMORY.*`, `THREAD.*`, `SHIELD.*`), the author must demonstrate that:
1. **Non-Redundancy:** The capability cannot be synthesized using an existing primitive sequence (e.g., `RAM.alloc()` + `THREAD.spawn()`).
2. **Context Window Efficiency:** The serialized token footprint of the primitive must not exceed **24 tokens** under standard UTF-8 Byte-Pair Encoding (BPE).
2. **Context Window Efficiency:** Report the token footprint using a named tokenizer and version. Apply a 24-token target only when the tokenizer and measurement corpus are specified; UTF-8 encoding is not itself a BPE tokenizer.
3. **Deterministic State Transition:** The primitive must yield a mathematically provable state change in the runtime memory model (e.g., deallocating RAM, clamping BPM, or altering threat radius).
4. **Backward Parser Compatibility:** The addition must not introduce Lookahead conflicts ($LR(1)$ shift-reduce or reduce-reduce ambiguities) in `linghos/parser.py`.
4. **Backward Parser Compatibility:** Add regression tests for supported parser behavior and malformed input. The current parser is hand-written and is not an LR(1) parser.

### 2.2 Formal RFC Template for Primitive Proposals
Every primitive proposal must be submitted as an issue or pull request referencing `docs/SPEC.md` using the following technical schema:
Expand All @@ -49,10 +49,10 @@ Every Pull Request (PR) must satisfy an automated and manual verification checkl

```mermaid
flowchart TD
PR[Pull Request Submitted] --> CHECK_SYNTAX[1. Strict Grammar & AST Parser Audit]
CHECK_SYNTAX --> CHECK_LEAK[2. Context Isolation & Leak Proof]
CHECK_LEAK --> CHECK_TOKEN[3. Token Overhead & Footprint Benchmark]
CHECK_TOKEN --> CHECK_INVARIANT[4. Thermodynamic Invariant Unit Tests]
PR[Pull Request Submitted] --> CHECK_SYNTAX[1. Supported Grammar & Parser Regression Tests]
CHECK_SYNTAX --> CHECK_LEAK[2. State Boundary Model Tests]
CHECK_LEAK --> CHECK_TOKEN[3. Reproducible Token Measurement]
CHECK_TOKEN --> CHECK_INVARIANT[4. Runtime State Model Tests]
CHECK_INVARIANT --> PASS[All Invariants Verified -> Approved for Merge]

CHECK_SYNTAX -- Failure --> REJECT[PR Rejected: Syntax Invariant Violation]
Expand All @@ -64,20 +64,20 @@ flowchart TD
### 3.1 Step-by-Step Verification Checklist

- [ ] **1. Strict Grammar & Lexer Compliance**
- All `.lghos` and `.lgh` examples compile cleanly through `linghos/compiler.py` without syntax warnings.
- Changed and referenced examples are checked against the currently supported parser/compiler subset.
- Semicolons, block closures (`Main() { ... }`), directives (`/SET_Lockdown_Mode`), and macro headers (`#include`) strictly follow the grammar defined in `docs/SPEC.md`.
- No trailing whitespace or broken delimiters.

- [ ] **2. Context Leak Verification (Zero Prompt Bleeding)**
- Variables declared in local sandboxes (`PRS_VM`, `LP_Ambient_VM`) must not leak into primary memory buffers or adjacent threads.
- Injected LLM system payloads must strictly contain isolated target profiles without unescaped cross-talk.
- Tests must verify the modeled target/VM associations and ensure no accidental cross-state mutation. Do not describe application VM objects as OS-level isolation.
- Prompt payload construction must escape and delimit untrusted source content; downstream LLM policy remains outside this runtime's enforcement boundary.

- [ ] **3. Token Footprint Benchmark**
- The compiled state vector generated by the runtime must demonstrate at least an **85% reduction** in token count relative to the raw input stream.
- Serialization overhead must be verified via character and token profiling (`len(json.dumps(state_vector)) <= 512 bytes` for nominal workloads).
- Token claims must include a reproducible raw-input corpus, tokenizer name/version, serialization rules, repeated measurements, and raw results. Do not impose an 85% reduction target until a baseline benchmark has been published.
- Track byte size and token count as separate measurements; bytes are not tokens.

- [ ] **4. Thermodynamic Invariant Unit Tests**
- Memory bounds test: Verify that `RAM.purge()` resets utilization to $\le 20\%$.
- Model test: Verify that `Call >> Drop_All_Background_Threads;` produces the documented modeled telemetry in the current implementation. Treat `RAM.purge()` as specification-only until implemented.
- Spatial radius test: Verify that threat proximity radius satisfies $r = \max(50.0, 175.0 - (W \cdot 6.5 + C \cdot 5.5))$.
- Defensive clamp test: Verify that `Ice_shield` prevents thermal throttling when RAM exceeds $85\%$.

Expand All @@ -100,20 +100,20 @@ Commit messages must strictly follow the **Conventional Commits 1.0.0** specific

| Scope | Description | Permitted Types | Example |
| :--- | :--- | :--- | :--- |
| `lghos` | Core LINGHOS language grammar, lexical scanner, AST additions | `feat`, `fix`, `refactor` | `feat(lghos): add THREAD.suspend opcode support` |
| `parser` | AST compilation, parsing engine, statement normalization | `fix`, `perf`, `test` | `fix(parser): resolve lookahead stall on nested IF blocks` |
| `linghos` | LINGHOS language syntax, lexical scanner, compiler and parser behavior | `feat`, `fix`, `refactor` | `fix(linghos): add regression coverage for supported syntax` |
| `parser` | Parsing engine, block scanning, statement normalization | `fix`, `perf`, `test` | `fix(parser): handle malformed nested IF blocks safely` |
| `cockpit` | Web UI, interactive SVG radar canvas, HTML/JS console | `feat`, `fix`, `style` | `feat(cockpit): render active defense labels on SVG perimeter` |
| `gap` | G.A.P. security module, recursion interrupts, kill-switch | `sec`, `fix`, `feat` | `sec(gap): enforce mandatory timeout on unclassified inputs` |
| `gap` | G.A.P. protocol specification and supported defensive state transitions | `sec`, `fix`, `feat` | `docs(gap): clarify protocol runtime implementation boundary` |
| `spec` | Formal documentation, language contracts, developer guides | `docs` | `docs(spec): document RAM.alloc memory invariants` |
| `storage` | Local scenario persistence, JSON serializations, sessions | `feat`, `fix`, `test` | `feat(storage): support custom symbol de-registration` |

### 4.3 Commit Message Examples

#### ✅ Valid Commit Messages
```bash
feat(lghos): implement RAM.alloc buffer reservation syntax
feat(linghos): implement the supported LINGHOS syntax
fix(parser): prevent variable leakage across multi-VM declarations
sec(gap): force TRIGGER.kill_switch execution on heart rate breach
fix(gap): clarify protocol runtime enforcement boundary
docs(spec): update Section 3 primitive matrix with arity contracts
```

Expand All @@ -136,7 +136,7 @@ To test contributions locally:
git clone https://github.com/SystemAdmin01/HumOS.git
cd HumOS

# 2. Validate compiler and storage engine
# 2. Validate compiler and storage engine (implemented subset)
python3 -c "
from src.linghos.compiler import LINGHOSCompiler
from src.linghos.storage import GLOBAL_STORAGE
Expand All @@ -146,7 +146,10 @@ assert res['telemetry']['ice_shield'] is True
print('Compiler verification passed.')
"

# 3. Launch test cockpit instance
# 3. Run the regression tests
PYTHONPATH=src python3 -m unittest discover -s tests -v

# 4. Launch the local Cockpit
python3 src/app.py
```

Expand Down
Loading