Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6018c36
Add repository ignore rules
RedXDevelopment Jul 29, 2026
2a3f6ea
Add package manifest
RedXDevelopment Jul 29, 2026
0e12eb9
Add dependency lockfile
RedXDevelopment Jul 29, 2026
3ed5335
Add CI for Node 20 and 22
RedXDevelopment Jul 29, 2026
c5f66c1
Add RedXai error types
RedXDevelopment Jul 29, 2026
705fec7
Add RedXai AST model helpers
RedXDevelopment Jul 29, 2026
e8b60ff
Implement RedXai lexer
RedXDevelopment Jul 29, 2026
dc1fe6a
Implement RedXai parser and legacy syntax support
RedXDevelopment Jul 29, 2026
9a4f64f
Implement RedXai validation and project ID rules
RedXDevelopment Jul 29, 2026
c09f673
Implement canonical RedXai serializer
RedXDevelopment Jul 29, 2026
b127ae6
Implement indexed database operations and transactions
RedXDevelopment Jul 29, 2026
825ea34
Implement atomic RedXai file storage and recovery
RedXDevelopment Jul 29, 2026
712e8c7
Export RedXaiHM SDK surface
RedXDevelopment Jul 29, 2026
1e92dc3
Add secure local RedXaiHM editor server
RedXDevelopment Jul 29, 2026
cba9452
Add RedXaiHM command-line interface
RedXDevelopment Jul 29, 2026
e85ff3e
Add RedXaiHM editor shell
RedXDevelopment Jul 29, 2026
228b23b
Implement RedXaiHM editor behavior
RedXDevelopment Jul 29, 2026
81e8067
Style the RedXaiHM editor
RedXDevelopment Jul 29, 2026
3e509dc
Add RedX identity account example
RedXDevelopment Jul 29, 2026
e6f85bf
Add original positional syntax example
RedXDevelopment Jul 29, 2026
1d6767b
Document RedXaiHM roadmap
RedXDevelopment Jul 29, 2026
fcc9744
Document RedXaiHM alpha security model
RedXDevelopment Jul 29, 2026
2166903
Publish RedXaiHM draft language specification
RedXDevelopment Jul 29, 2026
315b4d1
Add official Red X database icon
RedXDevelopment Jul 29, 2026
c60cc0a
Add Windows .RedXai file association installer
RedXDevelopment Jul 29, 2026
668e0db
Generate the Red X Windows icon during registration
RedXDevelopment Jul 29, 2026
d13bbef
Test RedXai parser and original syntax
RedXDevelopment Jul 29, 2026
fa3fc09
Enforce the exact RedXaiStore header syntax
RedXDevelopment Jul 29, 2026
08e8ba7
Test RedXai validation and ID rules
RedXDevelopment Jul 29, 2026
84fb8ad
Test indexed database operations and transactions
RedXDevelopment Jul 29, 2026
ad33477
Test atomic RedXai storage and recovery
RedXDevelopment Jul 29, 2026
2635ecc
Test RedXaiHM editor security and saves
RedXDevelopment Jul 29, 2026
ce546d6
Document the working RedXaiHM alpha
RedXDevelopment Jul 29, 2026
0bc8574
License RedXaiHM under Apache-2.0
RedXDevelopment Jul 29, 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
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on:
push:
branches: [main, "feature/**"]
pull_request:

permissions:
contents: read

jobs:
test:
strategy:
matrix:
node: [20, 22]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
- run: npm install --ignore-scripts
- run: npm run ci
- run: npm pack --dry-run
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
coverage/
*.RedXai.bak
*.RedXai.lock
*.RedXai.tmp-*
.DS_Store
190 changes: 190 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

Copyright 2026 RedXDevelopment

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
102 changes: 89 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,99 @@
# RedXaiHM

RedXaiHM is RedXDevelopment's ID-centric, human-readable database language and long-term storage engine. It stores durable application data in `.RedXai` files and is designed around stable numeric identities, strict validation, transactional writes, and official SDK access.
RedXaiHM is RedXDevelopment's ID-centric database language and long-term storage engine. It stores durable application data in files with the exact `.RedXai` extension and is intended for accounts, permissions, API keys, OAuth records, settings, billing state, and other important data that must survive for years.

> Status: early development. The language and storage format are not yet production-stable.
> **Development status:** `0.1.0-alpha.1`. The parser, validator, storage engine, SDK surface, CLI, and first editor are functional, but the format is not yet production-stable and encryption is intentionally reserved for a later RedX Crypt milestone.

## Core design
## What makes it RedXaiHM

