Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
194 commits
Select commit Hold shift + click to select a range
40600bf
Run the operations API on the main thread
kriszyp Apr 15, 2026
a7fabca
Authorize operations API on main thread and don't double listen
kriszyp Apr 15, 2026
680e0d6
We must explicitly close servers on the main thread when spawning a n…
kriszyp Apr 15, 2026
43ba7bb
Store and reconstruct computed attribute expressions for cross-thread…
kriszyp Apr 15, 2026
360fc70
Use application pathways for JS computed properties
kriszyp Apr 15, 2026
7443ea1
Formatting
kriszyp Apr 15, 2026
f2be3cd
Update resources/Table.ts
kriszyp Apr 29, 2026
3b8a84b
add composed config helper for out of band merged config inspection
heskew Apr 14, 2026
84de288
chore(deps): update pin digests
renovate[bot] Apr 16, 2026
ec80bcc
Shutdown using our more graceful shutdown process, inside of containers
kriszyp Apr 16, 2026
cae3071
Additional commentary
kriszyp Apr 17, 2026
8c72fa3
Upgrade lmdb
kriszyp Apr 16, 2026
91b5600
Fix multiple HNSW bugs causing intermittent search quality issues
kriszyp Apr 17, 2026
f621d48
Update resources/indexes/HierarchicalNavigableSmallWorld.ts
kriszyp Apr 17, 2026
556a902
Add version support to spawn process management
kriszyp Apr 17, 2026
aed0013
Formatting
kriszyp Apr 17, 2026
4cb42ae
Update security/jsLoader.ts
kriszyp Apr 17, 2026
eeb425f
Apply suggestions from code review
kriszyp Apr 17, 2026
5d01f57
Tolerate missing role on user
kriszyp Apr 20, 2026
6708a64
Add support for comparing dates
kriszyp Apr 20, 2026
5473805
Add a test for comparing dates
kriszyp Apr 20, 2026
cb61ae2
Remove unused var
kriszyp Apr 20, 2026
54bc8f8
Upgrade RocksDB
kriszyp Apr 17, 2026
ac61236
Always record the hostname so that if we later enable replication of …
kriszyp Apr 16, 2026
6d86178
Add loadComponent config option for conditional package loading
kriszyp Apr 17, 2026
5970583
Formatting
kriszyp Apr 17, 2026
a697f0b
docs: Add loadComponent to the schema json
dawsontoth Apr 17, 2026
f0a2e72
freeze-after-load by default, as it is less likely to interfere with …
kriszyp Apr 20, 2026
80525c6
parse npm pack output as JSON
ldt1996 Apr 18, 2026
eec629e
validate npm pack output
ldt1996 Apr 20, 2026
b3443ba
wrap JSON.parse in try/catch
ldt1996 Apr 20, 2026
8c9030b
allow module imports from component dir and PACKAGE_ROOT
ldt1996 Apr 17, 2026
0824ec6
fix format
ldt1996 Apr 17, 2026
c67050a
drop PACKAGE_ROOT
ldt1996 Apr 20, 2026
bc1b3d9
fix unit tests
ldt1996 Apr 20, 2026
635f825
fix lint
ldt1996 Apr 20, 2026
5baefb4
Add migrateOnStart option to migrate LMDB databases to RocksDB
kriszyp Apr 17, 2026
e772633
Formatting
kriszyp Apr 17, 2026
174ae84
lint
kriszyp Apr 17, 2026
af7a9f3
Lower retries a bit
kriszyp Apr 21, 2026
ab7e634
Skip node hostname prompt when env var not present
DavidCockerill Apr 22, 2026
817d25c
Dot Product Distance for vector search
vinaylalwani Apr 14, 2026
5652fa4
Update vector.ts
vinaylalwani Apr 14, 2026
8e92cc3
updated unit test
vinaylalwani Apr 21, 2026
b5f2bc5
formatting
vinaylalwani Apr 21, 2026
864e38c
Adjust scoring
kriszyp Apr 21, 2026
956c1c3
Assign real uses
kriszyp Apr 21, 2026
c8baa03
Really clean up uses
kriszyp Apr 21, 2026
9a05201
Fix replication certificate configuration
kriszyp Apr 22, 2026
c9f00bb
accept HARPER_CLI_TARGET as alias for CLI_TARGET
ldt1996 Apr 21, 2026
bb12fcf
support HARPER_CLI_* env vars
ldt1996 Apr 21, 2026
aa693bd
log connection target
ldt1996 Apr 22, 2026
58ade04
fix lintinggg
ldt1996 Apr 22, 2026
90cec3a
Add retry backoff and fix index removal in transactions
kriszyp Apr 22, 2026
a4d5673
Pass in correct transaction
kriszyp Apr 22, 2026
8f31201
Debug tests
kriszyp Apr 22, 2026
0ce1879
Consistently use putSync for RocksDB
kriszyp Apr 22, 2026
a050a77
Further fixes and debugging
kriszyp Apr 22, 2026
3c0f74c
Refactor RocksIndexStore to extend RocksDatabase and remove context p…
kriszyp Apr 22, 2026
dae7b6c
Pass transaction options through HNSW index operations
kriszyp Apr 22, 2026
be835f7
Fix error log to include stack trace
kriszyp Apr 22, 2026
f20091b
More debugging primary key removal
kriszyp Apr 22, 2026
9aa2d36
Fix transaction handling for eviction
kriszyp Apr 22, 2026
c2e885c
Remove reset txn that assumes LMDB
kriszyp Apr 22, 2026
fadc5f5
Use quadratic backoff for transaction retries
kriszyp Apr 22, 2026
855c61b
Handle transaction options for LMDB
kriszyp Apr 22, 2026
90e0680
For debugging loading metadata
kriszyp Apr 22, 2026
6b82485
Skip tests for LMDB
kriszyp Apr 22, 2026
02ebbb2
More debugging
kriszyp Apr 22, 2026
341aa5e
Cleanup logging
kriszyp Apr 22, 2026
19d77c7
Update version
kriszyp Apr 22, 2026
073948d
add early-hints component integration test
ldt1996 Apr 20, 2026
dac101f
fix format
ldt1996 Apr 20, 2026
3b84134
add redirector component integration test
ldt1996 Apr 17, 2026
99d1656
Reset the event timer when resuming from a paused breakpoint
kriszyp Apr 15, 2026
bd8002a
Update server/throttle.ts
kriszyp Apr 15, 2026
778c0a0
add risk-query component integration test
ldt1996 Apr 16, 2026
9377390
use sendOperation helper for deploy
ldt1996 Apr 17, 2026
82a9e8c
More naunced scoring
kriszyp Apr 23, 2026
285ba80
Move nodeIdMapping from pro version to core
kriszyp Apr 24, 2026
63278fe
Default nodeId is zero
kriszyp Apr 24, 2026
dfc927f
Add configurable allowed directory for applications with 'any' option
kriszyp Apr 23, 2026
a9f1dcd
Update version
kriszyp Apr 24, 2026
95c0fd6
ci: add Claude-powered PR review, mention, and issue-to-PR workflows
heskew Apr 23, 2026
dce966a
ci(claude): fetch-depth cleanup + review-side git ops
heskew Apr 24, 2026
3c4bc5a
ci(claude): address external review findings
heskew Apr 24, 2026
215cd30
Don't double nest uses array
kriszyp Apr 28, 2026
8b7385f
fix: Specify default dev node version
dawsontoth Apr 28, 2026
4dec2a5
Formatting
kriszyp Apr 24, 2026
663fd2d
fix: Add schemas files to npm package
dawsontoth Apr 24, 2026
e6dc490
Add agent guidance
kriszyp Apr 23, 2026
3958090
Add 'redirecting' guidance for Claude
kriszyp Apr 24, 2026
9959da5
Update version
kriszyp Apr 28, 2026
3cc46d0
Removed undefined logger variable
cb1kenobi Apr 26, 2026
17439c8
Upgrade rocksdb-js
kriszyp Apr 28, 2026
31ac1b6
Use PID-based paths consistently in unit test utilities
kriszyp Apr 26, 2026
d959328
Try to keep system database stable
kriszyp Apr 28, 2026
7f161e8
Use process-specific test paths to prevent database conflicts
kriszyp Apr 28, 2026
debbae1
Remove debug console statements from database loading code
kriszyp Apr 28, 2026
4be927f
Link ticket for re-enabling LMDB caching tests
kriszyp Apr 28, 2026
855a784
Cache HTTP responses based on RFC 9111 cacheable status codes
kriszyp Apr 24, 2026
d2cd329
I don't think we return server-timing header in 500 responses
kriszyp Apr 25, 2026
43dccda
Verify 500 responses hit source twice via call counter
kriszyp Apr 26, 2026
55da10f
Expose RocksDB stats in system information
cb1kenobi Apr 22, 2026
b6f7844
Tests
cb1kenobi Apr 22, 2026
60b4c78
Clean up system information test
cb1kenobi Apr 23, 2026
2b03a75
Fix tests
cb1kenobi Apr 23, 2026
5ce5cc6
Fix lmdbGetTableSize test
cb1kenobi Apr 23, 2026
d9ff9ee
Cleanup comment
cb1kenobi Apr 23, 2026
c6f49f6
Formatting
cb1kenobi Apr 23, 2026
a51c1f6
Fix require path
cb1kenobi Apr 23, 2026
ba08011
Fix require path again
cb1kenobi Apr 23, 2026
4281f9f
Test with disk and network both enabled and disabled
cb1kenobi Apr 23, 2026
ec2ae54
Attempt to assign RocksDB stats to either the database or table stats
cb1kenobi Apr 24, 2026
4bb88ab
Enable stats for new databases, update rocksdb-js, set transactionLog…
cb1kenobi Apr 24, 2026
7e3a0ce
Remove unused type
cb1kenobi Apr 24, 2026
bf8fb32
Extract integration testing utils and runner (#334)
Ethan-Arrowood Apr 29, 2026
b48c050
Fix relative require resolution for symlinked modules
kriszyp Apr 29, 2026
ee1a193
Add unit tests for symlinked module relative require resolution
kriszyp Apr 29, 2026
93c490d
Refactor plugin system: replace `start()` with `handleApplication()` …
kriszyp Apr 20, 2026
cf18348
Apply correct prefix and wait for fastify to be ready
kriszyp Apr 20, 2026
5e1132b
Formatting and skip test that probably doesn't apply anymore
kriszyp Apr 20, 2026
ad1759d
Restart workers on requestRestart() instead of any file change
kriszyp Apr 27, 2026
2905b02
Update components/requestRestart.ts
kriszyp Apr 28, 2026
1f290a3
Update components/requestRestart.ts
kriszyp Apr 28, 2026
015f2b1
Fix resource leak on hot-reload in auth and REST modules
kriszyp Apr 29, 2026
2b9e33e
Add Unix Domain Socket mirrors for TLS ports with metadata export
kriszyp Apr 15, 2026
be9b722
Formatting
kriszyp Apr 15, 2026
016dd70
Use rocksdb-js's currentThreadId for thread id
kriszyp Apr 16, 2026
4ae6c70
Don't bypass auth on (by default) on secured port mirroring UDS
kriszyp Apr 16, 2026
1699197
Parse PROXY protocol v1 header on UDS mirror servers
kriszyp Apr 16, 2026
bb9ac61
Update `enableProxyProtocol` to ensure race-free handling of PROXY v1…
kriszyp Apr 19, 2026
031dd7b
Formatting
kriszyp Apr 23, 2026
e4f2145
Remove unintended Bun changes
kriszyp Apr 23, 2026
bbb01b0
Fix require('harperdb') in CJS modules loaded via VM
kriszyp Apr 29, 2026
88db3ef
Handle error in outstandingCommit promise
cb1kenobi Apr 29, 2026
2992d96
Fix formatting
cb1kenobi Apr 29, 2026
3fe930d
ci(claude): consolidate PR review surfaces into one edited comment + …
heskew Apr 30, 2026
a883b13
ci(claude): tighten override so concise-PR rule beats universal calib…
heskew Apr 30, 2026
1c2db42
ci(claude): route within-PR learnings to log surface via $RUNNER_TEMP…
heskew Apr 30, 2026
c5dccbb
fix: handle scalar root config values in OptionsWatcher
kriszyp Apr 30, 2026
804fab0
fix: downgrade TLS SNI log from info to debug
kriszyp Apr 30, 2026
c8f0b6f
ci(claude): bump ai-review-prompts pin to pick up concise-PR + within…
heskew Apr 30, 2026
08c3fc9
Bump main to 5.1.0
cb1kenobi May 1, 2026
9a8dc6e
ci(claude): drop ^ anchor from no-blockers detection regex
heskew May 1, 2026
025b32a
fix: prevent LMDBTransaction leak in evict() causing repeated transac…
kriszyp May 1, 2026
39c3a24
fix: use storage-engine-aware commit in evict() to avoid aborting Roc…
kriszyp May 1, 2026
d090858
ci(claude): marker-based review-comment edit-in-place; fixes mention-…
heskew May 1, 2026
2458b83
ci(claude): tighten gh api allowlist comment — repo-scoped, not PR-sc…
heskew May 1, 2026
2505a2b
Fix schemaDescribe return type
cb1kenobi May 1, 2026
5bbcd75
Wrap source-resolved records in RecordObject with entryMap registration
kriszyp Apr 30, 2026
61e6655
Fix regression: use setPrototypeOf instead of copy+freeze
kriszyp Apr 30, 2026
dbb97cf
Fix TypeScript build: complete Entry object literal, add DESIGN.md
kriszyp Apr 30, 2026
2c318dc
Trying to update a lock file, wish me luck
kriszyp Apr 29, 2026
d2bd475
ci(claude): extract inline workflow scripts to .github/scripts/
heskew May 1, 2026
b8e7b7c
Fix package exports to properly define types of actually globally exp…
Ethan-Arrowood May 1, 2026
0b2a08d
return a promise that resolves once the initial load of entries is co…
Ethan-Arrowood May 1, 2026
a7ebbd0
Only ignore nested node_modules dirs (#448)
cb1kenobi May 1, 2026
2e514b2
fix: guard against undefined events in subscription handler
kriszyp Apr 30, 2026
bf30f37
fix: prevent uncaughtException when timer force-closes a pooled LMDB …
kriszyp Apr 30, 2026
40a04c1
fix: log unexpected errors on stale transaction force-close instead o…
kriszyp Apr 30, 2026
38fa53b
Fix release notes empty for patch releases
kriszyp May 1, 2026
c45307c
Run CI on push to release branches
kriszyp May 1, 2026
861f868
Fix shallow clone breaking git log release notes
kriszyp May 1, 2026
e0d7b03
Export lastValueEncoding from RecordEncoder for use in full replication
kriszyp May 1, 2026
1ece975
Update resources/RecordEncoder.ts
kriszyp May 1, 2026
77d8d07
Remove duplicate variable declarations introduced by merge
kriszyp May 1, 2026
b1b4258
ci(claude): two-job auth gate via App-minted org token + invariants c…
heskew May 1, 2026
33d77cc
ci(claude): fix auth-gate fail-open on empty USERS_TO_CHECK; validato…
heskew May 1, 2026
6ef3a3e
ci(claude): bump max-turns 24→48 + sharpen anti-pattern in Tools section
heskew May 1, 2026
28bdb45
ci(claude): fix yq expression in auth-gate-invariants validator
heskew May 1, 2026
401fefa
ci(claude): bump actions/checkout v4.3.1 → v6.0.2 (Node 24)
heskew May 2, 2026
2063307
ci: bump third-party action versions across workflows
heskew May 4, 2026
c2a39f0
fix(deps): update all non-major dependencies
renovate[bot] May 4, 2026
e130435
fix: Sandbox the component loader tests
dawsontoth May 4, 2026
4432c64
fix: Revert to 21.0.3
dawsontoth May 4, 2026
24d9f9f
Fix crash when CJS module uses dynamic import() via VM loader
kriszyp May 4, 2026
c7fc20c
Auto cherry-pick patch-labeled PRs to release branch
kriszyp May 2, 2026
536e364
Address PR review: remove fetch-depth:0, fix git user identity
kriszyp May 4, 2026
4491564
Fix EEXIST error when symlinking harper module over dangling symlink
kriszyp May 4, 2026
22de601
Fix YAML syntax: move gh pr body into printf variable to avoid uninde…
kriszyp May 4, 2026
58ee866
Fix retroactive patch labeling: add issues/labeled trigger for merged…
kriszyp May 5, 2026
4ec5ca3
Add workflow_dispatch manual trigger to cherry-pick workflow
kriszyp May 5, 2026
1c047e7
Add workflows permission so cherry-pick can push workflow file changes
kriszyp May 5, 2026
548f737
Revert invalid workflows permission key
kriszyp May 5, 2026
11bc253
Merge origin/main into operations-api-main-thread
kriszyp May 5, 2026
87be177
start auth on main thread
kriszyp May 6, 2026
6acfdd8
Merge remote-tracking branch 'origin/main' into operations-api-main-t…
kriszyp May 6, 2026
c993d42
Don't run auth on main thread explicitly
kriszyp May 6, 2026
ac44190
Merge branch 'main' into operations-api-main-thread
kriszyp May 9, 2026
9c80111
fix: add baseRequest authentication fallback in authorize middleware
kriszyp May 10, 2026
7db9741
fix: handle authentication promise rejection in fastifyAuth authorize…
kriszyp May 10, 2026
4e27004
fix: handle authentication decline and correct error propagation in f…
kriszyp May 10, 2026
6660c9e
fix: mark req.raw.user (not request.user) on no-user fallback
kriszyp May 10, 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
2 changes: 2 additions & 0 deletions bin/restart.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ async function restart(req) {
// and shut down.
hdbLogger.debug('Shutdown workers');
await shutdownWorkersNow();
const { closeServers } = require('../server/threads/threadServer.js');
await closeServers();
await processMan.cleanupChildrenProcesses(false);
// remove pid file so it doesn't trip up the launch
await unlinkSync(path.join(envMgr.get(hdbTerms.CONFIG_PARAMS.ROOTPATH), hdbTerms.HDB_PID_FILE), `${process.pid}`);
Expand Down
10 changes: 6 additions & 4 deletions components/componentLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import * as jsHandler from '../resources/jsResource.ts';
import * as login from '../resources/login.ts';
import * as REST from '../server/REST.ts';
import * as fastifyRoutesHandler from '../server/fastifyRoutes.ts';
import * as staticFiles from '../server/static.ts';
import * as loadEnv from '../resources/loadEnv.ts';
import harperLogger from '../utility/logging/harper_logger.js';
Expand All @@ -34,7 +33,6 @@
import { table } from '../resources/databases.ts';
import { startSocketServer } from '../server/threads/socketRouter.ts';
import { getHdbBasePath } from '../utility/environment/environmentManager.js';
import * as operationsServer from '../server/operationsServer.ts';
import * as auth from '../security/auth.ts';
import * as mqtt from '../server/mqtt.ts';
import { getConfigObj, getConfigPath } from '../config/configUtils.js';
Expand Down Expand Up @@ -92,17 +90,18 @@
});
}

