@cexi/hoonfca 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +191 -0
- package/README.md +363 -2
- package/dist/cjs.cjs +9 -0
- package/dist/global-types.d.ts +2 -0
- package/dist/index.d.mts +1254 -0
- package/dist/index.d.ts +1254 -0
- package/dist/index.js +17481 -0
- package/dist/index.mjs +17435 -0
- package/docs/ARCHITECTURE.md +467 -0
- package/docs/DOCS.md +709 -0
- package/docs/sqlite-cache-recovery.md +49 -0
- package/fca-config.example.json +33 -0
- package/npm-shrinkwrap.json +4859 -0
- package/package.json +111 -4
- package/scripts/check-package-exports.cjs +84 -0
- package/scripts/recover-sqlite-cache.cjs +504 -0
- package/scripts/sqlite-cache-dump.py +123 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# SQLite cache recovery
|
|
2
|
+
|
|
3
|
+
The cache is never repaired or recreated automatically. Keep the bot stopped
|
|
4
|
+
while investigating so no process is writing the database. Preserve the
|
|
5
|
+
original database and any `-wal`/`-shm` sidecars exactly as found.
|
|
6
|
+
|
|
7
|
+
Run the recovery utility with three new, distinct output paths on a filesystem
|
|
8
|
+
with enough free space:
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
node scripts/recover-sqlite-cache.cjs \
|
|
12
|
+
/path/to/Fca_Database/database.sqlite \
|
|
13
|
+
/safe/recovery/cache-snapshot.sqlite \
|
|
14
|
+
/safe/recovery/cache-recovered.sqlite
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The utility uses SQLite's online backup API to create the snapshot with the
|
|
18
|
+
source opened read-only. If the snapshot is healthy, it makes a second clean
|
|
19
|
+
copy. If it is corrupt, it first asks the installed `sqlite3` CLI to reconstruct
|
|
20
|
+
into the separate recovered copy. If that is unavailable or fails, it attempts
|
|
21
|
+
a Python standard-library SQL dump from the read-only snapshot into another new
|
|
22
|
+
copy. A failed candidate is retained and a later method never overwrites it.
|
|
23
|
+
|
|
24
|
+
The report includes integrity/quick checks, foreign-key errors, table counts,
|
|
25
|
+
record-by-record differences for readable rows, and explicit-index differences.
|
|
26
|
+
A corrupt source snapshot may still expose readable table rows; a copy is only
|
|
27
|
+
marked verified if the recovered database passes both integrity checks and all
|
|
28
|
+
readable records, tables, indexes, and foreign-key checks match. If table data
|
|
29
|
+
cannot be read or compared, the report remains unverified. These checks cannot
|
|
30
|
+
prove that a corrupt source had no already-unreadable records.
|
|
31
|
+
|
|
32
|
+
SQLite `.recover` availability depends on how the `sqlite3` CLI was built. If the
|
|
33
|
+
command fails, the utility next attempts a Python SQL dump. If SQL reconstruction
|
|
34
|
+
fails (for example, because readable rows violate a unique constraint), it tries
|
|
35
|
+
a last-resort row salvage into a separate database with the readable tables and
|
|
36
|
+
values but without the original constraints or indexes. Row salvage is not a
|
|
37
|
+
production-ready cache and will be reported as unverified. It exists only to
|
|
38
|
+
preserve and compare readable rows; duplicate or damaged records must be
|
|
39
|
+
reviewed and reconciled manually. Any failed candidate is retained and never
|
|
40
|
+
reused as the destination of a later method.
|
|
41
|
+
|
|
42
|
+
If either integrity check or the complete schema/index/record comparison fails,
|
|
43
|
+
preserve all files and use a specialist recovery process; do not replace
|
|
44
|
+
production data. Before any manual replacement review, stop every process that
|
|
45
|
+
could write the cache, preserve the original database and sidecars, record the
|
|
46
|
+
original hash, and keep a separate verified copy. Review the report and compare
|
|
47
|
+
critical user/thread records and relationships. Require explicit human approval,
|
|
48
|
+
then replace production using a separately planned maintenance procedure with a
|
|
49
|
+
rollback copy; this utility has no production replacement operation.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"autoUpdate": true,
|
|
3
|
+
"checkUpdate": {
|
|
4
|
+
"enabled": true,
|
|
5
|
+
"install": false,
|
|
6
|
+
"notifyIfCurrent": false,
|
|
7
|
+
"packageName": "@cexi/hoonfca",
|
|
8
|
+
"registryUrl": "https://registry.npmjs.org",
|
|
9
|
+
"timeoutMs": 10000
|
|
10
|
+
},
|
|
11
|
+
"mqtt": {
|
|
12
|
+
"enabled": true,
|
|
13
|
+
"reconnectInterval": 3600
|
|
14
|
+
},
|
|
15
|
+
"autoLogin": false,
|
|
16
|
+
"apiServer": "",
|
|
17
|
+
"apiKey": "",
|
|
18
|
+
"credentials": {
|
|
19
|
+
"email": "",
|
|
20
|
+
"password": "",
|
|
21
|
+
"twofactor": ""
|
|
22
|
+
},
|
|
23
|
+
"antiGetInfo": {
|
|
24
|
+
"AntiGetThreadInfo": false,
|
|
25
|
+
"AntiGetUserInfo": false
|
|
26
|
+
},
|
|
27
|
+
"remoteControl": {
|
|
28
|
+
"enabled": false,
|
|
29
|
+
"url": "",
|
|
30
|
+
"token": "",
|
|
31
|
+
"autoReconnect": true
|
|
32
|
+
}
|
|
33
|
+
}
|