secaudit 0.1.0 → 0.1.2
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/README.md +40 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -38,13 +38,43 @@ npm run dev -- analyze-10k --ticker MSFT --year 2023 --source url \
|
|
|
38
38
|
The system interprets natural language. Required steps may be skipped — the ledger exposes this gap.
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
|
-
#
|
|
41
|
+
# Heuristic intent routing — keyword-based, no API key needed
|
|
42
42
|
npm run dev -- intent "analyze apple 10-k for 2023 and summarize risks"
|
|
43
43
|
|
|
44
44
|
# Override ticker/year if intent parsing misses
|
|
45
45
|
npm run dev -- intent "summarize tesla financial risks" --ticker TSLA --year 2023
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
+
### LLM Intent Mode (Real GPT Routing)
|
|
49
|
+
|
|
50
|
+
For a realistic demonstration, you can route intent through OpenAI GPT-4o-mini. The LLM receives the list of workflow steps and decides which ones to run — no hints to skip.
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# LLM decides which steps to execute
|
|
54
|
+
npm run dev -- intent "summarize apple 2023 risk factors" --llm
|
|
55
|
+
|
|
56
|
+
# Use a different model
|
|
57
|
+
npm run dev -- intent "summarize apple 2023 risk factors" --llm --model gpt-4o
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
This requires an `OPENAI_API_KEY`. See [Environment Setup](#environment-setup) below.
|
|
61
|
+
|
|
62
|
+
## Environment Setup
|
|
63
|
+
|
|
64
|
+
Copy the example file and add your key:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
cp .env.example .env
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Edit `.env`:
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
OPENAI_API_KEY=sk-your-key-here
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The OpenAI key is **optional**. It is only needed for `--llm` mode. Command mode and heuristic intent mode work without any API keys — SEC EDGAR is a free public API that requires no authentication.
|
|
77
|
+
|
|
48
78
|
## CLI Reference
|
|
49
79
|
|
|
50
80
|
```
|
|
@@ -63,6 +93,12 @@ Options (analyze-10k):
|
|
|
63
93
|
--no-strict Lower confidence thresholds
|
|
64
94
|
--no-cache Skip document cache
|
|
65
95
|
--invocation-id <string> Explicit invocation ID
|
|
96
|
+
|
|
97
|
+
Options (intent):
|
|
98
|
+
--llm Route intent through OpenAI GPT (requires OPENAI_API_KEY)
|
|
99
|
+
--model <model> OpenAI model (default: gpt-4o-mini)
|
|
100
|
+
--ticker <string> Optional ticker override
|
|
101
|
+
--year <number> Optional year override
|
|
66
102
|
```
|
|
67
103
|
|
|
68
104
|
## Workflow: `analyze_10k_v1`
|
|
@@ -116,7 +152,8 @@ src/
|
|
|
116
152
|
workflow.ts Step definitions for analyze_10k_v1
|
|
117
153
|
types.ts Core type definitions
|
|
118
154
|
intent-router/
|
|
119
|
-
router.ts Keyword-based intent classifier
|
|
155
|
+
router.ts Keyword-based intent classifier (no API key)
|
|
156
|
+
llm-router.ts OpenAI GPT intent router (optional, --llm flag)
|
|
120
157
|
patterns.ts Ticker/year extraction patterns
|
|
121
158
|
tools/
|
|
122
159
|
fetcher.ts SEC EDGAR fetch + caching
|
|
@@ -145,6 +182,6 @@ npm test # Run tests
|
|
|
145
182
|
|
|
146
183
|
## Data Source
|
|
147
184
|
|
|
148
|
-
Uses the [SEC EDGAR
|
|
185
|
+
Uses the [SEC EDGAR](https://www.sec.gov/developer) public API to fetch 10-K filings. No API key or authentication is required — EDGAR is a free, open government data source. All requests comply with SEC rate limits (<10 req/sec) and include a required User-Agent header with a contact email.
|
|
149
186
|
|
|
150
187
|
Fetched documents are cached in `.cache/` for offline use.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "secaudit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Deterministic 10-K filing analyzer — command-driven vs intent-based invocation. Proves that intent-based invocation is probabilistic; command-driven invocation is deterministic and auditable.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|
|
36
|
-
"url": "https://github.com/
|
|
36
|
+
"url": "https://github.com/souyang/secaudit"
|
|
37
37
|
},
|
|
38
38
|
"author": "Simon Ouyang",
|
|
39
39
|
"license": "MIT",
|