export const TRUSTED_RESOURCE_PLUGINS = {

Check failure on line 93 in components/componentLoader.ts

View workflow job for this annotation

GitHub Actions / Build Harper (Node.js v24)

Exported variable 'TRUSTED_RESOURCE_PLUGINS' has or is using name 'AuthAuditLog' from external module "/home/runner/work/harper/harper/utility/logging/harper_logger" but cannot be named.

Check failure on line 93 in components/componentLoader.ts

View workflow job for this annotation

GitHub Actions / Build Harper (Node.js v20)

Exported variable 'TRUSTED_RESOURCE_PLUGINS' has or is using name 'AuthAuditLog' from external module "/home/runner/work/harper/harper/utility/logging/harper_logger" but cannot be named.

Check failure on line 93 in components/componentLoader.ts

View workflow job for this annotation

GitHub Actions / Build Harper (Node.js v22)

Exported variable 'TRUSTED_RESOURCE_PLUGINS' has or is using name 'AuthAuditLog' from external module "/home/runner/work/harper/harper/utility/logging/harper_logger" but cannot be named.

Check failure on line 93 in components/componentLoader.ts

View workflow job for this annotation

GitHub Actions / Unit Test (Node.js v22)

Exported variable 'TRUSTED_RESOURCE_PLUGINS' has or is using name 'AuthAuditLog' from external module "/home/runner/work/harper/harper/utility/logging/harper_logger" but cannot be named.

Check failure on line 93 in components/componentLoader.ts

View workflow job for this annotation

GitHub Actions / Unit Test (Node.js v24)

Exported variable 'TRUSTED_RESOURCE_PLUGINS' has or is using name 'AuthAuditLog' from external module "/home/runner/work/harper/harper/utility/logging/harper_logger" but cannot be named.

Check failure on line 93 in components/componentLoader.ts

View workflow job for this annotation

GitHub Actions / Unit Test (Node.js v20)

Exported variable 'TRUSTED_RESOURCE_PLUGINS' has or is using name 'AuthAuditLog' from external module "/home/runner/work/harper/harper/utility/logging/harper_logger" but cannot be named.
REST, // for backwards compatibility with older configs
rest: REST,
graphql: graphqlQueryHandler,
graphqlSchema: graphqlHandler,
roles,
jsResource: jsHandler,
fastifyRoutes: fastifyRoutesHandler,
get fastifyRoutes() {
Comment thread
cb1kenobi marked this conversation as resolved.
return require('../server/fastifyRoutes');
},
login,
static: staticFiles,
operationsApi: operationsServer,
customFunctions: {},
http: httpComponent,
authentication: auth,
Expand All @@ -115,6 +114,9 @@
login: ...
*/
};
if (isMainThread) {
TRUSTED_RESOURCE_PLUGINS.operationsApi = require('../server/operationsServer');

Check failure on line 118 in components/componentLoader.ts

View workflow job for this annotation

GitHub Actions / Build Harper (Node.js v24)

Property 'operationsApi' does not exist on type '{ REST: typeof import("/home/runner/work/harper/harper/server/REST"); rest: typeof import("/home/runner/work/harper/harper/server/REST"); graphql: typeof import("/home/runner/work/harper/harper/server/graphqlQuerying"); ... 12 more ...; dataLoader: typeof import("/home/runner/work/harper/harper/resources/dataLoader"...'.

Check failure on line 118 in components/componentLoader.ts

View workflow job for this annotation

GitHub Actions / Build Harper (Node.js v20)

Property 'operationsApi' does not exist on type '{ REST: typeof import("/home/runner/work/harper/harper/server/REST"); rest: typeof import("/home/runner/work/harper/harper/server/REST"); graphql: typeof import("/home/runner/work/harper/harper/server/graphqlQuerying"); ... 12 more ...; dataLoader: typeof import("/home/runner/work/harper/harper/resources/dataLoader"...'.

Check failure on line 118 in components/componentLoader.ts

View workflow job for this annotation

GitHub Actions / Build Harper (Node.js v22)

Property 'operationsApi' does not exist on type '{ REST: typeof import("/home/runner/work/harper/harper/server/REST"); rest: typeof import("/home/runner/work/harper/harper/server/REST"); graphql: typeof import("/home/runner/work/harper/harper/server/graphqlQuerying"); ... 12 more ...; dataLoader: typeof import("/home/runner/work/harper/harper/resources/dataLoader"...'.

Check failure on line 118 in components/componentLoader.ts

View workflow job for this annotation

GitHub Actions / Unit Test (Node.js v22)

Property 'operationsApi' does not exist on type '{ REST: typeof import("/home/runner/work/harper/harper/server/REST"); rest: typeof import("/home/runner/work/harper/harper/server/REST"); graphql: typeof import("/home/runner/work/harper/harper/server/graphqlQuerying"); ... 12 more ...; dataLoader: typeof import("/home/runner/work/harper/harper/resources/dataLoader"...'.

Check failure on line 118 in components/componentLoader.ts

View workflow job for this annotation

GitHub Actions / Unit Test (Node.js v24)

Property 'operationsApi' does not exist on type '{ REST: typeof import("/home/runner/work/harper/harper/server/REST"); rest: typeof import("/home/runner/work/harper/harper/server/REST"); graphql: typeof import("/home/runner/work/harper/harper/server/graphqlQuerying"); ... 12 more ...; dataLoader: typeof import("/home/runner/work/harper/harper/resources/dataLoader"...'.

Check failure on line 118 in components/componentLoader.ts

View workflow job for this annotation

GitHub Actions / Unit Test (Node.js v20)

Property 'operationsApi' does not exist on type '{ REST: typeof import("/home/runner/work/harper/harper/server/REST"); rest: typeof import("/home/runner/work/harper/harper/server/REST"); graphql: typeof import("/home/runner/work/harper/harper/server/graphqlQuerying"); ... 12 more ...; dataLoader: typeof import("/home/runner/work/harper/harper/resources/dataLoader"...'.
}

