lastgen 1.0.0 → 1.0.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 +8 -3
- package/package.json +5 -1
- package/src/index.ts +0 -0
- package/src/proof.ts +1 -3
- package/src/types.ts +1 -0
- package/src/verify.ts +2 -2
package/README.md
CHANGED
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
Check if you started coding before or after AI agents.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
[
|
|
8
|
+
[](https://www.npmjs.com/package/lastgen)
|
|
9
|
+
[](https://www.npmjs.com/package/lastgen)
|
|
10
|
+
[](https://packagephobia.com/result?p=lastgen)
|
|
11
|
+
[](https://www.npmjs.com/package/lastgen)
|
|
10
12
|
|
|
11
13
|
</div>
|
|
12
14
|
|
|
@@ -120,11 +122,14 @@ Checks include:
|
|
|
120
122
|
| ---------------------- | --------------------------------------------------------- |
|
|
121
123
|
| **Hash integrity** | Recomputes SHA-256 hash to detect tampering |
|
|
122
124
|
| **Era classification** | Confirms era matches the proof date |
|
|
125
|
+
| **Proof date** | Re-derives proof date from commit and account data |
|
|
123
126
|
| **Identity** | 3-way match: author login, committer login, noreply email |
|
|
124
127
|
| **Repo ownership** | Reports whether commit is in a self-owned or third-party repo |
|
|
125
128
|
| **GitHub ID** | Matches commit author ID against certificate |
|
|
126
129
|
| **Commit date** | Fetches the commit from GitHub and compares dates |
|
|
127
130
|
| **Date consistency** | Detects forged author dates via author/committer drift |
|
|
131
|
+
| **Root commit** | Notes if commit has no parents (higher trust) |
|
|
132
|
+
| **GPG signature** | Notes if commit is cryptographically signed |
|
|
128
133
|
|
|
129
134
|
## License
|
|
130
135
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lastgen",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Check if you started coding before or after AI agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -31,6 +31,10 @@
|
|
|
31
31
|
"coder",
|
|
32
32
|
"cli"
|
|
33
33
|
],
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public",
|
|
36
|
+
"provenance": true
|
|
37
|
+
},
|
|
34
38
|
"license": "MIT",
|
|
35
39
|
"repository": {
|
|
36
40
|
"type": "git",
|
package/src/index.ts
CHANGED
|
File without changes
|
package/src/proof.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { createHash } from 'node:crypto';
|
|
|
6
6
|
|
|
7
7
|
import type { Certificate, EraKey, FirstCommit, GitHubUser } from './types.ts';
|
|
8
8
|
|
|
9
|
-
import { CERTIFICATE_SALT, CERTIFICATE_VERSION, CUTOFF_DATE } from './types.ts';
|
|
9
|
+
import { CERTIFICATE_SALT, CERTIFICATE_VERSION, CUTOFF_DATE, THIRTY_DAYS_MS } from './types.ts';
|
|
10
10
|
|
|
11
11
|
export function classifyEra(proofDate: string): EraKey {
|
|
12
12
|
const cutoff = new Date(CUTOFF_DATE).getTime();
|
|
@@ -14,8 +14,6 @@ export function classifyEra(proofDate: string): EraKey {
|
|
|
14
14
|
return date < cutoff ? 'LAST_GEN' : 'AI_NATIVE';
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
const THIRTY_DAYS_MS = 30 * 24 * 60 * 60 * 1000;
|
|
18
|
-
|
|
19
17
|
export function resolveProofDate(user: GitHubUser, firstCommit: FirstCommit | null): string {
|
|
20
18
|
if (!firstCommit) {
|
|
21
19
|
return new Date().toISOString();
|
package/src/types.ts
CHANGED
package/src/verify.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { readFileSync } from 'node:fs';
|
|
6
6
|
|
|
7
7
|
import type { Certificate, VerifyResult } from './types.ts';
|
|
8
|
-
import { CUTOFF_DATE } from './types.ts';
|
|
8
|
+
import { CUTOFF_DATE, THIRTY_DAYS_MS } from './types.ts';
|
|
9
9
|
import { fetchCommit } from './github.ts';
|
|
10
10
|
import { generateCertificateHash, resolveProofDate } from './proof.ts';
|
|
11
11
|
import { BOX_WIDTH, boxLine, boxRule, error, info, style } from './display.ts';
|
|
@@ -186,7 +186,7 @@ export async function verifyCertificate(filePath: string, token?: string): Promi
|
|
|
186
186
|
const authorTime = new Date(commitDetail.authorDate).getTime();
|
|
187
187
|
const committerTime = new Date(commitDetail.committerDate).getTime();
|
|
188
188
|
const driftMs = Math.abs(committerTime - authorTime);
|
|
189
|
-
const thirtyDaysMs =
|
|
189
|
+
const thirtyDaysMs = THIRTY_DAYS_MS;
|
|
190
190
|
const driftDays = Math.round(driftMs / (24 * 60 * 60 * 1000));
|
|
191
191
|
const consistent = driftMs <= thirtyDaysMs;
|
|
192
192
|
results.push({
|