- Every database begins with a required `RedXaiStore` header whose ID is `1`.
- IDs are unique inside a database; `0` is never valid.
- Values may omit IDs and remain local to their containing structure.
- `NELL` is the explicit unassigned/non-existent value.
- Arrays may contain values, variables, and nested arrays.
- Access points can restrict SDK languages and external projects.
- `.RedXai` is the official file extension.
- Every database begins with `{RedXaiStore[ID=1 ...]=[`.
- `0` is never a valid ID. `1` is reserved for the database header.
- IDs on values are optional, but every supplied ID must be unique across the document/project.
- `NELL`, in any letter case, is the explicit unassigned/non-existent value.
- Arrays use the RedXai form `;[ ... ]:` and may contain values, variables, comments, and nested arrays.
- Variables inside arrays remain addressable by ID anywhere in the database scope.
- Access points can pair an API key with allowed language extensions.
- Shared-project and global-access metadata are built into the database closing block.
- The engine supplies fast ID lookup, rename, edit, copy, move, delete, transactions, atomic saves, backups, and stale-lock recovery.

## First milestone
## Canonical example

The initial TypeScript reference implementation includes the lexer, parser, AST, validator, serializer, in-memory ID index, transactional file store, command-line interface, examples, and tests.
```redxai
{RedXaiStore[ID=1, Version="0.1"]=[
<< Access points are declared before normal stored values.
{MailAccess[ID=5032]} = {"RedX - replace-this-key", ".js", ".py", ".cs"},

{Accounts[ID=10]} = ;[
{Account[ID=11]} = ;[
{Email[ID=12]} = "owner@redxaimail.com",
{Verified[ID=13]} = TRUE,
{RecoveryEmail[ID=14]} = NELL
]:
]:
] Metadata={
Shared=FALSE,
ShareID=NELL,
OPFNames=NELL,
GA=FALSE,
GlobalID=NELL
}};
```

The parser also accepts the original positional closing form:

```redxai
]FALSE, NELL, NELL, FALSE, NELL};
```

The serializer always writes the clearer named metadata form.

## Install and use

RedXaiHM currently has no runtime dependencies and requires Node.js 20.11 or newer.

```bash
npm install
npm test
node ./src/cli.js validate ./examples/accounts.RedXai
node ./src/cli.js edit ./examples/accounts.RedXai
```

SDK example:

```js
import { RedXaiFileStore } from '@redxdevelopment/redxaihm';

const store = new RedXaiFileStore();
const loaded = await store.load('./Accounts.RedXai');

loaded.database.transaction((db) => {
db.setById(13, true);
db.renameById(14, 'BackupEmail');
});

await store.save('./Accounts.RedXai', loaded.database.document);
```

## Official editing path

`.RedXai` files are associated with the RedXaiHM Editor through `scripts/register-windows.ps1`. The initial editor runs locally on `127.0.0.1`, validates every save through the reference parser, and writes through the atomic storage engine. The operating system cannot make a text-based format mathematically impossible to open in another program; future encrypted containers will make unauthorized direct editing impractical. Until then, the supported write paths are the editor, CLI, and SDK.

## Repository map

- `src/lexer.js` — comments, strings, numbers, symbols, punctuation.
- `src/parser.js` — source to AST, including legacy metadata compatibility.
- `src/validator.js` — ID, metadata, access-point, reference, and project rules.
- `src/serializer.js` — canonical `.RedXai` source writer.
- `src/database.js` — indexed operations and transactions.
- `src/store.js` — locks, backups, atomic writes, and recovery.
- `src/editor-server.js` and `editor/` — official local editor.
- `docs/SPECIFICATION.md` — language rules.
- `test/` — reference behavior tests.

## Security boundary

This alpha does **not** invent or claim custom encryption. Passwords must be stored as strong password hashes, and sensitive fields should remain protected by the application until RedX Crypt adds authenticated encryption based on reviewed cryptographic primitives.

## License

Apache-2.0. See `LICENSE`.
Apache-2.0.
10 changes: 10 additions & 0 deletions assets/redxai-file-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions docs/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# RedXaiHM Roadmap

## 0.1 — reference core

- Language specification
- Lexer, parser, AST, and canonical serializer
- Original positional metadata compatibility
- ID and metadata validation
- In-memory ID index
- Find, edit, rename, move, copy, and delete operations
- Transactions
- Atomic file storage, locks, backups, and recovery
- CLI and local official editor
- Windows `.RedXai` association and Red X icon
- Node.js SDK

## 0.2 — schemas and migrations

- Optional schemas
- Required and constrained fields
- Unique indexes beyond IDs
- Version migration declarations
- Query filters and pagination
- Transaction journal and recovery tests
- Performance benchmark suite

## 0.3 — identity service integration

- RedX Identity service adapter
- Migration tooling from the existing SQLite account store
- Dual-write and verification period before cutover
- Session, OAuth, API-key, and audit databases
- Production backup and restore exercises

## Later — RedX Crypt

- Authenticated encrypted `.RedXai` containers
- Key rotation and per-field encryption
- Recovery keys
- Integrity signatures
- Secret-redaction support in the editor and CLI
Loading
Loading