for (const { name, packageIdentifier } of getEnvBuiltInComponents()) {
TRUSTED_RESOURCE_PLUGINS[name] = packageIdentifier;
Expand Down
11 changes: 4 additions & 7 deletions components/operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,15 +396,12 @@ async function deployComponent(req) {

await prepareApplication(application);

// the main thread should never actually load component, just do a deploy
if (isMainThread) return;

// now we attempt to actually load the component in case there is
// an error we can immediately detect and report
const pseudoResources = new Resources();
pseudoResources.isWorker = true;
// an error we can immediately detect and report, but app code should not run on the main thread
if (!isMainThread && !process.env.HARPER_SAFE_MODE) {
const pseudoResources = new Resources();
pseudoResources.isWorker = true;

if (!process.env.HARPER_SAFE_MODE) {
const componentLoader = require('./componentLoader.ts');
let lastError;
componentLoader.setErrorReporter((error) => (lastError = error));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ import { describe, it, beforeEach } from 'node:test';
import assert from 'node:assert/strict';
import { req, reqRest } from '../utils/request.mjs';
import { timestamp } from '../utils/timestamp.mjs';
import request from 'supertest';
import { envUrlRest, headers } from '../config/envConfig.mjs';

describe('18. Computed indexed properties', () => {
beforeEach(timestamp);

//Computed indexed properties Folder

it('Insert data', () => {
return req()
.send({ operation: 'insert', table: 'Product', records: [{ id: '1', price: 100, taxRate: 0.19 }] })
.expect((r) => assert.ok(r.body.message.includes('inserted 1 of 1 records'), r.text))
.expect(200);
it('PUT data', () => {
return request(envUrlRest).put('/Product/1').set(headers).send({ id: '1', price: 100, taxRate: 0.19 }).expect(204);
});

it('Search for attribute', () => {
Expand Down Expand Up @@ -48,7 +47,6 @@ describe('18. Computed indexed properties', () => {
assert.equal(r.body[0].taxRate, 0.19, r.text);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is jsTotalPrice dropped here?

jsTotalPrice is a JS-function-based computed property — it's set via setComputedAttribute('jsTotalPrice', fn) in resources.js, not via @computed(from: "...") in the GraphQL schema. That means it has no computedFromExpression to persist in metadata and reconstruct from.

The new createComputedFrom fallback in Table.ts only fires when attribute.computedFromExpression is present, so jsTotalPrice won't be recomputed on threads that didn't load the component's resources.js (e.g. the main thread).

However, this search goes through the REST endpoint, which hits workers that do load resources.js. So the assertion should still hold — unless the REST response no longer includes JS-only computed properties for some other reason introduced by this PR.

Could you clarify:

  1. Is this a known limitation (JS-function computed properties don't survive cross-thread table reconstruction), and if so, should it be documented?
  2. Or is the assertion removed because the REST path changed how it serializes computed properties?

Silently dropping this assertion could mask a correctness regression for users relying on setComputedAttribute with indexed computed properties.

assert.equal(r.body[0].totalPrice, 119, r.text);
assert.equal(r.body[0].notIndexedTotalPrice, 119, r.text);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jsTotalPrice is still in get_attributes (line 42) but the assertion was dropped without a comment. A reader can't tell whether undefined is the expected response or an oversight.

The commit title "Use application pathways for JS computed properties" explains the intent, but a note in the test would make it self-documenting. Consider either removing jsTotalPrice from get_attributes or adding a comment like:

// jsTotalPrice is a JS-function-registered computed attribute; not available via the
// operations API on the main thread — verified via REST pathway in the tests below.

assert.equal(r.body[0].jsTotalPrice, 119, r.text);
})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The jsTotalPrice assertion was removed here (it was assert.equal(r.body[0].jsTotalPrice, 119, r.text)).

jsTotalPrice is registered via setComputedAttribute('jsTotalPrice', fn) in the component's resources.js. With the operations API now running on the main thread, component JS does not run there, so this attribute is unavailable to search_by_value queries. The @computed(from: "...") attributes (totalPrice, notIndexedTotalPrice) still work because the new createComputedFrom path in Table.ts reconstructs them from persisted metadata.

This is an intentional limitation of the design, but it is undocumented. Please either:

  • Add a comment here (and ideally in AGENTS.md or a CHANGELOG) stating that JS-only computed attributes (setComputedAttribute without a GraphQL @computed(from: "...")) are not available via the operations API when it runs on the main thread, or
  • Keep the assertion if the attribute is expected to be accessible (which would require a fix on the Table layer to also handle non-expression computed functions across threads).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JS-function-registered computed attributes (jsTotalPrice, set via setComputedAttribute(name, fn) from component code) are now silently absent when queried via the operations API — callers requesting that attribute in get_attributes will receive undefined instead of the computed value, with no error or warning.

The createComputedFrom fix in Table.ts reconstructs only @computed(from: "expression") GraphQL attributes; it cannot reconstruct arbitrary JS functions, so this gap is real and permanent under the current architecture.

This is a silent behavioral regression for any integrator who combines JS-computed attributes with the operations API. Minimum fix: add a comment here explaining why the assertion was removed, and note the limitation in AGENTS.md or a comment near setComputedAttribute — something like: "JS-function-registered computed attributes are not available via the operations API (main thread) because component code does not run there."

.expect(200);
});
Expand Down
Loading
Loading