mirror of
https://github.com/hanzoai/insights.git
synced 2026-10-30 16:15:31 +00:00
The rename runs on the way in and nothing checked it afterwards, so paths and content drifted apart in three places, and each one broke something quietly. The script language had three names at once. Files on disk carried `.iql`/`.iqle`, the source matchers said `.script`, and the bytecode matchers said `.hoge`, so the test harness globbed zero files and the STL compiler regenerated an empty table. It is `script` now, in one place: `.script` source, `.scriptc` bytecode, `bin/script` to run one and `bin/scriptc` to compile one. 190 TypeScript specifiers named files that had been renamed away, which is the whole CDP consumer graph -- the event worker, not the web boot. `--check` only ever read Python imports; it reads both module systems now, and repoints both. `-hog-` became `-mascot-` in paths while content said `script`, so the code review product's skill directories stopped matching the prefix that discovers them and it ran with no perspectives at all. PATH_REGEX is CONTENT_REGEX -- the same list, not a copy -- so a rule can no longer land in one and miss the other, and the four disagreeing `hog` path rules collapse into the one word rule content already had. `HOGLI_*` becomes `INSIGHTSCLI_*` at every reader and writer, with no alias: an env var read under two names is two names. The seven casings of `hogql` and five of `hogvm` collapse into one rule per prefix casing, which leaves the suffix alone because `QL` is SQL's and `VM` is a virtual machine's. `--check` now refuses every retired spelling, in content and in paths, and draws the line the rules draw: `insights_hogfunction` is a Postgres table so it is left alone, and a migration filename is its identity in `django_migrations` so it is frozen rather than failed. Third-party names we cannot rename are reported as pending, never exempted.
49 lines
1.3 KiB
Plaintext
49 lines
1.3 KiB
Plaintext
-- This util helps with differences between jsonStringify in python and node
|
|
let printQ := (q) -> print(replaceAll(jsonStringify(q), ' ', ''))
|
|
|
|
let Hello := (props) -> <span>hello: {props.value}</span>
|
|
print(Hello({ 'value': 'world' }))
|
|
print(<Hello value='world' />)
|
|
|
|
print(<hr/>)
|
|
|
|
let b := <div>outer. <Hello value='hello' /></div>
|
|
print(b)
|
|
|
|
print(<hr/>)
|
|
|
|
let Filter := (props) -> {
|
|
let query := sql(true)
|
|
if (props.name) {
|
|
query := sql({query} and properties.name = {props.name})
|
|
}
|
|
if (props.email) {
|
|
query := sql({query} and properties.email = {props.email})
|
|
}
|
|
return query
|
|
}
|
|
let query1 := <Filter name='John' email='[email protected]' />
|
|
printQ(query1)
|
|
|
|
let query2 := sql(true and <Filter name='John' email='[email protected]' />)
|
|
printQ(query2)
|
|
|
|
let query3a := (
|
|
select
|
|
distinct(properties.name) as name,
|
|
distinct(properties.email) as email
|
|
from events
|
|
where {Filter({'name': 'John', 'email': '[email protected]'})}
|
|
)
|
|
let query3b := (
|
|
select
|
|
distinct(properties.name) as name,
|
|
distinct(properties.email) as email
|
|
from events
|
|
where <Filter name='John' email='[email protected]' />
|
|
)
|
|
printQ(query3a)
|
|
printQ(query3b)
|
|
-- Filter must be expanded
|
|
print('InsightsQLXAttribute' in jsonStringify(query3b) ? 'FAILED' : 'PASSED')
|